summaryrefslogtreecommitdiff
path: root/xfa/src/fgas/include/fx_datetime.h
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fgas/include/fx_datetime.h')
-rw-r--r--xfa/src/fgas/include/fx_datetime.h50
1 files changed, 28 insertions, 22 deletions
diff --git a/xfa/src/fgas/include/fx_datetime.h b/xfa/src/fgas/include/fx_datetime.h
index f5bbee7f81..99d1561b50 100644
--- a/xfa/src/fgas/include/fx_datetime.h
+++ b/xfa/src/fgas/include/fx_datetime.h
@@ -161,25 +161,25 @@ class CFX_Unitime {
#if _FX_OS_ != _FX_ANDROID_
#pragma pack(push, 1)
#endif
-typedef struct _FX_DATE {
+struct FX_DATE {
int32_t year;
uint8_t month;
uint8_t day;
-} FX_DATE, *FX_LPDATE;
-typedef FX_DATE const* FX_LPCDATE;
-typedef struct _FX_TIME {
+};
+
+struct FX_TIME {
uint8_t hour;
uint8_t minute;
uint8_t second;
FX_WORD millisecond;
-} FX_TIME, *FX_LPTIME;
-typedef FX_TIME const* FX_LPCTIME;
-typedef struct _FX_TIMEZONE {
+};
+
+struct FX_TIMEZONE {
int8_t tzHour;
uint8_t tzMinute;
-} FX_TIMEZONE, *FX_LPTIMEZONE;
-typedef FX_TIMEZONE const* FX_LPCTIMEZONE;
-typedef struct _FX_DATETIME {
+};
+
+struct FX_DATETIME {
union {
struct {
int32_t year;
@@ -197,9 +197,9 @@ typedef struct _FX_DATETIME {
} sTime;
FX_TIME aTime;
} Time;
-} FX_DATETIME, *FX_LPDATETIME;
-typedef FX_DATETIME const* FX_LPCDATETIME;
-typedef struct _FX_DATETIMEZONE {
+};
+
+struct FX_DATETIMEZONE {
union {
struct {
union {
@@ -229,11 +229,11 @@ typedef struct _FX_DATETIMEZONE {
};
FX_TIMEZONE tz;
};
-} FX_DATETIMEZONE, *FX_LPDATETIMEZONE;
-typedef FX_DATETIMEZONE const* FX_LPCDATETIMEZONE;
+};
#if _FX_OS_ != _FX_ANDROID_
#pragma pack(pop)
#endif
+
class CFX_DateTime {
public:
CFX_DateTime() {}
@@ -241,7 +241,7 @@ class CFX_DateTime {
CFX_DateTime(const CFX_DateTime& dt) { m_DateTime = dt.m_DateTime; }
virtual ~CFX_DateTime() {}
operator FX_DATETIME*() { return &m_DateTime; }
- operator FX_DATETIME const*() const { return &m_DateTime; }
+ operator const FX_DATETIME*() const { return &m_DateTime; }
operator FX_DATETIME&() { return m_DateTime; }
operator const FX_DATETIME&() const { return m_DateTime; }
CFX_DateTime& operator=(const CFX_DateTime& dt) {
@@ -331,24 +331,30 @@ class CFX_DateTime {
return dt;
}
friend FX_BOOL operator==(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
- return FXSYS_memcmp((FX_LPCDATETIME)dt1, (FX_LPCDATETIME)dt2,
+ return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1),
+ static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) == 0;
}
friend FX_BOOL operator==(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
- return FXSYS_memcmp((FX_LPCDATETIME)dt1, &dt2, sizeof(FX_DATETIME)) == 0;
+ return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1), &dt2,
+ sizeof(FX_DATETIME)) == 0;
}
friend FX_BOOL operator==(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
- return FXSYS_memcmp(&dt1, (FX_LPCDATETIME)dt2, sizeof(FX_DATETIME)) == 0;
+ return FXSYS_memcmp(&dt1, static_cast<const FX_DATETIME*>(dt2),
+ sizeof(FX_DATETIME)) == 0;
}
friend FX_BOOL operator!=(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
- return FXSYS_memcmp((FX_LPCDATETIME)dt1, (FX_LPCDATETIME)dt2,
+ return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1),
+ static_cast<const FX_DATETIME*>(dt2),
sizeof(FX_DATETIME)) != 0;
}
friend FX_BOOL operator!=(const CFX_DateTime& dt1, const FX_DATETIME& dt2) {
- return FXSYS_memcmp((FX_LPCDATETIME)dt1, &dt2, sizeof(FX_DATETIME)) != 0;
+ return FXSYS_memcmp(static_cast<const FX_DATETIME*>(dt1), &dt2,
+ sizeof(FX_DATETIME)) != 0;
}
friend FX_BOOL operator!=(const FX_DATETIME& dt1, const CFX_DateTime& dt2) {
- return FXSYS_memcmp(&dt1, (FX_LPCDATETIME)dt2, sizeof(FX_DATETIME)) != 0;
+ return FXSYS_memcmp(&dt1, static_cast<const FX_DATETIME*>(dt2),
+ sizeof(FX_DATETIME)) != 0;
}
friend FX_BOOL operator>(const CFX_DateTime& dt1, const CFX_DateTime& dt2) {
return dt1.ToUnitime() > dt2.ToUnitime();