diff options
Diffstat (limited to 'xfa/src/fgas')
45 files changed, 1592 insertions, 1592 deletions
diff --git a/xfa/src/fgas/include/fx_alg.h b/xfa/src/fgas/include/fx_alg.h index ed946641f2..0ee8508083 100644 --- a/xfa/src/fgas/include/fx_alg.h +++ b/xfa/src/fgas/include/fx_alg.h @@ -10,11 +10,11 @@ #ifdef __cplusplus
extern "C" {
#endif
-FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst);
-FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst);
-FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst);
-FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow);
-FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces);
+int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst);
+int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst);
+int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst);
+uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow);
+int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces);
#ifdef __cplusplus
};
#endif
@@ -22,13 +22,13 @@ template<class baseType> class CFX_DSPATemplate
{
public:
- FX_INT32 Lookup(const baseType &find, const baseType *pArray, FX_INT32 iCount)
+ int32_t Lookup(const baseType &find, const baseType *pArray, int32_t iCount)
{
FXSYS_assert(pArray != NULL);
if (iCount < 1) {
return -1;
}
- FX_INT32 iStart = 0, iEnd = iCount - 1, iMid;
+ int32_t iStart = 0, iEnd = iCount - 1, iMid;
do {
iMid = (iStart + iEnd) / 2;
const baseType &v = pArray[iMid];
diff --git a/xfa/src/fgas/include/fx_cpg.h b/xfa/src/fgas/include/fx_cpg.h index 43c6520152..2556426dbc 100644 --- a/xfa/src/fgas/include/fx_cpg.h +++ b/xfa/src/fgas/include/fx_cpg.h @@ -130,28 +130,28 @@ class IFX_CodePage; #define FX_CHARSET_MSWin_EasterEuropean 238
#define FX_CHARSET_US 254
#define FX_CHARSET_OEM 255
-FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset);
+FX_WORD FX_GetCodePageFromCharset(uint8_t charset);
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage);
-FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength);
-FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength);
+FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength);
+FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength);
FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage);
-void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength);
-void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength);
-void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength);
-void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength);
-void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength);
-void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength);
-FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak = FALSE);
-FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen);
+void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength);
+void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength);
+void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength);
+void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength);
+void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength);
+void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength);
+int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak = FALSE);
+int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen);
enum FX_CODESYSTEM {
FX_MBCS = 0,
FX_SBCS ,
FX_DBCS ,
};
typedef struct _FX_CODEPAGE_HEADER {
- FX_UINT16 uCPID;
- FX_UINT8 uMinCharBytes;
- FX_UINT8 uMaxCharBytes;
+ uint16_t uCPID;
+ uint8_t uMinCharBytes;
+ uint8_t uMaxCharBytes;
FX_CODESYSTEM eCPType;
FX_BOOL bHasLeadByte;
FX_WCHAR wMinChar;
@@ -166,13 +166,13 @@ typedef struct _FX_CODEPAGE_HEADER { #define FX_CPMAPTYPE_NoMapping 3
#define FX_CPMAPTYPE_Delta 4
typedef struct _FX_CPCU_MAPTABLE1 {
- FX_UINT16 uMapType;
- FX_UINT16 uUniocde;
+ uint16_t uMapType;
+ uint16_t uUniocde;
} FX_CPCU_MAPTABLE1;
typedef struct _FX_CPCU_MAPTABLE2 {
- FX_UINT8 uTrailByte;
- FX_UINT8 uMapType;
- FX_UINT16 uOffset;
+ uint8_t uTrailByte;
+ uint8_t uMapType;
+ uint16_t uOffset;
} FX_CPCU_MAPTABLE2;
typedef struct _FX_CPCU_MAPINFO {
FX_CPCU_MAPTABLE1 *pMapTable1;
@@ -180,13 +180,13 @@ typedef struct _FX_CPCU_MAPINFO { FX_LPCBYTE pMapData;
} FX_CPCU_MAPINFO;
typedef struct _FX_CPUC_MAPTABLE {
- FX_UINT16 uStartUnicode;
- FX_UINT16 uEndUnicode;
- FX_UINT16 uMapType;
- FX_UINT16 uOffset;
+ uint16_t uStartUnicode;
+ uint16_t uEndUnicode;
+ uint16_t uMapType;
+ uint16_t uOffset;
} FX_CPUC_MAPTABLE;
typedef struct _FX_CPUC_MAPINFO {
- FX_UINT32 uMapCount;
+ uint32_t uMapCount;
FX_CPUC_MAPTABLE *pMapTable;
FX_LPCBYTE pMapData;
} FX_CPUC_MAPINFO;
@@ -197,12 +197,12 @@ typedef struct _FX_CODEPAGE { } FX_CODEPAGE, * FX_LPCODEPAGE;
typedef FX_CODEPAGE const * FX_LPCCODEPAGE;
typedef struct _FX_STR2CPHASH {
- FX_UINT32 uHash;
- FX_UINT32 uCodePage;
+ uint32_t uHash;
+ uint32_t uCodePage;
} FX_STR2CPHASH;
typedef struct _FX_CHARSET_MAP {
- FX_UINT16 charset;
- FX_UINT16 codepage;
+ uint16_t charset;
+ uint16_t codepage;
} FX_CHARSET_MAP;
typedef struct _FX_LANG2CPMAP {
FX_WORD wLanguage;
@@ -216,9 +216,9 @@ public: virtual FX_WORD GetCodePageNumber() const = 0;
virtual FX_CODESYSTEM GetCodeSystemType() const = 0;
virtual FX_BOOL HasLeadByte() const = 0;
- virtual FX_BOOL IsLeadByte(FX_BYTE byte) const = 0;
- virtual FX_INT32 GetMinBytesPerChar() const = 0;
- virtual FX_INT32 GetMaxBytesPerChar() const = 0;
+ virtual FX_BOOL IsLeadByte(uint8_t byte) const = 0;
+ virtual int32_t GetMinBytesPerChar() const = 0;
+ virtual int32_t GetMaxBytesPerChar() const = 0;
virtual FX_WCHAR GetMinCharcode() const = 0;
virtual FX_WCHAR GetMaxCharcode() const = 0;
virtual FX_WCHAR GetDefCharcode() const = 0;
diff --git a/xfa/src/fgas/include/fx_datetime.h b/xfa/src/fgas/include/fx_datetime.h index d18b899fc6..dcaf18398f 100644 --- a/xfa/src/fgas/include/fx_datetime.h +++ b/xfa/src/fgas/include/fx_datetime.h @@ -8,7 +8,7 @@ #define _FX_DATETIME_H_
class CFX_Unitime;
class CFX_DateTime;
-typedef FX_INT64 FX_UNITIME;
+typedef int64_t FX_UNITIME;
enum FX_WEEKDAY {
FX_Sunday = 0,
FX_Monday ,
@@ -18,9 +18,9 @@ enum FX_WEEKDAY { FX_Friday ,
FX_Saturday ,
};
-FX_BOOL FX_IsLeapYear(FX_INT32 iYear);
-FX_INT32 FX_DaysInYear(FX_INT32 iYear);
-FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth);
+FX_BOOL FX_IsLeapYear(int32_t iYear);
+int32_t FX_DaysInYear(int32_t iYear);
+uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth);
class CFX_Unitime
{
public:
@@ -84,25 +84,25 @@ public: }
void Now();
void SetGMTime();
- void Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0);
+ void Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, FX_WORD millisecond = 0);
void Set(FX_UNITIME t);
- FX_INT32 GetYear() const;
- FX_BYTE GetMonth() const;
- FX_BYTE GetDay() const;
+ int32_t GetYear() const;
+ uint8_t GetMonth() const;
+ uint8_t GetDay() const;
FX_WEEKDAY GetDayOfWeek() const;
FX_WORD GetDayOfYear() const;
- FX_INT64 GetDayOfAD() const;
- FX_BYTE GetHour() const;
- FX_BYTE GetMinute() const;
- FX_BYTE GetSecond() const;
+ int64_t GetDayOfAD() const;
+ uint8_t GetHour() const;
+ uint8_t GetMinute() const;
+ uint8_t GetSecond() const;
FX_WORD GetMillisecond() const;
- FX_BOOL AddYears(FX_INT32 iYears);
- FX_BOOL AddMonths(FX_INT32 iMonths);
- FX_BOOL AddDays(FX_INT32 iDays);
- FX_BOOL AddHours(FX_INT32 iHours);
- FX_BOOL AddMinutes(FX_INT32 iMinutes);
- FX_BOOL AddSeconds(FX_INT32 iSeconds);
- FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds);
+ FX_BOOL AddYears(int32_t iYears);
+ FX_BOOL AddMonths(int32_t iMonths);
+ FX_BOOL AddDays(int32_t iDays);
+ FX_BOOL AddHours(int32_t iHours);
+ FX_BOOL AddMinutes(int32_t iMinutes);
+ FX_BOOL AddSeconds(int32_t iSeconds);
+ FX_BOOL AddMilliseconds(int32_t iMilliseconds);
friend CFX_Unitime operator + (const CFX_Unitime &t1, const CFX_Unitime &t2)
{
return CFX_Unitime(t1.m_iUnitime + t2.m_iUnitime);
@@ -206,37 +206,37 @@ private: #pragma pack(push, 1)
#endif
typedef struct _FX_DATE {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
} FX_DATE, * FX_LPDATE;
typedef FX_DATE const * FX_LPCDATE;
typedef struct _FX_TIME {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ 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 {
- FX_INT8 tzHour;
- FX_BYTE tzMinute;
+ int8_t tzHour;
+ uint8_t tzMinute;
} FX_TIMEZONE, * FX_LPTIMEZONE;
typedef FX_TIMEZONE const * FX_LPCTIMEZONE;
typedef struct _FX_DATETIME {
union {
struct {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
} sDate;
FX_DATE aDate;
} Date;
union {
struct {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
FX_WORD millisecond;
} sTime;
FX_TIME aTime;
@@ -248,17 +248,17 @@ typedef struct _FX_DATETIMEZONE { struct {
union {
struct {
- FX_INT32 year;
- FX_BYTE month;
- FX_BYTE day;
+ int32_t year;
+ uint8_t month;
+ uint8_t day;
};
FX_DATE date;
};
union {
struct {
- FX_BYTE hour;
- FX_BYTE minute;
- FX_BYTE second;
+ uint8_t hour;
+ uint8_t minute;
+ uint8_t second;
FX_WORD millisecond;
};
FX_TIME time;
@@ -268,8 +268,8 @@ typedef struct _FX_DATETIMEZONE { };
union {
struct {
- FX_INT8 tzHour;
- FX_BYTE tzMinute;
+ int8_t tzHour;
+ uint8_t tzMinute;
};
FX_TIMEZONE tz;
};
@@ -336,26 +336,26 @@ public: FromUnitime(ToUnitime() - ((const CFX_DateTime&)dt).ToUnitime());
return *this;
}
- virtual FX_BOOL Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour = 0, FX_BYTE minute = 0, FX_BYTE second = 0, FX_WORD millisecond = 0);
+ virtual FX_BOOL Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour = 0, uint8_t minute = 0, uint8_t second = 0, FX_WORD millisecond = 0);
virtual FX_BOOL FromUnitime(FX_UNITIME t);
virtual FX_UNITIME ToUnitime() const;
- virtual FX_INT32 GetYear() const;
- virtual FX_BYTE GetMonth() const;
- virtual FX_BYTE GetDay() const;
+ virtual int32_t GetYear() const;
+ virtual uint8_t GetMonth() const;
+ virtual uint8_t GetDay() const;
virtual FX_WEEKDAY GetDayOfWeek() const;
virtual FX_WORD GetDayOfYear() const;
- virtual FX_INT64 GetDayOfAD() const;
- virtual FX_BYTE GetHour() const;
- virtual FX_BYTE GetMinute() const;
- virtual FX_BYTE GetSecond() const;
+ virtual int64_t GetDayOfAD() const;
+ virtual uint8_t GetHour() const;
+ virtual uint8_t GetMinute() const;
+ virtual uint8_t GetSecond() const;
virtual FX_WORD GetMillisecond() const;
- virtual FX_BOOL AddYears(FX_INT32 iYears);
- virtual FX_BOOL AddMonths(FX_INT32 iMonths);
- virtual FX_BOOL AddDays(FX_INT32 iDays);
- virtual FX_BOOL AddHours(FX_INT32 iHours);
- virtual FX_BOOL AddMinutes(FX_INT32 iMinutes);
- virtual FX_BOOL AddSeconds(FX_INT32 iSeconds);
- virtual FX_BOOL AddMilliseconds(FX_INT32 iMilliseconds);
+ virtual FX_BOOL AddYears(int32_t iYears);
+ virtual FX_BOOL AddMonths(int32_t iMonths);
+ virtual FX_BOOL AddDays(int32_t iDays);
+ virtual FX_BOOL AddHours(int32_t iHours);
+ virtual FX_BOOL AddMinutes(int32_t iMinutes);
+ virtual FX_BOOL AddSeconds(int32_t iSeconds);
+ virtual FX_BOOL AddMilliseconds(int32_t iMilliseconds);
friend CFX_DateTime operator + (const CFX_DateTime &dt1, const CFX_DateTime &dt2)
{
CFX_DateTime dt;
diff --git a/xfa/src/fgas/include/fx_fnt.h b/xfa/src/fgas/include/fx_fnt.h index 491feaea37..85d6e3edff 100644 --- a/xfa/src/fgas/include/fx_fnt.h +++ b/xfa/src/fgas/include/fx_fnt.h @@ -40,13 +40,13 @@ class IFX_FontMgr; class IFX_FontProvider
{
public:
- virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0;
+ virtual FX_BOOL GetCharWidth(IFX_Font* pFont, FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0;
};
class IFX_Font
{
public:
static IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage, IFX_FontMgr *pFontMgr);
- static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr);
+ static IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr);
static IFX_Font* LoadFont(FX_LPCWSTR pszFileName, IFX_FontMgr *pFontMgr);
static IFX_Font* LoadFont(IFX_Stream *pFontStream, IFX_FontMgr *pFontMgr, FX_BOOL bSaveStream = FALSE);
static IFX_Font* LoadFont(CFX_Font *pExtFont, IFX_FontMgr *pFontMgr, FX_BOOL bTakeOver = FALSE);
@@ -56,16 +56,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const = 0;
virtual void GetPsName(CFX_WideString &wsName) const = 0;
virtual FX_DWORD GetFontStyles() const = 0;
- virtual FX_BYTE GetCharSet() const = 0;
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE) = 0;
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0;
- virtual FX_INT32 GetAscent() const = 0;
- virtual FX_INT32 GetDescent() const = 0;
+ virtual uint8_t GetCharSet() const = 0;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE) = 0;
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE) = 0;
+ virtual int32_t GetAscent() const = 0;
+ virtual int32_t GetDescent() const = 0;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE) = 0;
virtual FX_BOOL GetBBox(CFX_Rect &bbox) = 0;
- virtual FX_INT32 GetItalicAngle() const = 0;
+ virtual int32_t GetItalicAngle() const = 0;
virtual void Reset() = 0;
- virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const = 0;
+ virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const = 0;
virtual void* GetDevFont() const = 0;
virtual void SetFontProvider(IFX_FontProvider* pProvider) = 0;
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
@@ -89,7 +89,7 @@ typedef struct _FX_FONTSIGNATURE : public CFX_Target { typedef struct _FX_FONTDESCRIPTOR : public CFX_Target {
FX_WCHAR wsFontFace[32];
FX_DWORD dwFontStyles;
- FX_BYTE uCharSet;
+ uint8_t uCharSet;
FX_FONTSIGNATURE FontSignature;
} FX_FONTDESCRIPTOR, * FX_LPFONTDESCRIPTOR;
typedef FX_FONTDESCRIPTOR const * FX_LPCFONTDESCRIPTOR;
@@ -114,11 +114,11 @@ public: static IFX_FontMgr* Create(FX_LPEnumAllFonts pEnumerator, FX_LPMatchFont pMatcher = NULL, FX_LPVOID pUserData = NULL);
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength) = 0;
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName) = 0;
virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE) = 0;
virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF) = 0;
@@ -130,7 +130,7 @@ class IFX_FontMgrDelegate {
public:
virtual IFX_Font* GetDefFontByCodePage(IFX_FontMgr* pFontMgr, FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(IFX_FontMgr* pFontMgr, uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(IFX_FontMgr* pFontMgr, FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(IFX_FontMgr* pFontMgr, FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
};
@@ -148,7 +148,7 @@ public: static IFX_FontMgr* Create(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL);
virtual void Release() = 0;
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
@@ -156,12 +156,12 @@ public: {
return GetFontByCodePage(wCodePage, dwFontStyles, pszFontFamily);
}
- virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
+ virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL) = 0;
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0;
- virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL) = 0;
- virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0;
+ virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount = NULL) = 0;
+ virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, int32_t iFaceIndex, int32_t* pFaceCount = NULL, FX_BOOL bSaveStream = FALSE) = 0;
virtual void ClearFontCache() = 0;
virtual void RemoveFont(IFX_Font *pFont) = 0;
diff --git a/xfa/src/fgas/include/fx_lbk.h b/xfa/src/fgas/include/fx_lbk.h index 3c7aa5d7dd..f161bb4355 100644 --- a/xfa/src/fgas/include/fx_lbk.h +++ b/xfa/src/fgas/include/fx_lbk.h @@ -22,6 +22,6 @@ enum FX_LINEBREAKTYPE { #define FX_LBCP FX_LBT_COM_PROHIBITED_BRK
#define FX_LBPB FX_LBT_PROHIBITED_BRK
#define FX_LBHS FX_LBT_HANGUL_SPACE_BRK
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength);
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp);
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength);
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp);
#endif
diff --git a/xfa/src/fgas/include/fx_locale.h b/xfa/src/fgas/include/fx_locale.h index 25a6dda4e1..7f4cce5776 100644 --- a/xfa/src/fgas/include/fx_locale.h +++ b/xfa/src/fgas/include/fx_locale.h @@ -61,8 +61,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const = 0;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const = 0;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const = 0;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const = 0;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const = 0;
virtual void GetTimeZone(FX_TIMEZONE& tz) const = 0;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const = 0;
@@ -112,11 +112,11 @@ class CFX_Decimal {
public:
CFX_Decimal();
- CFX_Decimal(FX_UINT32 val);
- CFX_Decimal(FX_UINT64 val);
- CFX_Decimal(FX_INT32 val);
- CFX_Decimal(FX_INT64 val);
- CFX_Decimal(FX_FLOAT val, FX_UINT8 scale = 3);
+ CFX_Decimal(uint32_t val);
+ CFX_Decimal(uint64_t val);
+ CFX_Decimal(int32_t val);
+ CFX_Decimal(int64_t val);
+ CFX_Decimal(FX_FLOAT val, uint8_t scale = 3);
CFX_Decimal(FX_WSTR str);
CFX_Decimal(FX_BSTR str);
operator CFX_WideString() const;
@@ -132,29 +132,29 @@ public: CFX_Decimal operator * (const CFX_Decimal& val) const;
CFX_Decimal operator / (const CFX_Decimal& val) const;
CFX_Decimal operator % (const CFX_Decimal& val) const;
- void SetScale(FX_UINT8 newScale);
- FX_UINT8 GetScale();
+ void SetScale(uint8_t newScale);
+ uint8_t GetScale();
void SetAbs();
void SetNegate();
void SetFloor();
void SetCeiling();
void SetTruncate();
protected:
- CFX_Decimal(FX_UINT32 hi, FX_UINT32 mid, FX_UINT32 lo, FX_BOOL neg, FX_UINT8 scale);
+ CFX_Decimal(uint32_t hi, uint32_t mid, uint32_t lo, FX_BOOL neg, uint8_t scale);
inline FX_BOOL IsNotZero() const
{
return m_uHi || m_uMid || m_uLo;
}
- inline FX_INT8 Compare (const CFX_Decimal& val) const;
+ inline int8_t Compare (const CFX_Decimal& val) const;
inline void Swap(CFX_Decimal& val);
inline void FloorOrCeil(FX_BOOL bFloor);
CFX_Decimal AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) const;
CFX_Decimal Multiply(const CFX_Decimal& val) const;
CFX_Decimal Divide(const CFX_Decimal& val) const;
CFX_Decimal Modulus(const CFX_Decimal& val) const;
- FX_UINT32 m_uFlags;
- FX_UINT32 m_uHi;
- FX_UINT32 m_uLo;
- FX_UINT32 m_uMid;
+ uint32_t m_uFlags;
+ uint32_t m_uHi;
+ uint32_t m_uLo;
+ uint32_t m_uMid;
};
#endif
diff --git a/xfa/src/fgas/include/fx_mem.h b/xfa/src/fgas/include/fx_mem.h index 18cd85e422..265c582884 100644 --- a/xfa/src/fgas/include/fx_mem.h +++ b/xfa/src/fgas/include/fx_mem.h @@ -31,7 +31,7 @@ class CFX_Target public:
void* operator new(size_t size)
{
- return FX_Alloc(FX_BYTE, size);
+ return FX_Alloc(uint8_t, size);
}
void operator delete(void *p)
{
diff --git a/xfa/src/fgas/include/fx_rbk.h b/xfa/src/fgas/include/fx_rbk.h index 3053fc5e1b..cff63ee490 100644 --- a/xfa/src/fgas/include/fx_rbk.h +++ b/xfa/src/fgas/include/fx_rbk.h @@ -69,17 +69,17 @@ typedef struct _FX_RTFTEXTOBJ { iVerticalScale = 100;
}
FX_LPCWSTR pStr;
- FX_INT32 *pWidths;
- FX_INT32 iLength;
+ int32_t *pWidths;
+ int32_t iLength;
IFX_Font *pFont;
FX_FLOAT fFontSize;
FX_DWORD dwLayoutStyles;
- FX_INT32 iCharRotation;
- FX_INT32 iBidiLevel;
+ int32_t iCharRotation;
+ int32_t iBidiLevel;
FX_LPCRECTF pRect;
FX_WCHAR wLineBreakChar;
- FX_INT32 iHorizontalScale;
- FX_INT32 iVerticalScale;
+ int32_t iHorizontalScale;
+ int32_t iVerticalScale;
} FX_RTFTEXTOBJ, * FX_LPRTFTEXTOBJ;
typedef FX_RTFTEXTOBJ const * FX_LPCRTFTEXTOBJ;
class CFX_RTFPiece : public CFX_Target
@@ -117,24 +117,24 @@ public: }
m_iChars ++;
}
- FX_INT32 GetEndPos() const
+ int32_t GetEndPos() const
{
return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth;
}
- FX_INT32 GetLength() const
+ int32_t GetLength() const
{
return m_iChars;
}
- FX_INT32 GetEndChar() const
+ int32_t GetEndChar() const
{
return m_iStartChar + m_iChars;
}
- CFX_RTFChar& GetChar(FX_INT32 index)
+ CFX_RTFChar& GetChar(int32_t index)
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return *m_pChars->GetDataPtr(m_iStartChar + index);
}
- CFX_RTFChar* GetCharPtr(FX_INT32 index) const
+ CFX_RTFChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return m_pChars->GetDataPtr(m_iStartChar + index);
@@ -142,9 +142,9 @@ public: void GetString (FX_LPWSTR pText) const
{
FXSYS_assert(pText != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pText ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -155,12 +155,12 @@ public: GetString(pText);
wsText.ReleaseBuffer(m_iChars);
}
- void GetWidths(FX_INT32 *pWidths) const
+ void GetWidths(int32_t *pWidths) const
{
FXSYS_assert(pWidths != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_RTFChar *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pWidths ++ = pChar->m_iCharWidth;
}
@@ -180,16 +180,16 @@ public: m_iVerticalScale = 100;
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iStartPos;
- FX_INT32 m_iWidth;
- FX_INT32 m_iStartChar;
- FX_INT32 m_iChars;
- FX_INT32 m_iBidiLevel;
- FX_INT32 m_iBidiPos;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iFontHeight;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
+ int32_t m_iStartPos;
+ int32_t m_iWidth;
+ int32_t m_iStartChar;
+ int32_t m_iChars;
+ int32_t m_iBidiLevel;
+ int32_t m_iBidiPos;
+ int32_t m_iFontSize;
+ int32_t m_iFontHeight;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
FX_DWORD m_dwLayoutStyles;
FX_DWORD m_dwIdentity;
CFX_RTFCharArray *m_pChars;
@@ -214,22 +214,22 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
- virtual void SetHorizontalScale(FX_INT32 iScale) = 0;
- virtual void SetVerticalScale(FX_INT32 iScale) = 0;
- virtual void SetCharRotation(FX_INT32 iCharRotation) = 0;
+ virtual void SetHorizontalScale(int32_t iScale) = 0;
+ virtual void SetVerticalScale(int32_t iScale) = 0;
+ virtual void SetCharRotation(int32_t iCharRotation) = 0;
virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0;
virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace) = 0;
virtual void SetReadingOrder(FX_BOOL bRTL = FALSE) = 0;
- virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left) = 0;
+ virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left) = 0;
virtual void SetUserData(IFX_Unknown *pUserData) = 0;
virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0;
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak) = 0;
- virtual FX_INT32 CountBreakPieces() const = 0;
- virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const = 0;
+ virtual int32_t CountBreakPieces() const = 0;
+ virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const = 0;
virtual void GetLineRect(CFX_RectF &rect) const = 0;
virtual void ClearBreakPieces() = 0;
virtual void Reset() = 0;
- virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
- virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
+ virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
+ virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_sax.h b/xfa/src/fgas/include/fx_sax.h index c0159f8c22..e45ca4e6d8 100644 --- a/xfa/src/fgas/include/fx_sax.h +++ b/xfa/src/fgas/include/fx_sax.h @@ -39,8 +39,8 @@ class IFX_SAXReader {
public:
virtual void Release() = 0;
- virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0;
- virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL) = 0;
+ virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0) = 0;
+ virtual int32_t ContinueParse(IFX_Pause *pPause = NULL) = 0;
virtual void SkipCurrentNode() = 0;
virtual void SetHandler(IFX_SAXReaderHandler *pHandler) = 0;
};
diff --git a/xfa/src/fgas/include/fx_stm.h b/xfa/src/fgas/include/fx_stm.h index ae424dba2d..e6094d445c 100644 --- a/xfa/src/fgas/include/fx_stm.h +++ b/xfa/src/fgas/include/fx_stm.h @@ -11,7 +11,7 @@ IFX_FileRead* FX_CreateFileRead(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream #ifdef FX_FILESIZE
IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_FILESIZE iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
#else
-IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
+IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize = -1, FX_BOOL bReleaseStream = TRUE);
#endif
IFX_FileWrite* FX_CreateFileWrite(IFX_Stream *pBaseStream, FX_BOOL bReleaseStream = FALSE);
enum FX_STREAMACCESS {
@@ -34,27 +34,27 @@ public: static IFX_Stream* CreateStream(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
static IFX_Stream* CreateStream(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
static IFX_Stream* CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess);
- static IFX_Stream* CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess);
- static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE);
+ static IFX_Stream* CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess);
+ static IFX_Stream* CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize = -1, FX_BOOL bReleaseBufferRead = TRUE);
static IFX_Stream* CreateTextStream(IFX_Stream *pBaseStream, FX_BOOL bDeleteOnRelease);
virtual void Release() = 0;
virtual IFX_Stream* Retain() = 0;
virtual FX_DWORD GetAccessModes() const = 0;
- virtual FX_INT32 GetLength() const = 0;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0;
- virtual FX_INT32 GetPosition() = 0;
+ virtual int32_t GetLength() const = 0;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
+ virtual int32_t GetPosition() = 0;
virtual FX_BOOL IsEOF() const = 0;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL) = 0;
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0;
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL) = 0;
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(FX_INT32 iLength) = 0;
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const = 0;
+ virtual FX_BOOL SetLength(int32_t iLength) = 0;
+ virtual int32_t GetBOM(uint8_t bom[4]) const = 0;
virtual FX_WORD GetCodePage() const = 0;
virtual FX_WORD SetCodePage(FX_WORD wCodePage) = 0;
virtual void Lock() = 0;
virtual void Unlock() = 0;
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength) = 0;
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength) = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_sys.h b/xfa/src/fgas/include/fx_sys.h index c0b5c7445f..8e099bce05 100644 --- a/xfa/src/fgas/include/fx_sys.h +++ b/xfa/src/fgas/include/fx_sys.h @@ -11,10 +11,10 @@ extern "C" { #endif
#define FX_RAD2DEG(r) ((r) * 180.0f / FX_PI)
#define FX_DEG2RAD(a) ((a) * FX_PI / 180.0f)
-typedef FX_INT8 * FX_LPINT8;
-typedef FX_INT8 const * FX_LPCINT8;
-typedef FX_INT32 * FX_LPINT32;
-typedef FX_INT32 const * FX_LPCINT32;
+typedef int8_t * FX_LPINT8;
+typedef int8_t const * FX_LPCINT8;
+typedef int32_t * FX_LPINT32;
+typedef int32_t const * FX_LPCINT32;
typedef long FX_LONG;
typedef FX_LONG * FX_LPLONG;
typedef FX_LONG const * FX_LPCLONG;
@@ -24,30 +24,30 @@ typedef FX_DOUBLE * FX_LPDOUBLE; typedef FX_DOUBLE const * FX_LPCDOUBLE;
FX_FLOAT FX_tan(FX_FLOAT a);
FX_FLOAT FX_log(FX_FLOAT b, FX_FLOAT x);
-FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
-FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength = -1, FX_INT32 *pUsedLen = NULL);
+FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
+FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count);
-FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
-FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
-inline FX_BOOL FX_islower(FX_INT32 ch)
+int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count);
+int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count);
+inline FX_BOOL FX_islower(int32_t ch)
{
return ch >= 'a' && ch <= 'z';
}
-inline FX_BOOL FX_isupper(FX_INT32 ch)
+inline FX_BOOL FX_isupper(int32_t ch)
{
return ch >= 'A' && ch <= 'Z';
}
-inline FX_INT32 FX_tolower(FX_INT32 ch)
+inline int32_t FX_tolower(int32_t ch)
{
return FX_isupper(ch) ? (ch + 0x20) : ch;
}
-inline FX_INT32 FX_toupper(FX_INT32 ch)
+inline int32_t FX_toupper(int32_t ch)
{
return FX_islower(ch) ? (ch - 0x20) : ch;
}
-FX_INT32 FX_filelength(FXSYS_FILE *file);
-FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size);
-void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size);
+int32_t FX_filelength(FXSYS_FILE *file);
+FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size);
+void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size);
void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size);
FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsPath);
FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &wsRelativePath, CFX_WideString &wsAbsolutePath);
diff --git a/xfa/src/fgas/include/fx_tbk.h b/xfa/src/fgas/include/fx_tbk.h index ab64d1dac0..69b42f1fd7 100644 --- a/xfa/src/fgas/include/fx_tbk.h +++ b/xfa/src/fgas/include/fx_tbk.h @@ -60,8 +60,8 @@ class IFX_TxtBreak; class IFX_TxtAccess
{
public:
- virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, FX_INT32 index) const = 0;
- virtual FX_INT32 GetWidth(FX_LPVOID pIdentity, FX_INT32 index) const = 0;
+ virtual FX_WCHAR GetChar(FX_LPVOID pIdentity, int32_t index) const = 0;
+ virtual int32_t GetWidth(FX_LPVOID pIdentity, int32_t index) const = 0;
};
typedef struct _FX_TXTRUN {
_FX_TXTRUN()
@@ -85,14 +85,14 @@ typedef struct _FX_TXTRUN { IFX_TxtAccess *pAccess;
FX_LPVOID pIdentity;
FX_LPCWSTR pStr;
- FX_INT32 *pWidths;
- FX_INT32 iLength;
+ int32_t *pWidths;
+ int32_t iLength;
IFX_Font *pFont;
FX_FLOAT fFontSize;
FX_DWORD dwStyles;
- FX_INT32 iHorizontalScale;
- FX_INT32 iVerticalScale;
- FX_INT32 iCharRotation;
+ int32_t iHorizontalScale;
+ int32_t iVerticalScale;
+ int32_t iCharRotation;
FX_DWORD dwCharStyles;
FX_LPCRECTF pRect;
FX_WCHAR wLineBreakChar;
@@ -116,19 +116,19 @@ public: , m_pUserData(NULL)
{
}
- FX_INT32 GetEndPos() const
+ int32_t GetEndPos() const
{
return m_iWidth < 0 ? m_iStartPos : m_iStartPos + m_iWidth;
}
- FX_INT32 GetLength() const
+ int32_t GetLength() const
{
return m_iChars;
}
- FX_INT32 GetEndChar() const
+ int32_t GetEndChar() const
{
return m_iStartChar + m_iChars;
}
- CFX_TxtChar* GetCharPtr(FX_INT32 index) const
+ CFX_TxtChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL);
return m_pChars->GetDataPtr(m_iStartChar + index);
@@ -136,9 +136,9 @@ public: void GetString(FX_LPWSTR pText) const
{
FXSYS_assert(pText != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_Char *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pText ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -150,25 +150,25 @@ public: GetString(pText);
wsText.ReleaseBuffer(m_iChars);
}
- void GetWidths(FX_INT32 *pWidths) const
+ void GetWidths(int32_t *pWidths) const
{
FXSYS_assert(pWidths != NULL);
- FX_INT32 iEndChar = m_iStartChar + m_iChars;
+ int32_t iEndChar = m_iStartChar + m_iChars;
CFX_Char *pChar;
- for (FX_INT32 i = m_iStartChar; i < iEndChar; i ++) {
+ for (int32_t i = m_iStartChar; i < iEndChar; i ++) {
pChar = m_pChars->GetDataPtr(i);
*pWidths ++ = pChar->m_iCharWidth;
}
}
FX_DWORD m_dwStatus;
- FX_INT32 m_iStartPos;
- FX_INT32 m_iWidth;
- FX_INT32 m_iStartChar;
- FX_INT32 m_iChars;
- FX_INT32 m_iBidiLevel;
- FX_INT32 m_iBidiPos;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
+ int32_t m_iStartPos;
+ int32_t m_iWidth;
+ int32_t m_iStartChar;
+ int32_t m_iChars;
+ int32_t m_iBidiLevel;
+ int32_t m_iBidiPos;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
FX_DWORD m_dwCharStyles;
CFX_TxtCharArray *m_pChars;
FX_LPVOID m_pUserData;
@@ -189,23 +189,23 @@ public: virtual void SetDefaultChar(FX_WCHAR wch) = 0;
virtual void SetParagraphBreakChar(FX_WCHAR wch) = 0;
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance) = 0;
- virtual void SetHorizontalScale(FX_INT32 iScale) = 0;
- virtual void SetVerticalScale(FX_INT32 iScale) = 0;
- virtual void SetCharRotation(FX_INT32 iCharRotation) = 0;
+ virtual void SetHorizontalScale(int32_t iScale) = 0;
+ virtual void SetVerticalScale(int32_t iScale) = 0;
+ virtual void SetCharRotation(int32_t iCharRotation) = 0;
virtual void SetCharSpace(FX_FLOAT fCharSpace) = 0;
- virtual void SetAlignment(FX_INT32 iAlignment) = 0;
+ virtual void SetAlignment(int32_t iAlignment) = 0;
virtual FX_DWORD GetContextCharStyles() const = 0;
virtual void SetContextCharStyles(FX_DWORD dwCharStyles) = 0;
virtual void SetCombWidth(FX_FLOAT fCombWidth) = 0;
virtual void SetUserData(FX_LPVOID pUserData) = 0;
virtual FX_DWORD AppendChar(FX_WCHAR wch) = 0;
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak) = 0;
- virtual FX_INT32 CountBreakChars() const = 0;
- virtual FX_INT32 CountBreakPieces() const = 0;
- virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const = 0;
+ virtual int32_t CountBreakChars() const = 0;
+ virtual int32_t CountBreakPieces() const = 0;
+ virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const = 0;
virtual void ClearBreakPieces() = 0;
virtual void Reset() = 0;
- virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
- virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
+ virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const = 0;
+ virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const = 0;
};
#endif
diff --git a/xfa/src/fgas/include/fx_ucd.h b/xfa/src/fgas/include/fx_ucd.h index 715c8af4dd..7b5b6532a5 100644 --- a/xfa/src/fgas/include/fx_ucd.h +++ b/xfa/src/fgas/include/fx_ucd.h @@ -14,7 +14,7 @@ #define FX_JAPCHARPROPERTYEX_Bottom 0x30
typedef struct _FX_JAPCHARPROPERTYEX {
FX_WCHAR wChar;
- FX_BYTE uAlign;
+ uint8_t uAlign;
} FX_JAPCHARPROPERTYEX, *FX_LPJAPCHARPROPERTYEX;
typedef FX_JAPCHARPROPERTYEX const * FX_LPCJAPCHARPROPERTYEX;
FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch);
diff --git a/xfa/src/fgas/include/fx_utl.h b/xfa/src/fgas/include/fx_utl.h index 850543786c..35b676f41e 100644 --- a/xfa/src/fgas/include/fx_utl.h +++ b/xfa/src/fgas/include/fx_utl.h @@ -34,16 +34,16 @@ private: class CFX_BaseArray : public CFX_Target
{
protected:
- CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize);
+ CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize);
~CFX_BaseArray();
- FX_INT32 GetSize() const;
- FX_INT32 GetBlockSize() const;
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ int32_t GetSize() const;
+ int32_t GetBlockSize() const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
FX_LPBYTE GetBuffer() const;
- FX_INT32 Append(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ int32_t Append(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
FX_LPVOID m_pData;
};
@@ -51,13 +51,13 @@ template<class baseType> class CFX_BaseArrayTemplate : public CFX_BaseArray
{
public:
- CFX_BaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
- CFX_BaseArrayTemplate(FX_INT32 iGrowSize, FX_INT32 iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {}
- FX_INT32 GetSize() const
+ CFX_BaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
+ CFX_BaseArrayTemplate(int32_t iGrowSize, int32_t iBlockSize) : CFX_BaseArray(iGrowSize, iBlockSize) {}
+ int32_t GetSize() const
{
return CFX_BaseArray::GetSize();
}
- FX_INT32 GetBlockSize() const
+ int32_t GetBlockSize() const
{
return CFX_BaseArray::GetBlockSize();
}
@@ -65,9 +65,9 @@ public: {
return (baseType*)CFX_BaseArray::AddSpaceTo(CFX_BaseArray::GetSize());
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseArray::GetSize();
+ int32_t index = CFX_BaseArray::GetSize();
*(baseType*)CFX_BaseArray::AddSpaceTo(index) = element;
return index;
}
@@ -75,31 +75,31 @@ public: {
return (baseType*)CFX_BaseArray::GetBuffer();
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseArray::GetAt(index);
}
- void SetAt(FX_INT32 index, const baseType &element)
+ void SetAt(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseArray::GetAt(index) = element;
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseArray::AddSpaceTo(index) = element;
}
- FX_INT32 Append(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseArray::Append(src, iStart, iCount);
}
- FX_INT32 Copy(const CFX_BaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_BaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseArray::Copy(src, iStart, iCount);
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
return CFX_BaseArray::RemoveLast(iCount);
}
@@ -115,41 +115,41 @@ template<class baseType> class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray
{
public:
- CFX_ObjectBaseArrayTemplate(FX_INT32 iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
+ CFX_ObjectBaseArrayTemplate(int32_t iGrowSize = 100) : CFX_BaseArray(iGrowSize, sizeof(baseType)) {}
~CFX_ObjectBaseArrayTemplate()
{
RemoveAll(FALSE);
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseArray::GetSize();
}
- FX_INT32 GetBlockSize() const
+ int32_t GetBlockSize() const
{
return CFX_BaseArray::GetBlockSize();
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseArray::GetSize();
+ int32_t index = CFX_BaseArray::GetSize();
baseType *p = (baseType*)CFX_BaseArray::AddSpaceTo(index);
FXTARGET_New ((void*)p)baseType(element);
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseArray::GetAt(index);
}
- FX_INT32 Append(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
FXSYS_assert(GetBlockSize() == src.GetBlockSize());
if (iCount == 0) {
return 0;
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
@@ -163,21 +163,21 @@ public: iSize = CFX_BaseArray::GetSize();
CFX_BaseArray::AddSpaceTo(iSize + iCount - 1);
FX_LPBYTE *pStart = CFX_BaseArray::GetAt(iSize);
- FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize();
+ int32_t iBlockSize = CFX_BaseArray::GetBlockSize();
iSize = iStart + iCount;
- for (FX_INT32 i = iStart; i < iSize; i ++) {
+ for (int32_t i = iStart; i < iSize; i ++) {
FXTARGET_NewWith ((void*)pStart)baseType(src.GetAt(i));
pStart += iBlockSize;
}
return iCount;
}
- FX_INT32 Copy(const CFX_ObjectBaseArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectBaseArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
FXSYS_assert(GetBlockSize() == src.GetBlockSize());
if (iCount == 0) {
return 0;
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
@@ -191,32 +191,32 @@ public: RemoveAll(TRUE);
CFX_BaseArray::AddSpaceTo(iCount - 1);
FX_LPBYTE *pStart = CFX_BaseArray::GetAt(0);
- FX_INT32 iBlockSize = CFX_BaseArray::GetBlockSize();
+ int32_t iBlockSize = CFX_BaseArray::GetBlockSize();
iSize = iStart + iCount;
- for (FX_INT32 i = iStart; i < iSize; i ++) {
+ for (int32_t i = iStart; i < iSize; i ++) {
FXTARGET_New ((void*)pStart)baseType(src.GetAt(i));
pStart += iBlockSize;
}
return iCount;
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
- FX_INT32 iSize = CFX_BaseArray::GetSize();
+ int32_t iSize = CFX_BaseArray::GetSize();
if (iCount < 0 || iCount > iSize) {
iCount = iSize;
}
if (iCount == 0) {
return iSize;
}
- for (FX_INT32 i = iSize - iCount; i < iSize; i ++) {
+ for (int32_t i = iSize - iCount; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
return CFX_BaseArray::RemoveLast(iCount);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseArray::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseArray::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
CFX_BaseArray::RemoveAll(bLeaveMemory);
@@ -225,14 +225,14 @@ public: class CFX_BaseMassArray : public CFX_Target
{
protected:
- CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseMassArray();
- FX_INT32 GetSize() const;
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
- FX_INT32 Append(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseMassArray &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ int32_t GetSize() const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
+ int32_t Append(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseMassArray &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
@@ -240,9 +240,9 @@ template<class baseType> class CFX_MassArrayTemplate : public CFX_BaseMassArray
{
public:
- CFX_MassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
- CFX_MassArrayTemplate(FX_INT32 iChunkSize, FX_INT32 iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {}
- FX_INT32 GetSize() const
+ CFX_MassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
+ CFX_MassArrayTemplate(int32_t iChunkSize, int32_t iBlockSize) : CFX_BaseMassArray(iChunkSize, iBlockSize) {}
+ int32_t GetSize() const
{
return CFX_BaseMassArray::GetSize();
}
@@ -250,37 +250,37 @@ public: {
return (baseType*)CFX_BaseMassArray::AddSpaceTo(CFX_BaseMassArray::GetSize());
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseMassArray::GetSize();
+ int32_t index = CFX_BaseMassArray::GetSize();
*(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseMassArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseMassArray::GetAt(index);
}
- void SetAt(FX_INT32 index, const baseType &element)
+ void SetAt(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseMassArray::GetAt(index) = element;
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
}
- FX_INT32 Append(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseMassArray::Append(src, iStart, iCount);
}
- FX_INT32 Copy(const CFX_MassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_MassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
return CFX_BaseMassArray::Copy(src, iStart, iCount);
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
return CFX_BaseMassArray::RemoveLast(iCount);
}
@@ -290,7 +290,7 @@ public: }
};
typedef CFX_MassArrayTemplate<FX_LPVOID> CFX_PtrMassArray;
-typedef CFX_MassArrayTemplate<FX_INT32> CFX_Int32MassArray;
+typedef CFX_MassArrayTemplate<int32_t> CFX_Int32MassArray;
typedef CFX_MassArrayTemplate<FX_DWORD> CFX_DWordMassArray;
typedef CFX_MassArrayTemplate<FX_WORD> CFX_WordMassArray;
typedef CFX_MassArrayTemplate<CFX_Rect> CFX_RectMassArray;
@@ -299,87 +299,87 @@ template<class baseType> class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray
{
public:
- CFX_ObjectMassArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
+ CFX_ObjectMassArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
~CFX_ObjectMassArrayTemplate()
{
RemoveAll(FALSE);
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 Add(const baseType &element)
+ int32_t Add(const baseType &element)
{
- FX_INT32 index = CFX_BaseMassArray::GetSize();
+ int32_t index = CFX_BaseMassArray::GetSize();
baseType *p = (baseType*)CFX_BaseMassArray::AddSpaceTo(index);
FXTARGET_New ((void*)p)baseType(element);
return index;
}
- baseType& GetAt(FX_INT32 index) const
+ baseType& GetAt(int32_t index) const
{
return *(baseType*)CFX_BaseMassArray::GetAt(index);
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseMassArray::GetAt(index);
}
- FX_INT32 Append(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Append(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Add(src.GetAt(i));
}
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 Copy(const CFX_ObjectMassArrayTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectMassArrayTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
RemoveAll(TRUE);
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Add(src.GetAt(i));
}
return CFX_BaseMassArray::GetSize();
}
- FX_INT32 RemoveLast(FX_INT32 iCount = -1)
+ int32_t RemoveLast(int32_t iCount = -1)
{
- FX_INT32 iSize = CFX_BaseMassArray::GetSize();
+ int32_t iSize = CFX_BaseMassArray::GetSize();
if (iCount < 0 || iCount > iSize) {
iCount = iSize;
}
if (iCount == 0) {
return iSize;
}
- for (FX_INT32 i = iSize - iCount; i < iSize; i ++) {
+ for (int32_t i = iSize - iCount; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
return CFX_BaseMassArray::RemoveLast(iCount);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseMassArray::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseMassArray::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)GetPtrAt(i))->~baseType();
}
CFX_BaseMassArray::RemoveAll(bLeaveMemory);
@@ -388,10 +388,10 @@ public: class CFX_BaseDiscreteArray : public CFX_Target
{
protected:
- CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseDiscreteArray();
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
void RemoveAll();
FX_LPVOID m_pData;
};
@@ -399,17 +399,17 @@ template<class baseType> class CFX_DiscreteArrayTemplate : public CFX_BaseDiscreteArray
{
public:
- CFX_DiscreteArrayTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {}
- baseType& GetAt(FX_INT32 index, const baseType &defValue) const
+ CFX_DiscreteArrayTemplate(int32_t iChunkSize = 100) : CFX_BaseDiscreteArray(iChunkSize, sizeof(baseType)) {}
+ baseType& GetAt(int32_t index, const baseType &defValue) const
{
baseType *p = (baseType*)CFX_BaseDiscreteArray::GetAt(index);
return p == NULL ? (baseType&)defValue : *p;
}
- baseType* GetPtrAt(FX_INT32 index) const
+ baseType* GetPtrAt(int32_t index) const
{
return (baseType*)CFX_BaseDiscreteArray::GetAt(index);
}
- void SetAtGrow(FX_INT32 index, const baseType &element)
+ void SetAtGrow(int32_t index, const baseType &element)
{
*(baseType*)CFX_BaseDiscreteArray::AddSpaceTo(index) = element;
}
@@ -424,13 +424,13 @@ typedef CFX_DiscreteArrayTemplate<FX_WORD> CFX_WordDiscreteArray; class CFX_BaseStack : public CFX_Target
{
protected:
- CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseStack();
FX_LPBYTE Push();
void Pop();
FX_LPBYTE GetTopElement() const;
- FX_INT32 GetSize() const;
- FX_LPBYTE GetAt(FX_INT32 index) const;
+ int32_t GetSize() const;
+ FX_LPBYTE GetAt(int32_t index) const;
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
CFX_BaseMassArrayImp* m_pData;
};
@@ -438,10 +438,10 @@ template<class baseType> class CFX_StackTemplate : public CFX_BaseStack
{
public:
- CFX_StackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
- FX_INT32 Push(const baseType &element)
+ CFX_StackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
+ int32_t Push(const baseType &element)
{
- FX_INT32 index = CFX_BaseStack::GetSize();
+ int32_t index = CFX_BaseStack::GetSize();
*(baseType*)CFX_BaseStack::Push() = element;
return index;
}
@@ -453,11 +453,11 @@ public: {
return (baseType*)CFX_BaseStack::GetTopElement();
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseStack::GetSize();
}
- baseType* GetAt(FX_INT32 index) const
+ baseType* GetAt(int32_t index) const
{
return (baseType*)CFX_BaseStack::GetAt(index);
}
@@ -469,19 +469,19 @@ public: typedef CFX_StackTemplate<FX_LPVOID> CFX_PtrStack;
typedef CFX_StackTemplate<FX_DWORD> CFX_DWordStack;
typedef CFX_StackTemplate<FX_WORD> CFX_WordStack;
-typedef CFX_StackTemplate<FX_INT32> CFX_Int32Stack;
+typedef CFX_StackTemplate<int32_t> CFX_Int32Stack;
template<class baseType>
class CFX_ObjectStackTemplate : public CFX_BaseStack
{
public:
- CFX_ObjectStackTemplate(FX_INT32 iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
+ CFX_ObjectStackTemplate(int32_t iChunkSize = 100) : CFX_BaseStack(iChunkSize, sizeof(baseType)) {}
~CFX_ObjectStackTemplate()
{
RemoveAll();
}
- FX_INT32 Push(const baseType &element)
+ int32_t Push(const baseType &element)
{
- FX_INT32 index = CFX_BaseStack::GetSize();
+ int32_t index = CFX_BaseStack::GetSize();
baseType *p = (baseType*)CFX_BaseStack::Push();
FXTARGET_New ((void*)p)baseType(element);
return index;
@@ -498,38 +498,38 @@ public: {
return (baseType*)CFX_BaseStack::GetTopElement();
}
- FX_INT32 GetSize() const
+ int32_t GetSize() const
{
return CFX_BaseStack::GetSize();
}
- baseType* GetAt(FX_INT32 index) const
+ baseType* GetAt(int32_t index) const
{
return (baseType*)CFX_BaseStack::GetAt(index);
}
void RemoveAll(FX_BOOL bLeaveMemory = FALSE)
{
- FX_INT32 iSize = CFX_BaseStack::GetSize();
- for (FX_INT32 i = 0; i < iSize; i ++) {
+ int32_t iSize = CFX_BaseStack::GetSize();
+ for (int32_t i = 0; i < iSize; i ++) {
((baseType*)CFX_BaseStack::GetAt(i))->~baseType();
}
CFX_BaseStack::RemoveAll(bLeaveMemory);
}
- FX_INT32 Copy(const CFX_ObjectStackTemplate &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1)
+ int32_t Copy(const CFX_ObjectStackTemplate &src, int32_t iStart = 0, int32_t iCount = -1)
{
if (iCount == 0) {
return CFX_BaseStack::GetSize();
}
- FX_INT32 iSize = src.GetSize();
+ int32_t iSize = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iSize);
if (iCount < 0) {
iCount = iSize;
}
- FX_INT32 iEnd = iStart + iCount;
+ int32_t iEnd = iStart + iCount;
if (iEnd > iSize) {
iEnd = iSize;
}
RemoveAll(TRUE);
- for (FX_INT32 i = iStart; i < iEnd; i ++) {
+ for (int32_t i = iStart; i < iEnd; i ++) {
Push(*src.GetAt(i));
}
return CFX_BaseStack::GetSize();
@@ -659,9 +659,9 @@ public: {
m_pParentNode = pNode;
}
- FX_INT32 CountChildNodes() const
+ int32_t CountChildNodes() const
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CPLTreeNode *pNode = m_pChildNode;
while (pNode) {
iCount ++;
@@ -669,9 +669,9 @@ public: }
return iCount;
}
- CPLTreeNode* GetChildNode(FX_INT32 iIndex) const
+ CPLTreeNode* GetChildNode(int32_t iIndex) const
{
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
CPLTreeNode *pNode = m_pChildNode;
while (pNode) {
if (iIndex == iCount) {
@@ -682,9 +682,9 @@ public: }
return NULL;
}
- FX_INT32 GetNodeIndex() const
+ int32_t GetNodeIndex() const
{
- FX_INT32 index = 0;
+ int32_t index = 0;
CPLTreeNode *pNode = m_pPrevNode;
while (pNode != NULL) {
index ++;
@@ -722,9 +722,9 @@ public: {
m_pNextNode = pNode;
}
- FX_INT32 GetNodeLevel() const
+ int32_t GetNodeLevel() const
{
- FX_INT32 iLevel = 0;
+ int32_t iLevel = 0;
CPLTreeNode *pNode = (CPLTreeNode*)this;
while ((pNode = pNode->m_pParentNode) != NULL) {
iLevel ++;
diff --git a/xfa/src/fgas/src/crt/fx_algorithm.cpp b/xfa/src/fgas/src/crt/fx_algorithm.cpp index e2d77d1a0e..86a6095d45 100644 --- a/xfa/src/fgas/src/crt/fx_algorithm.cpp +++ b/xfa/src/fgas/src/crt/fx_algorithm.cpp @@ -29,7 +29,7 @@ typedef struct _FX_BASE64DATA { FX_DWORD data7 : 8;
} FX_BASE64DATA, * FX_LPBASE64ENCODEDATA;
typedef FX_BASE64DATA const * FX_LPCBASE64DATA;
-static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_CHAR dst[4])
+static void FX_Base64EncodePiece(const FX_BASE64DATA &src, int32_t iBytes, FX_CHAR dst[4])
{
dst[0] = g_FXBase64EncoderMap[src.data2];
FX_DWORD b = src.data1 << 4;
@@ -52,21 +52,21 @@ static void FX_Base64EncodePiece(const FX_BASE64DATA &src, FX_INT32 iBytes, FX_C dst[2] = dst[3] = '=';
}
}
-FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst)
+int32_t FX_Base64EncodeA(FX_LPCBYTE pSrc, int32_t iSrcLen, FX_LPSTR pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 3 * 4;
+ int32_t iDstLen = iSrcLen / 3 * 4;
if ((iSrcLen % 3) != 0) {
iDstLen += 4;
}
return iDstLen;
}
FX_BASE64DATA srcData;
- FX_INT32 iBytes = 3;
+ int32_t iBytes = 3;
FX_LPSTR pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 2) {
@@ -88,7 +88,7 @@ FX_INT32 FX_Base64EncodeA(FX_LPCBYTE pSrc, FX_INT32 iSrcLen, FX_LPSTR pDst) }
return pDstEnd - pDst;
}
-const static FX_BYTE g_FXBase64DecoderMap[256] = {
+const static uint8_t g_FXBase64DecoderMap[256] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
@@ -122,23 +122,23 @@ const static FX_BYTE g_FXBase64DecoderMap[256] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
};
-static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE64DATA &dst, FX_INT32 &iBytes)
+static void FX_Base64DecodePiece(const FX_CHAR src[4], int32_t iChars, FX_BASE64DATA &dst, int32_t &iBytes)
{
FXSYS_assert(iChars > 0 && iChars < 5);
iBytes = 1;
- dst.data2 = g_FXBase64DecoderMap[(FX_BYTE)src[0]];
+ dst.data2 = g_FXBase64DecoderMap[(uint8_t)src[0]];
if (iChars > 1) {
- FX_BYTE b = g_FXBase64DecoderMap[(FX_BYTE)src[1]];
+ uint8_t b = g_FXBase64DecoderMap[(uint8_t)src[1]];
dst.data1 = b >> 4;
dst.data4 = b;
if (iChars > 2) {
iBytes = 2;
- b = g_FXBase64DecoderMap[(FX_BYTE)src[2]];
+ b = g_FXBase64DecoderMap[(uint8_t)src[2]];
dst.data3 = b >> 2;
dst.data6 = b;
if (iChars > 3) {
iBytes = 3;
- dst.data5 = g_FXBase64DecoderMap[(FX_BYTE)src[3]];
+ dst.data5 = g_FXBase64DecoderMap[(uint8_t)src[3]];
} else {
dst.data5 = 0;
}
@@ -149,7 +149,7 @@ static void FX_Base64DecodePiece(const FX_CHAR src[4], FX_INT32 iChars, FX_BASE6 dst.data1 = 0;
}
}
-FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst)
+int32_t FX_Base64DecodeA(FX_LPCSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
@@ -162,7 +162,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 4 * 3;
+ int32_t iDstLen = iSrcLen / 4 * 3;
iSrcLen %= 4;
if (iSrcLen == 1) {
iDstLen += 1;
@@ -175,7 +175,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
FX_CHAR srcData[4];
FX_BASE64DATA dstData;
- FX_INT32 iChars = 4, iBytes;
+ int32_t iChars = 4, iBytes;
FX_LPBYTE pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 3) {
@@ -206,7 +206,7 @@ FX_INT32 FX_Base64DecodeA(FX_LPCSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
return pDstEnd - pDst;
}
-FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst)
+int32_t FX_Base64DecodeW(FX_LPCWSTR pSrc, int32_t iSrcLen, FX_LPBYTE pDst)
{
FXSYS_assert(pSrc != NULL);
if (iSrcLen < 1) {
@@ -219,7 +219,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) return 0;
}
if (pDst == NULL) {
- FX_INT32 iDstLen = iSrcLen / 4 * 3;
+ int32_t iDstLen = iSrcLen / 4 * 3;
iSrcLen %= 4;
if (iSrcLen == 1) {
iDstLen += 1;
@@ -232,7 +232,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
FX_CHAR srcData[4];
FX_BASE64DATA dstData;
- FX_INT32 iChars = 4, iBytes;
+ int32_t iChars = 4, iBytes;
FX_LPBYTE pDstEnd = pDst;
while (iSrcLen > 0) {
if (iSrcLen > 3) {
@@ -265,7 +265,7 @@ FX_INT32 FX_Base64DecodeW(FX_LPCWSTR pSrc, FX_INT32 iSrcLen, FX_LPBYTE pDst) }
return pDstEnd - pDst;
}
-const static FX_BYTE g_FXHex2DecMap[256] = {
+const static uint8_t g_FXHex2DecMap[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -283,11 +283,11 @@ const static FX_BYTE g_FXHex2DecMap[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
};
-FX_BYTE FX_Hex2Dec(FX_BYTE hexHigh, FX_BYTE hexLow)
+uint8_t FX_Hex2Dec(uint8_t hexHigh, uint8_t hexLow)
{
return (g_FXHex2DecMap[hexHigh] << 4) + g_FXHex2DecMap[hexLow];
}
-FX_INT32 FX_SeparateStringW(FX_LPCWSTR pStr, FX_INT32 iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces)
+int32_t FX_SeparateStringW(FX_LPCWSTR pStr, int32_t iStrLen, FX_WCHAR delimiter, CFX_WideStringArray &pieces)
{
if (pStr == NULL) {
return 0;
diff --git a/xfa/src/fgas/src/crt/fx_codepage.cpp b/xfa/src/fgas/src/crt/fx_codepage.cpp index 798edc9776..239fa8874c 100644 --- a/xfa/src/fgas/src/crt/fx_codepage.cpp +++ b/xfa/src/fgas/src/crt/fx_codepage.cpp @@ -39,11 +39,11 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { { 254, 437 },
{ 255, 850 },
};
-FX_WORD FX_GetCodePageFromCharset(FX_BYTE charset)
+FX_WORD FX_GetCodePageFromCharset(uint8_t charset)
{
- FX_INT32 iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1;
+ int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP & cp = g_FXCharset2CodePageTable[iMid];
@@ -92,9 +92,9 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { };
FX_WORD FX_GetCharsetFromCodePage(FX_WORD codepage)
{
- FX_INT32 iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1;
+ int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_CHARSET_MAP & cp = g_FXCodepage2CharsetTable[iMid];
@@ -247,9 +247,9 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { };
FX_WORD FX_GetDefCodePageByLanguage(FX_WORD wLanguage)
{
- FX_INT32 iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1;
+ int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FX_LANG2CPMAP &cp = g_FXLang2CodepageTable[iMid];
@@ -329,7 +329,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { { 0xf2a9730b, 0x3a8 }, { 0xf3d463c2, 0x3a4 }, { 0xf52a70a3, 0xc42e }, { 0xf5693147, 0x6fb3 },
{ 0xf637e157, 0x478 }, { 0xfc213f3a, 0x2717 }, { 0xff654d14, 0x3b5 },
};
-FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength)
+FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -338,9 +338,9 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) if (iLength == 0) {
return 0xFFFF;
}
- FX_UINT32 uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE);
- FX_INT32 iStart = 0, iMid;
- FX_INT32 iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1;
+ uint32_t uHash = FX_HashCode_String_GetA(pStr, iLength, TRUE);
+ int32_t iStart = 0, iMid;
+ int32_t iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1;
FXSYS_assert(iEnd >= 0);
do {
iMid = (iStart + iEnd) / 2;
@@ -355,7 +355,7 @@ FX_WORD FX_GetCodePageFromStringA(FX_LPCSTR pStr, FX_INT32 iLength) } while (iStart <= iEnd);
return 0xFFFF;
}
-FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength)
+FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, int32_t iLength)
{
if (iLength < 0) {
iLength = FXSYS_wcslen(pStr);
@@ -365,7 +365,7 @@ FX_WORD FX_GetCodePageFormStringW(FX_LPCWSTR pStr, FX_INT32 iLength) }
CFX_ByteString csStr;
FX_LPSTR pBuf = csStr.GetBuffer(iLength + 1);
- for (FX_INT32 i = 0; i < iLength; ++i) {
+ for (int32_t i = 0; i < iLength; ++i) {
*pBuf ++ = (FX_CHAR) * pStr ++;
}
csStr.ReleaseBuffer(iLength);
diff --git a/xfa/src/fgas/src/crt/fx_cpmgr.cpp b/xfa/src/fgas/src/crt/fx_cpmgr.cpp index 7bb2aa4a8d..e57273d614 100644 --- a/xfa/src/fgas/src/crt/fx_cpmgr.cpp +++ b/xfa/src/fgas/src/crt/fx_cpmgr.cpp @@ -41,10 +41,10 @@ extern const FX_CPCU_MAPINFO g_CP1257_CUMap; extern const FX_CPCU_MAPINFO g_CP1258_CUMap;
FX_LPCCODEPAGE FX_GetCodePage(FX_WORD wCodePage)
{
- FX_INT32 iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1;
+ int32_t iEnd = sizeof(g_FXCodePageMgr) / sizeof(FX_CODEPAGE) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
- FX_UINT16 uCPID;
+ int32_t iStart = 0, iMid;
+ uint16_t uCPID;
do {
iMid = (iStart + iEnd) / 2;
const FX_CODEPAGE &cp = g_FXCodePageMgr[iMid];
diff --git a/xfa/src/fgas/src/crt/fx_encode.cpp b/xfa/src/fgas/src/crt/fx_encode.cpp index 892b5a9059..9de79e3649 100644 --- a/xfa/src/fgas/src/crt/fx_encode.cpp +++ b/xfa/src/fgas/src/crt/fx_encode.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h"
#include "fx_codepage.h"
-void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength)
+void FX_SwapByteOrder(FX_LPWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL);
if (iLength < 0) {
@@ -28,7 +28,7 @@ void FX_SwapByteOrder(FX_LPWSTR pStr, FX_INT32 iLength) }
}
}
-void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength)
+void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, int32_t iLength)
{
FXSYS_assert(pSrc != NULL && pDst != NULL);
if (iLength < 0) {
@@ -50,7 +50,7 @@ void FX_SwapByteOrderCopy(FX_LPCWSTR pSrc, FX_LPWSTR pDst, FX_INT32 iLength) }
}
}
-void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength)
+void FX_UTF16ToWChar(FX_LPVOID pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -62,7 +62,7 @@ void FX_UTF16ToWChar(FX_LPVOID pBuffer, FX_INT32 iLength) pDst[iLength] = (FX_WCHAR)pSrc[iLength];
}
}
-void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLength)
+void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, int32_t iLength)
{
FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -73,7 +73,7 @@ void FX_UTF16ToWCharCopy(const FX_WORD *pUTF16, FX_LPWSTR pWChar, FX_INT32 iLeng }
}
}
-void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength)
+void FX_WCharToUTF16(FX_LPVOID pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -85,7 +85,7 @@ void FX_WCharToUTF16(FX_LPVOID pBuffer, FX_INT32 iLength) *pDst++ = (FX_WORD) * pSrc++;
}
}
-void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, FX_INT32 iLength)
+void FX_WCharToUTF16Copy(FX_LPCWSTR pWChar, FX_WORD *pUTF16, int32_t iLength)
{
FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0);
if (sizeof(FX_WCHAR) == 2) {
@@ -104,33 +104,33 @@ inline FX_WORD FX_WordFromBytes(FX_LPCBYTE pStr) {
return (pStr[1] << 8 | pStr[0]);
}
-FX_INT32 FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen, FX_BOOL bErrBreak)
+int32_t FX_DecodeString(FX_WORD wCodePage, FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen, FX_BOOL bErrBreak)
{
if (wCodePage == FX_CODEPAGE_UTF8) {
return FX_UTF8Decode(pSrc, pSrcLen, pDst, pDstLen);
}
return -1;
}
-FX_INT32 FX_UTF8Decode(FX_LPCSTR pSrc, FX_INT32 *pSrcLen, FX_LPWSTR pDst, FX_INT32 *pDstLen)
+int32_t FX_UTF8Decode(FX_LPCSTR pSrc, int32_t *pSrcLen, FX_LPWSTR pDst, int32_t *pDstLen)
{
if (pSrcLen == NULL || pDstLen == NULL) {
return -1;
}
- FX_INT32 iSrcLen = *pSrcLen;
+ int32_t iSrcLen = *pSrcLen;
if (iSrcLen < 1) {
*pSrcLen = *pDstLen = 0;
return 1;
}
- FX_INT32 iDstLen = *pDstLen;
+ int32_t iDstLen = *pDstLen;
FX_BOOL bValidDst = (pDst != NULL && iDstLen > 0);
FX_DWORD dwCode = 0;
- FX_INT32 iPending = 0;
- FX_INT32 iSrcNum = 0, iDstNum = 0;
- FX_INT32 k = 0;
- FX_INT32 iIndex = 0;
+ int32_t iPending = 0;
+ int32_t iSrcNum = 0, iDstNum = 0;
+ int32_t k = 0;
+ int32_t iIndex = 0;
k = 1;
while (iIndex < iSrcLen) {
- FX_BYTE byte = (FX_BYTE) * (pSrc + iIndex);
+ uint8_t byte = (uint8_t) * (pSrc + iIndex);
if (byte < 0x80) {
iPending = 0;
k = 1;
diff --git a/xfa/src/fgas/src/crt/fx_memory.cpp b/xfa/src/fgas/src/crt/fx_memory.cpp index 12d081a645..9645852cb7 100644 --- a/xfa/src/fgas/src/crt/fx_memory.cpp +++ b/xfa/src/fgas/src/crt/fx_memory.cpp @@ -45,7 +45,7 @@ CFX_StaticStore::~CFX_StaticStore() FX_LPSTATICSTORECHUNK CFX_StaticStore::AllocChunk(size_t size)
{
FXSYS_assert(size != 0);
- register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_STATICSTORECHUNK) + size);
+ register FX_LPSTATICSTORECHUNK pChunk = (FX_LPSTATICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_STATICSTORECHUNK) + size);
if (pChunk == NULL) {
return NULL;
}
@@ -106,8 +106,8 @@ CFX_FixedStore::~CFX_FixedStore() }
FX_LPFIXEDSTORECHUNK CFX_FixedStore::AllocChunk()
{
- FX_INT32 iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize;
- register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(FX_BYTE, iTotalSize);
+ int32_t iTotalSize = sizeof(FX_FIXEDSTORECHUNK) + m_iDefChunkSize + m_iBlockSize * m_iDefChunkSize;
+ register FX_LPFIXEDSTORECHUNK pChunk = (FX_LPFIXEDSTORECHUNK)FX_Alloc(uint8_t, iTotalSize);
if (pChunk == NULL) {
return NULL;
}
@@ -206,7 +206,7 @@ CFX_DynamicStore::~CFX_DynamicStore() FX_LPDYNAMICSTORECHUNK CFX_DynamicStore::AllocChunk(size_t size)
{
FXSYS_assert(size != 0);
- register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(FX_BYTE, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size);
+ register FX_LPDYNAMICSTORECHUNK pChunk = (FX_LPDYNAMICSTORECHUNK)FX_Alloc(uint8_t, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size);
if (pChunk == NULL) {
return NULL;
}
diff --git a/xfa/src/fgas/src/crt/fx_memory.h b/xfa/src/fgas/src/crt/fx_memory.h index 9121c32c0f..fa58429107 100644 --- a/xfa/src/fgas/src/crt/fx_memory.h +++ b/xfa/src/fgas/src/crt/fx_memory.h @@ -21,7 +21,7 @@ public: }
virtual void* Alloc(size_t size)
{
- return FX_Alloc(FX_BYTE, size);
+ return FX_Alloc(uint8_t, size);
}
virtual void Free(void *pBlock)
{
diff --git a/xfa/src/fgas/src/crt/fx_stream.cpp b/xfa/src/fgas/src/crt/fx_stream.cpp index fff3fe1e86..009cb41f5a 100644 --- a/xfa/src/fgas/src/crt/fx_stream.cpp +++ b/xfa/src/fgas/src/crt/fx_stream.cpp @@ -6,7 +6,7 @@ #include "../fgas_base.h"
#include "fx_stream.h"
-IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, FX_INT32 iFileSize, FX_BOOL bReleaseBufferRead )
+IFX_Stream* IFX_Stream::CreateStream(IFX_BufferRead *pBufferRead, FX_DWORD dwAccess, int32_t iFileSize, FX_BOOL bReleaseBufferRead )
{
CFX_Stream *pSR = FX_NEW CFX_Stream;
if (!pSR) {
@@ -86,7 +86,7 @@ IFX_Stream* IFX_Stream::CreateStream(FX_LPCWSTR pszFileName, FX_DWORD dwAccess) }
return pSR;
}
-IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, FX_INT32 length, FX_DWORD dwAccess)
+IFX_Stream* IFX_Stream::CreateStream(FX_LPBYTE pData, int32_t length, FX_DWORD dwAccess)
{
CFX_Stream *pSR = FX_NEW CFX_Stream;
if (pSR == NULL) {
@@ -216,18 +216,18 @@ FX_BOOL CFX_FileStreamImp::LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess }
return TRUE;
}
-FX_INT32 CFX_FileStreamImp::GetLength() const
+int32_t CFX_FileStreamImp::GetLength() const
{
FXSYS_assert(m_hFile != NULL);
return m_iLength;
}
-FX_INT32 CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_fseek(m_hFile, iOffset, eSeek);
return FXSYS_ftell(m_hFile);
}
-FX_INT32 CFX_FileStreamImp::GetPosition()
+int32_t CFX_FileStreamImp::GetPosition()
{
FXSYS_assert(m_hFile != NULL);
return FXSYS_ftell(m_hFile);
@@ -237,26 +237,26 @@ FX_BOOL CFX_FileStreamImp::IsEOF() const FXSYS_assert(m_hFile != NULL);
return FXSYS_ftell(m_hFile) >= m_iLength;
}
-FX_INT32 CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
return FXSYS_fread(pBuffer, 1, iBufferSize, m_hFile);
}
-FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_hFile != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_iLength <= 0) {
return 0;
}
- FX_INT32 iPosition = FXSYS_ftell(m_hFile);
- FX_INT32 iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength);
+ int32_t iPosition = FXSYS_ftell(m_hFile);
+ int32_t iLen = FX_MIN((m_iLength - iPosition) / 2, iMaxLength);
if (iLen <= 0) {
return 0;
}
iLen = FXSYS_fread(pStr, 2, iLen, m_hFile);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (*pStr != L'\0' && iCount < iLen) {
pStr ++, iCount ++;
}
@@ -267,26 +267,26 @@ FX_INT32 CFX_FileStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_B bEOS = (iPosition >= m_iLength);
return iCount;
}
-FX_INT32 CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile);
+ int32_t iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile);
if (iRet != 0) {
- FX_INT32 iPos = FXSYS_ftell(m_hFile);
+ int32_t iPos = FXSYS_ftell(m_hFile);
if (iPos > m_iLength) {
m_iLength = iPos;
}
}
return iRet;
}
-FX_INT32 CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_FileStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pStr != NULL && iLength > 0);
- FX_INT32 iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile);
+ int32_t iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile);
if (iRet != 0) {
- FX_INT32 iPos = FXSYS_ftell(m_hFile);
+ int32_t iPos = FXSYS_ftell(m_hFile);
if (iPos > m_iLength) {
m_iLength = iPos;
}
@@ -298,7 +298,7 @@ void CFX_FileStreamImp::Flush() FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_fflush(m_hFile);
}
-FX_BOOL CFX_FileStreamImp::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength)
{
FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FX_BOOL bRet = FX_fsetsize(m_hFile, iLength);
@@ -321,11 +321,11 @@ FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dw m_iLength = m_pFileRead->GetSize();
return TRUE;
}
-FX_INT32 CFX_FileReadStreamImp::GetLength() const
+int32_t CFX_FileReadStreamImp::GetLength() const
{
return m_iLength;
}
-FX_INT32 CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
switch (eSeek) {
case FX_STREAMSEEK_Begin:
@@ -349,7 +349,7 @@ FX_BOOL CFX_FileReadStreamImp::IsEOF() const {
return m_iPosition >= m_iLength;
}
-FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pFileRead != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
@@ -362,7 +362,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize }
return 0;
}
-FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pFileRead != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
@@ -370,7 +370,7 @@ FX_INT32 CFX_FileReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, if (iMaxLength <= 0) {
return 0;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iMaxLength && pStr[i] != L'\0') {
++i;
}
@@ -390,7 +390,7 @@ CFX_BufferReadStreamImp::~CFX_BufferReadStreamImp() m_pBufferRead->Release();
}
}
-FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
+FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
{
FXSYS_assert(m_pBufferRead == NULL && pBufferRead != NULL);
if (dwAccess & FX_STREAMACCESS_Write) {
@@ -412,13 +412,13 @@ FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_ }
return TRUE;
}
-FX_INT32 CFX_BufferReadStreamImp::GetLength() const
+int32_t CFX_BufferReadStreamImp::GetLength() const
{
return m_iBufferSize;
}
-FX_INT32 CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_BufferReadStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
switch (eSeek) {
case FX_STREAMSEEK_Begin:
m_iPosition = iOffset;
@@ -441,11 +441,11 @@ FX_BOOL CFX_BufferReadStreamImp::IsEOF() const {
return m_pBufferRead ? m_pBufferRead->IsEOF() : TRUE;
}
-FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pBufferRead != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
if (m_iPosition >= iLength) {
return 0;
}
@@ -454,26 +454,26 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi }
FX_DWORD dwBlockOffset = m_pBufferRead->GetBlockOffset();
FX_DWORD dwBlockSize = m_pBufferRead->GetBlockSize();
- if (m_iPosition < (FX_INT32)dwBlockOffset) {
+ if (m_iPosition < (int32_t)dwBlockOffset) {
if (!m_pBufferRead->ReadNextBlock(TRUE)) {
return 0;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
dwBlockSize = m_pBufferRead->GetBlockSize();
}
- while (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) {
+ while (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) {
if (m_pBufferRead->IsEOF() || !m_pBufferRead->ReadNextBlock(FALSE)) {
break;
}
dwBlockOffset = m_pBufferRead->GetBlockOffset();
dwBlockSize = m_pBufferRead->GetBlockSize();
}
- if (m_iPosition < (FX_INT32)dwBlockOffset || m_iPosition >= (FX_INT32)(dwBlockOffset + dwBlockSize)) {
+ if (m_iPosition < (int32_t)dwBlockOffset || m_iPosition >= (int32_t)(dwBlockOffset + dwBlockSize)) {
return 0;
}
FX_LPCBYTE pBufferTmp = m_pBufferRead->GetBlockBuffer();
FX_DWORD dwOffsetTmp = m_iPosition - dwBlockOffset;
- FX_DWORD dwCopySize = FX_MIN(iBufferSize, (FX_INT32)(dwBlockSize - dwOffsetTmp));
+ FX_DWORD dwCopySize = FX_MIN(iBufferSize, (int32_t)(dwBlockSize - dwOffsetTmp));
FXSYS_memcpy(pBuffer, pBufferTmp + dwOffsetTmp, dwCopySize);
dwOffsetTmp = dwCopySize;
iBufferSize -= dwCopySize;
@@ -492,7 +492,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSi m_iPosition += dwOffsetTmp;
return dwOffsetTmp;
}
-FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pBufferRead != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
@@ -500,7 +500,7 @@ FX_INT32 CFX_BufferReadStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength if (iMaxLength <= 0) {
return 0;
}
- FX_INT32 i = 0;
+ int32_t i = 0;
while (i < iMaxLength && pStr[i] != L'\0') {
++i;
}
@@ -524,16 +524,16 @@ FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR m_pFileWrite = pFileWrite;
return TRUE;
}
-FX_INT32 CFX_FileWriteStreamImp::GetLength() const
+int32_t CFX_FileWriteStreamImp::GetLength() const
{
if (!m_pFileWrite) {
return 0;
}
- return (FX_INT32)m_pFileWrite->GetSize();
+ return (int32_t)m_pFileWrite->GetSize();
}
-FX_INT32 CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_FileWriteStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
- FX_INT32 iLength = GetLength();
+ int32_t iLength = GetLength();
switch (eSeek) {
case FX_STREAMSEEK_Begin:
m_iPosition = iOffset;
@@ -556,7 +556,7 @@ FX_BOOL CFX_FileWriteStreamImp::IsEOF() const {
return m_iPosition >= GetLength();
}
-FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
if (!m_pFileWrite) {
return 0;
@@ -566,7 +566,7 @@ FX_INT32 CFX_FileWriteStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferS }
return iBufferSize;
}
-FX_INT32 CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_FileWriteStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return WriteData((FX_LPCBYTE)pStr, iLength * sizeof(FX_WCHAR));
}
@@ -584,7 +584,7 @@ CFX_BufferStreamImp::CFX_BufferStreamImp() , m_iLength(0)
{
}
-FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess)
+FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess)
{
FXSYS_assert(m_pData == NULL);
FXSYS_assert(pData != NULL && iTotalSize > 0);
@@ -595,12 +595,12 @@ FX_BOOL CFX_BufferStreamImp::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX m_iLength = (dwAccess & FX_STREAMACCESS_Write) != 0 ? 0 : iTotalSize;
return TRUE;
}
-FX_INT32 CFX_BufferStreamImp::GetLength() const
+int32_t CFX_BufferStreamImp::GetLength() const
{
FXSYS_assert(m_pData != NULL);
return m_iLength;
}
-FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
FXSYS_assert(m_pData != NULL);
if (eSeek == FX_STREAMSEEK_Begin) {
@@ -618,7 +618,7 @@ FX_INT32 CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) }
return m_iPosition;
}
-FX_INT32 CFX_BufferStreamImp::GetPosition()
+int32_t CFX_BufferStreamImp::GetPosition()
{
FXSYS_assert(m_pData != NULL);
return m_iPosition;
@@ -628,11 +628,11 @@ FX_BOOL CFX_BufferStreamImp::IsEOF() const FXSYS_assert(m_pData != NULL);
return m_iPosition >= m_iLength;
}
-FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pData != NULL);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iLength - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -640,16 +640,16 @@ FX_INT32 CFX_BufferStreamImp::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_iPosition += iLen;
return iLen;
}
-FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+int32_t CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
FXSYS_assert(m_pData != NULL);
FXSYS_assert(pStr != NULL && iMaxLength > 0);
- FX_INT32 iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength);
+ int32_t iLen = FX_MIN((m_iLength - m_iPosition) / 2, iMaxLength);
if (iLen <= 0) {
return 0;
}
FX_LPCWSTR pSrc = (FX_LPCWSTR)(FX_LPSTR)(m_pData + m_iPosition);
- FX_INT32 iCount = 0;
+ int32_t iCount = 0;
while (*pSrc != L'\0' && iCount < iLen) {
*pStr ++ = *pSrc ++, iCount ++;
}
@@ -657,11 +657,11 @@ FX_INT32 CFX_BufferStreamImp::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX bEOS = (*pSrc == L'\0') || (m_iPosition >= m_iLength);
return iCount;
}
-FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
- FX_INT32 iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iTotalSize - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -672,11 +672,11 @@ FX_INT32 CFX_BufferStreamImp::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize }
return iLen;
}
-FX_INT32 CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_BufferStreamImp::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0);
FXSYS_assert(pStr != NULL && iLength > 0);
- FX_INT32 iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength);
+ int32_t iLen = FX_MIN((m_iTotalSize - m_iPosition) / 2, iLength);
if (iLen <= 0) {
return 0;
}
@@ -718,7 +718,7 @@ CFX_TextStream::~CFX_TextStream() }
void CFX_TextStream::InitStream()
{
- FX_INT32 iPosition = m_pStreamImp->GetPosition();
+ int32_t iPosition = m_pStreamImp->GetPosition();
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, 0);
m_pStreamImp->ReadData((FX_LPBYTE)&m_dwBOM, 3);
#if _FX_ENDIAN_ == _FX_LITTLE_ENDIAN_
@@ -777,15 +777,15 @@ FX_DWORD CFX_TextStream::GetAccessModes() const {
return m_pStreamImp->GetAccessModes() | FX_STREAMACCESS_Text;
}
-FX_INT32 CFX_TextStream::GetLength() const
+int32_t CFX_TextStream::GetLength() const
{
return m_pStreamImp->GetLength();
}
-FX_INT32 CFX_TextStream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_TextStream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
return m_pStreamImp->Seek(eSeek, iOffset);
}
-FX_INT32 CFX_TextStream::GetPosition()
+int32_t CFX_TextStream::GetPosition()
{
return m_pStreamImp->GetPosition();
}
@@ -793,11 +793,11 @@ FX_BOOL CFX_TextStream::IsEOF() const {
return m_pStreamImp->IsEOF();
}
-FX_INT32 CFX_TextStream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_TextStream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
return m_pStreamImp->ReadData(pBuffer, iBufferSize);
}
-FX_INT32 CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_TextStream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return m_pStreamImp->WriteData(pBuffer, iBufferSize);
}
@@ -805,7 +805,7 @@ void CFX_TextStream::Flush() {
m_pStreamImp->Flush();
}
-FX_BOOL CFX_TextStream::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_TextStream::SetLength(int32_t iLength)
{
return m_pStreamImp->SetLength(iLength);
}
@@ -813,7 +813,7 @@ FX_WORD CFX_TextStream::GetCodePage() const {
return m_wCodePage;
}
-IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength)
+IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)
{
IFX_Stream *pSR = m_pStreamImp->CreateSharedStream(dwAccess, iOffset, iLength);
if (pSR == NULL) {
@@ -829,13 +829,13 @@ IFX_Stream* CFX_TextStream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffs }
return pSR;
}
-FX_INT32 CFX_TextStream::GetBOM(FX_BYTE bom[4]) const
+int32_t CFX_TextStream::GetBOM(uint8_t bom[4]) const
{
if (m_wBOMLength < 1) {
return 0;
}
*(FX_DWORD*)bom = m_dwBOM;
- return (FX_INT32)m_wBOMLength;
+ return (int32_t)m_wBOMLength;
}
FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage)
{
@@ -846,15 +846,15 @@ FX_WORD CFX_TextStream::SetCodePage(FX_WORD wCodePage) m_wCodePage = wCodePage;
return v;
}
-FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize)
+int32_t CFX_TextStream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize)
{
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iLen;
+ int32_t iLen;
if (m_wCodePage == FX_CODEPAGE_UTF16LE || m_wCodePage == FX_CODEPAGE_UTF16BE) {
- FX_INT32 iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize;
+ int32_t iBytes = pByteSize == NULL ? iMaxLength * 2 : *pByteSize;
m_pStreamImp->Lock();
iLen = m_pStreamImp->ReadData((FX_LPBYTE)pStr, iBytes);
m_pStreamImp->Unlock();
@@ -872,21 +872,21 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL }
#endif
} else {
- FX_INT32 pos = m_pStreamImp->GetPosition();
- FX_INT32 iBytes = pByteSize == NULL ? iMaxLength : *pByteSize;
+ int32_t pos = m_pStreamImp->GetPosition();
+ int32_t iBytes = pByteSize == NULL ? iMaxLength : *pByteSize;
iBytes = FX_MIN(iBytes, m_pStreamImp->GetLength() - pos);
if (iBytes > 0) {
if (m_pBuf == NULL) {
- m_pBuf = (FX_LPBYTE)FX_Alloc(FX_BYTE, iBytes);
+ m_pBuf = (FX_LPBYTE)FX_Alloc(uint8_t, iBytes);
m_iBufSize = iBytes;
} else if (iBytes > m_iBufSize) {
- m_pBuf = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pBuf, iBytes);
+ m_pBuf = (FX_LPBYTE)FX_Realloc(uint8_t, m_pBuf, iBytes);
m_iBufSize = iBytes;
}
m_pStreamImp->Lock();
iLen = m_pStreamImp->ReadData(m_pBuf, iBytes);
- FX_INT32 iSrc = iLen;
- FX_INT32 iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE);
+ int32_t iSrc = iLen;
+ int32_t iDecode = FX_DecodeString(m_wCodePage, (FX_LPCSTR)m_pBuf, &iSrc, pStr, &iMaxLength, TRUE);
m_pStreamImp->Seek(FX_STREAMSEEK_Current, iSrc - iLen);
m_pStreamImp->Unlock();
if (iDecode < 1) {
@@ -899,14 +899,14 @@ FX_INT32 CFX_TextStream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL bEOS = m_pStreamImp->IsEOF();
return iMaxLength;
}
-FX_INT32 CFX_TextStream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_TextStream::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL && iLength > 0);
if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) {
return -1;
}
if (m_wCodePage == FX_CODEPAGE_UTF8) {
- FX_INT32 len = iLength;
+ int32_t len = iLength;
CFX_UTF8Encoder encoder;
while (len -- > 0) {
encoder.Input(*pStr ++);
@@ -1004,7 +1004,7 @@ FX_BOOL CFX_Stream::LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess) }
return bRet;
}
-FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess)
+FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess)
{
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) {
return FALSE;
@@ -1027,7 +1027,7 @@ FX_BOOL CFX_Stream::LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dw }
return bRet;
}
-FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
+FX_BOOL CFX_Stream::LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead)
{
if (m_eStreamType != FX_SREAMTYPE_Unknown || m_pStreamImp != NULL) {
return FALSE;
@@ -1061,7 +1061,7 @@ IFX_Stream* CFX_Stream::Retain() m_iRefCount++;
return this;
}
-FX_INT32 CFX_Stream::GetLength() const
+int32_t CFX_Stream::GetLength() const
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1071,7 +1071,7 @@ FX_INT32 CFX_Stream::GetLength() const }
return m_iLength;
}
-FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset)
+int32_t CFX_Stream::Seek(FX_STREAMSEEK eSeek, int32_t iOffset)
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1079,8 +1079,8 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) if (m_eStreamType == FX_STREAMTYPE_File || m_eStreamType == FX_STREAMTYPE_Buffer) {
return m_iPosition = m_pStreamImp->Seek(eSeek, iOffset);
}
- FX_INT32 iEnd = m_iStart + m_iLength;
- FX_INT32 iPosition = m_iStart + iOffset;
+ int32_t iEnd = m_iStart + m_iLength;
+ int32_t iPosition = m_iStart + iOffset;
if (eSeek == FX_STREAMSEEK_Begin) {
m_iPosition = iPosition;
} else if (eSeek == FX_STREAMSEEK_Current) {
@@ -1096,7 +1096,7 @@ FX_INT32 CFX_Stream::Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) }
return m_iPosition - m_iStart;
}
-FX_INT32 CFX_Stream::GetPosition()
+int32_t CFX_Stream::GetPosition()
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1116,13 +1116,13 @@ FX_BOOL CFX_Stream::IsEOF() const }
return m_iPosition >= m_iStart + m_iLength;
}
-FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_Stream::ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize);
+ int32_t iLen = FX_MIN(m_iStart + m_iLength - m_iPosition, iBufferSize);
if (iLen <= 0) {
return 0;
}
@@ -1135,14 +1135,14 @@ FX_INT32 CFX_Stream::ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize)
+int32_t CFX_Stream::ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize)
{
FXSYS_assert(pStr != NULL && iMaxLength > 0);
if (m_pStreamImp == NULL) {
return -1;
}
- FX_INT32 iEnd = m_iStart + m_iLength;
- FX_INT32 iLen = iEnd - m_iPosition;
+ int32_t iEnd = m_iStart + m_iLength;
+ int32_t iLen = iEnd - m_iPosition;
if (pByteSize != NULL) {
iLen = FX_MIN(iLen, *pByteSize);
}
@@ -1162,7 +1162,7 @@ FX_INT32 CFX_Stream::ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bE m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+int32_t CFX_Stream::WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
FXSYS_assert(pBuffer != NULL && iBufferSize > 0);
if (m_pStreamImp == NULL) {
@@ -1171,7 +1171,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) {
return -1;
}
- FX_INT32 iLen = iBufferSize;
+ int32_t iLen = iBufferSize;
if (m_eStreamType == FX_STREAMTYPE_Stream) {
iLen = FX_MIN(m_iStart + m_iTotalSize - m_iPosition, iBufferSize);
if (iLen <= 0) {
@@ -1179,7 +1179,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) }
}
m_pStreamImp->Lock();
- FX_INT32 iEnd = m_iStart + m_iLength;
+ int32_t iEnd = m_iStart + m_iLength;
if (m_pStreamImp->GetPosition() != m_iPosition) {
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition);
}
@@ -1191,7 +1191,7 @@ FX_INT32 CFX_Stream::WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) m_pStreamImp->Unlock();
return iLen;
}
-FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+int32_t CFX_Stream::WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
FXSYS_assert(pStr != NULL && iLength > 0);
if (m_pStreamImp == NULL) {
@@ -1200,7 +1200,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) if ((m_dwAccess & FX_STREAMACCESS_Write) == 0) {
return -1;
}
- FX_INT32 iLen = iLength;
+ int32_t iLen = iLength;
if (m_eStreamType == FX_STREAMTYPE_Stream) {
iLen = FX_MIN((m_iStart + m_iTotalSize - m_iPosition) / 2, iLength);
if (iLen <= 0) {
@@ -1208,7 +1208,7 @@ FX_INT32 CFX_Stream::WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) }
}
m_pStreamImp->Lock();
- FX_INT32 iEnd = m_iStart + m_iLength;
+ int32_t iEnd = m_iStart + m_iLength;
if (m_pStreamImp->GetPosition() != m_iPosition) {
m_pStreamImp->Seek(FX_STREAMSEEK_Begin, m_iPosition);
}
@@ -1230,7 +1230,7 @@ void CFX_Stream::Flush() }
m_pStreamImp->Flush();
}
-FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength)
+FX_BOOL CFX_Stream::SetLength(int32_t iLength)
{
if (m_pStreamImp == NULL) {
return FALSE;
@@ -1240,7 +1240,7 @@ FX_BOOL CFX_Stream::SetLength(FX_INT32 iLength) }
return m_pStreamImp->SetLength(iLength);
}
-FX_INT32 CFX_Stream::GetBOM(FX_BYTE bom[4]) const
+int32_t CFX_Stream::GetBOM(uint8_t bom[4]) const
{
if (m_pStreamImp == NULL) {
return -1;
@@ -1263,7 +1263,7 @@ FX_WORD CFX_Stream::SetCodePage(FX_WORD wCodePage) return FX_CODEPAGE_UTF16BE;
#endif
}
-IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength)
+IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength)
{
FXSYS_assert( iLength > 0);
if (m_pStreamImp == NULL) {
@@ -1275,12 +1275,12 @@ IFX_Stream* CFX_Stream::CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, if ((m_dwAccess & FX_STREAMACCESS_Write) == 0 && (dwAccess & FX_STREAMACCESS_Write) != 0) {
return NULL;
}
- register FX_INT32 iStart = m_iStart + iOffset;
- register FX_INT32 iTotal = m_iStart + m_iLength;
+ register int32_t iStart = m_iStart + iOffset;
+ register int32_t iTotal = m_iStart + m_iLength;
if (iStart < m_iStart || iStart >= iTotal) {
return NULL;
}
- register FX_INT32 iEnd = iStart + iLength;
+ register int32_t iEnd = iStart + iLength;
if (iEnd < iStart || iEnd > iTotal) {
return NULL;
}
@@ -1325,10 +1325,10 @@ FX_FILESIZE CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_FILESIZE offset, size_t size)
{
m_pStream->Lock();
- m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset);
- FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size);
+ m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset);
+ int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#else
CFGAS_FileRead::CFGAS_FileRead(IFX_Stream *pStream, FX_BOOL bReleaseStream)
@@ -1350,10 +1350,10 @@ FX_DWORD CFGAS_FileRead::GetSize() FX_BOOL CFGAS_FileRead::ReadBlock(void* buffer, FX_DWORD offset, FX_DWORD size)
{
m_pStream->Lock();
- m_pStream->Seek(FX_STREAMSEEK_Begin, (FX_INT32)offset);
- FX_INT32 iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (FX_INT32)size);
+ m_pStream->Seek(FX_STREAMSEEK_Begin, (int32_t)offset);
+ int32_t iLen = m_pStream->ReadData((FX_LPBYTE)buffer, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#endif
#ifdef FX_FILESIZE
@@ -1447,14 +1447,14 @@ FX_BOOL CFX_BufferAccImp::ReadBlock(void* buffer, FX_FILESIZE offset, size_t siz return TRUE;
}
#else
-IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream)
+IFX_FileRead* FX_CreateFileRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream)
{
if (!pBufferRead) {
return NULL;
}
return FX_NEW CFX_BufferAccImp(pBufferRead, iFileSize, bReleaseStream);
}
-CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream)
+CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream)
: m_pBufferRead(pBufferRead)
, m_bReleaseStream(bReleaseStream)
, m_iBufSize(iFileSize)
@@ -1566,15 +1566,15 @@ FX_BOOL CFGAS_FileWrite::Flush() }
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, size_t size)
{
- return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size;
+ return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size;
}
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_FILESIZE offset, size_t size)
{
m_pStream->Lock();
m_pStream->Seek(FX_STREAMSEEK_Begin, offset);
- FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size);
+ int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#else
CFGAS_FileWrite::CFGAS_FileWrite(IFX_Stream *pStream, FX_BOOL bReleaseStream)
@@ -1600,14 +1600,14 @@ FX_DWORD CFGAS_FileWrite::Flush() }
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD size)
{
- return m_pStream->WriteData((FX_LPCBYTE)pData, (FX_INT32)size) == (FX_INT32)size;
+ return m_pStream->WriteData((FX_LPCBYTE)pData, (int32_t)size) == (int32_t)size;
}
FX_BOOL CFGAS_FileWrite::WriteBlock(const void* pData, FX_DWORD offset, FX_DWORD size)
{
m_pStream->Lock();
m_pStream->Seek(FX_STREAMSEEK_Begin, offset);
- FX_INT32 iLen = m_pStream->WriteData((FX_LPBYTE)pData, (FX_INT32)size);
+ int32_t iLen = m_pStream->WriteData((FX_LPBYTE)pData, (int32_t)size);
m_pStream->Unlock();
- return iLen == (FX_INT32)size;
+ return iLen == (int32_t)size;
}
#endif
diff --git a/xfa/src/fgas/src/crt/fx_stream.h b/xfa/src/fgas/src/crt/fx_stream.h index 30cb98486e..2273ab1d9b 100644 --- a/xfa/src/fgas/src/crt/fx_stream.h +++ b/xfa/src/fgas/src/crt/fx_stream.h @@ -28,16 +28,16 @@ public: {
return m_dwAccess;
}
- virtual FX_INT32 GetLength() const = 0;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0;
- virtual FX_INT32 GetPosition() = 0;
+ virtual int32_t GetLength() const = 0;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
+ virtual int32_t GetPosition() = 0;
virtual FX_BOOL IsEOF() const = 0;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) = 0;
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize) = 0;
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0;
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS) = 0;
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize) = 0;
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0;
virtual void Flush() = 0;
- virtual FX_BOOL SetLength(FX_INT32 iLength) = 0;
+ virtual FX_BOOL SetLength(int32_t iLength) = 0;
protected:
CFX_StreamImp();
virtual ~CFX_StreamImp() {}
@@ -49,44 +49,44 @@ public: CFX_FileStreamImp();
virtual ~CFX_FileStreamImp();
FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
+ virtual FX_BOOL SetLength(int32_t iLength);
protected:
FXSYS_FILE *m_hFile;
- FX_INT32 m_iLength;
+ int32_t m_iLength;
};
class CFX_BufferStreamImp : public CFX_StreamImp
{
public:
CFX_BufferStreamImp();
virtual ~CFX_BufferStreamImp() {}
- FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
FX_LPBYTE m_pData;
- FX_INT32 m_iTotalSize;
- FX_INT32 m_iPosition;
- FX_INT32 m_iLength;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iLength;
};
class CFX_FileReadStreamImp : public CFX_StreamImp
{
@@ -94,69 +94,69 @@ public: CFX_FileReadStreamImp();
virtual ~CFX_FileReadStreamImp() {}
FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return 0;
}
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
IFX_FileRead *m_pFileRead;
- FX_INT32 m_iPosition;
- FX_INT32 m_iLength;
+ int32_t m_iPosition;
+ int32_t m_iLength;
};
class CFX_BufferReadStreamImp : public CFX_StreamImp
{
public:
CFX_BufferReadStreamImp();
~CFX_BufferReadStreamImp();
- FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
+ FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength)
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength)
{
return 0;
}
virtual void Flush() {}
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
private:
IFX_BufferRead *m_pBufferRead;
FX_BOOL m_bReleaseBufferRead;
- FX_INT32 m_iPosition;
- FX_INT32 m_iBufferSize;
+ int32_t m_iPosition;
+ int32_t m_iBufferSize;
};
class CFX_FileWriteStreamImp : public CFX_StreamImp
{
@@ -164,31 +164,31 @@ public: CFX_FileWriteStreamImp();
virtual ~CFX_FileWriteStreamImp() {}
FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition()
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition()
{
return m_iPosition;
}
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize)
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
{
return 0;
}
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS)
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS)
{
return 0;
}
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength)
+ virtual FX_BOOL SetLength(int32_t iLength)
{
return FALSE;
}
protected:
IFX_FileWrite *m_pFileWrite;
- FX_INT32 m_iPosition;
+ int32_t m_iPosition;
};
enum FX_STREAMTYPE {
FX_SREAMTYPE_Unknown = 0,
@@ -203,27 +203,27 @@ public: CFX_Stream();
~CFX_Stream();
FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwAccess);
- FX_BOOL LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess);
+ FX_BOOL LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD dwAccess);
FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWORD dwAccess);
- FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
+ FX_BOOL LoadBufferRead(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
virtual void Release();
virtual IFX_Stream* Retain();
virtual FX_DWORD GetAccessModes() const
{
return m_dwAccess;
}
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const;
+ virtual FX_BOOL SetLength(int32_t iLength);
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
virtual FX_WORD GetCodePage() const;
virtual FX_WORD SetCodePage(FX_WORD wCodePage);
virtual void Lock()
@@ -234,16 +234,16 @@ public: {
CFX_ThreadLock::Unlock();
}
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength);
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength);
protected:
FX_STREAMTYPE m_eStreamType;
CFX_StreamImp *m_pStreamImp;
FX_DWORD m_dwAccess;
- FX_INT32 m_iTotalSize;
- FX_INT32 m_iPosition;
- FX_INT32 m_iStart;
- FX_INT32 m_iLength;
- FX_INT32 m_iRefCount;
+ int32_t m_iTotalSize;
+ int32_t m_iPosition;
+ int32_t m_iStart;
+ int32_t m_iLength;
+ int32_t m_iRefCount;
};
class CFX_TextStream : public IFX_Stream, public CFX_ThreadLock
{
@@ -254,19 +254,19 @@ public: virtual IFX_Stream* Retain();
virtual FX_DWORD GetAccessModes() const;
- virtual FX_INT32 GetLength() const;
- virtual FX_INT32 Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset);
- virtual FX_INT32 GetPosition();
+ virtual int32_t GetLength() const;
+ virtual int32_t Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
+ virtual int32_t GetPosition();
virtual FX_BOOL IsEOF() const;
- virtual FX_INT32 ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL);
- virtual FX_INT32 WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSize);
- virtual FX_INT32 WriteString(FX_LPCWSTR pStr, FX_INT32 iLength);
+ virtual int32_t ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t ReadString(FX_LPWSTR pStr, int32_t iMaxLength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
+ virtual int32_t WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSize);
+ virtual int32_t WriteString(FX_LPCWSTR pStr, int32_t iLength);
virtual void Flush();
- virtual FX_BOOL SetLength(FX_INT32 iLength);
+ virtual FX_BOOL SetLength(int32_t iLength);
- virtual FX_INT32 GetBOM(FX_BYTE bom[4]) const;
+ virtual int32_t GetBOM(uint8_t bom[4]) const;
virtual FX_WORD GetCodePage() const;
virtual FX_WORD SetCodePage(FX_WORD wCodePage);
@@ -279,16 +279,16 @@ public: CFX_ThreadLock::Unlock();
}
- virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, FX_INT32 iOffset, FX_INT32 iLength);
+ virtual IFX_Stream* CreateSharedStream(FX_DWORD dwAccess, int32_t iOffset, int32_t iLength);
protected:
FX_WORD m_wCodePage;
FX_WORD m_wBOMLength;
FX_DWORD m_dwBOM;
FX_LPBYTE m_pBuf;
- FX_INT32 m_iBufSize;
+ int32_t m_iBufSize;
FX_BOOL m_bDelStream;
IFX_Stream *m_pStreamImp;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
void InitStream();
};
#ifdef FX_FILESIZE
@@ -347,7 +347,7 @@ protected: class CFX_BufferAccImp : public IFX_FileRead
{
public:
- CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bReleaseStream);
+ CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bReleaseStream);
virtual ~CFX_BufferAccImp();
virtual void Release()
@@ -360,7 +360,7 @@ public: protected:
IFX_BufferRead *m_pBufferRead;
FX_BOOL m_bReleaseStream;
- FX_INT32 m_iBufSize;
+ int32_t m_iBufSize;
};
#endif
#ifdef FX_FILESIZE
diff --git a/xfa/src/fgas/src/crt/fx_system.cpp b/xfa/src/fgas/src/crt/fx_system.cpp index c8e4407a79..88f1631b7f 100644 --- a/xfa/src/fgas/src/crt/fx_system.cpp +++ b/xfa/src/fgas/src/crt/fx_system.cpp @@ -30,7 +30,7 @@ FX_LPWSTR FX_wcsncpy(FX_LPWSTR dstStr, FX_LPCWSTR srcStr, size_t count) }
return dstStr;
}
-FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
+int32_t FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_WCHAR wch1 = 0, wch2 = 0;
@@ -43,7 +43,7 @@ FX_INT32 FX_wcsnicmp(FX_LPCWSTR s1, FX_LPCWSTR s2, size_t count) }
return wch1 - wch2;
}
-FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
+int32_t FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count)
{
FXSYS_assert(s1 != NULL && s2 != NULL && count > 0);
FX_CHAR ch1 = 0, ch2 = 0;
@@ -56,20 +56,20 @@ FX_INT32 FX_strnicmp(FX_LPCSTR s1, FX_LPCSTR s2, size_t count) }
return ch1 - ch2;
}
-FX_INT32 FX_filelength(FXSYS_FILE *file)
+int32_t FX_filelength(FXSYS_FILE *file)
{
FXSYS_assert(file != NULL);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
return _filelength(_fileno(file));
#else
- FX_INT32 iPos = FXSYS_ftell(file);
+ int32_t iPos = FXSYS_ftell(file);
FXSYS_fseek(file, 0, FXSYS_SEEK_END);
- FX_INT32 iLen = FXSYS_ftell(file);
+ int32_t iLen = FXSYS_ftell(file);
FXSYS_fseek(file, iPos, FXSYS_SEEK_SET);
return iLen;
#endif
}
-FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size)
+FX_BOOL FX_fsetsize(FXSYS_FILE *file, int32_t size)
{
FXSYS_assert(file != NULL);
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_
@@ -79,13 +79,13 @@ FX_BOOL FX_fsetsize(FXSYS_FILE *file, FX_INT32 size) FX_DWORD dwPos = ::SetFilePointer(hFile, 0, 0, FILE_CURRENT);
::SetFilePointer(hFile, size, 0, FILE_BEGIN);
FX_BOOL bRet = ::SetEndOfFile(hFile);
- ::SetFilePointer(hFile, (FX_INT32)dwPos, 0, FILE_BEGIN);
+ ::SetFilePointer(hFile, (int32_t)dwPos, 0, FILE_BEGIN);
return bRet;
#else
return FALSE;
#endif
}
-FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen )
+FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, int32_t iLength , int32_t *pUsedLen )
{
FXSYS_assert(pcsStr != NULL);
if (iLength < 0) {
@@ -93,7 +93,7 @@ FX_FLOAT FX_strtof(FX_LPCSTR pcsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) }
return FX_wcstof(CFX_WideString::FromLocal(pcsStr, iLength), iLength, pUsedLen);
}
-FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen )
+FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, int32_t iLength , int32_t *pUsedLen )
{
FXSYS_assert(pwsStr != NULL);
if (iLength < 0) {
@@ -102,7 +102,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) if (iLength == 0) {
return 0.0f;
}
- FX_INT32 iUsedLen = 0;
+ int32_t iUsedLen = 0;
FX_BOOL bNegtive = FALSE;
switch (pwsStr[iUsedLen]) {
case '-':
@@ -138,7 +138,7 @@ FX_FLOAT FX_wcstof(FX_LPCWSTR pwsStr, FX_INT32 iLength , FX_INT32 *pUsedLen ) }
return bNegtive ? -fValue : fValue;
}
-void FX_memset(FX_LPVOID pBuf, FX_INT32 iValue, size_t size)
+void FX_memset(FX_LPVOID pBuf, int32_t iValue, size_t size)
{
FXSYS_assert(pBuf != NULL && size > 0 && (size & 0x03) == 0);
FXSYS_assert((((size_t)pBuf) & 0x03) == 0);
@@ -161,11 +161,11 @@ void FX_memcpy(FX_LPVOID pDst, FX_LPCVOID pSrc, size_t size) }
FX_BOOL FX_IsRelativePath(const CFX_WideStringC &wsUrl)
{
- FX_INT32 iUrlLen = wsUrl.GetLength();
+ int32_t iUrlLen = wsUrl.GetLength();
if (iUrlLen == 0) {
return TRUE;
}
- for (FX_INT32 i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i)
+ for (int32_t i = FX_MIN(5, iUrlLen) - 1; i >= 0; --i)
if (wsUrl.GetAt(i) == ':') {
return FALSE;
}
@@ -190,7 +190,7 @@ FX_BOOL FX_JoinPath(const CFX_WideStringC &wsBasePath, const CFX_WideStringC &ws return wsAbsolutePath.GetLength() > 0;
}
}
- FX_INT32 nBackCount = 0;
+ int32_t nBackCount = 0;
for(;;) {
if (pRelStart >= pRelEnd) {
wsAbsolutePath = wsBasePath;
diff --git a/xfa/src/fgas/src/crt/fx_utils.cpp b/xfa/src/fgas/src/crt/fx_utils.cpp index 6f8452237f..55d97f0ea6 100644 --- a/xfa/src/fgas/src/crt/fx_utils.cpp +++ b/xfa/src/fgas/src/crt/fx_utils.cpp @@ -20,14 +20,14 @@ void CFX_ThreadLock::Unlock() {
}
typedef struct _FX_BASEARRAYDATA : public CFX_Target {
- FX_INT32 iGrowSize;
- FX_INT32 iBlockSize;
- FX_INT32 iTotalCount;
- FX_INT32 iBlockCount;
+ int32_t iGrowSize;
+ int32_t iBlockSize;
+ int32_t iTotalCount;
+ int32_t iBlockCount;
FX_LPBYTE pBuffer;
} FX_BASEARRAYDATA, * FX_LPBASEARRAYDATA;
typedef FX_BASEARRAYDATA const * FX_LPCBASEARRAYDATA;
-CFX_BaseArray::CFX_BaseArray(FX_INT32 iGrowSize, FX_INT32 iBlockSize)
+CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize)
{
FXSYS_assert(iGrowSize > 0 && iBlockSize > 0);
m_pData = FXTARGET_New FX_BASEARRAYDATA;
@@ -43,38 +43,38 @@ CFX_BaseArray::~CFX_BaseArray() }
FXTARGET_Delete pData;
}
-FX_INT32 CFX_BaseArray::GetSize() const
+int32_t CFX_BaseArray::GetSize() const
{
return ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
}
-FX_INT32 CFX_BaseArray::GetBlockSize() const
+int32_t CFX_BaseArray::GetBlockSize() const
{
return ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
}
-FX_LPBYTE CFX_BaseArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseArray::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBYTE &pBuffer = ((FX_LPBASEARRAYDATA)m_pData)->pBuffer;
- FX_INT32 &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount;
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t &iTotalCount = ((FX_LPBASEARRAYDATA)m_pData)->iTotalCount;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
if (index >= iTotalCount) {
- FX_INT32 iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize;
+ int32_t iGrowSize = ((FX_LPBASEARRAYDATA)m_pData)->iGrowSize;
iTotalCount = (index / iGrowSize + 1) * iGrowSize;
- FX_INT32 iNewSize = iTotalCount * iBlockSize;
+ int32_t iNewSize = iTotalCount * iBlockSize;
if (pBuffer == NULL) {
- pBuffer = (FX_LPBYTE)FX_Alloc(FX_BYTE, iNewSize);
+ pBuffer = (FX_LPBYTE)FX_Alloc(uint8_t, iNewSize);
} else {
- pBuffer = (FX_LPBYTE)FX_Realloc(FX_BYTE, pBuffer, iNewSize);
+ pBuffer = (FX_LPBYTE)FX_Realloc(uint8_t, pBuffer, iNewSize);
}
}
FXSYS_assert(pBuffer != NULL);
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
if (index >= iBlockCount) {
iBlockCount = index + 1;
}
return pBuffer + index * iBlockSize;
}
-FX_LPBYTE CFX_BaseArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseArray::GetAt(int32_t index) const
{
FXSYS_assert(index > -1 && index < ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount);
return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer + index * ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
@@ -83,12 +83,12 @@ FX_LPBYTE CFX_BaseArray::GetBuffer() const {
return ((FX_LPBASEARRAYDATA)m_pData)->pBuffer;
}
-FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseArray::Append(const CFX_BaseArray &src, int32_t iStart, int32_t iCount)
{
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize);
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
- FX_INT32 iAdded = src.GetSize();
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t iAdded = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iAdded);
if (iCount < 0) {
iCount = iAdded;
@@ -104,11 +104,11 @@ FX_INT32 CFX_BaseArray::Append(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT FX_memcpy(pDst, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize);
return iCount;
}
-FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseArray::Copy(const CFX_BaseArray &src, int32_t iStart, int32_t iCount)
{
- FX_INT32 iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
+ int32_t iBlockSize = ((FX_LPBASEARRAYDATA)m_pData)->iBlockSize;
FXSYS_assert(iBlockSize == ((FX_LPBASEARRAYDATA)src.m_pData)->iBlockSize);
- FX_INT32 iCopied = src.GetSize();
+ int32_t iCopied = src.GetSize();
FXSYS_assert(iStart > -1 && iStart < iCopied);
if (iCount < 0) {
iCount = iCopied;
@@ -124,9 +124,9 @@ FX_INT32 CFX_BaseArray::Copy(const CFX_BaseArray &src, FX_INT32 iStart, FX_INT32 FX_memcpy(((FX_LPBASEARRAYDATA)m_pData)->pBuffer, ((FX_LPBASEARRAYDATA)src.m_pData)->pBuffer + iStart * iBlockSize, iCount * iBlockSize);
return iCount;
}
-FX_INT32 CFX_BaseArray::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseArray::RemoveLast(int32_t iCount)
{
- FX_INT32 &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
+ int32_t &iBlockCount = ((FX_LPBASEARRAYDATA)m_pData)->iBlockCount;
if (iCount < 0 || iCount > iBlockCount) {
iCount = iBlockCount;
iBlockCount = 0;
@@ -147,7 +147,7 @@ void CFX_BaseArray::RemoveAll(FX_BOOL bLeaveMemory) }
((FX_LPBASEARRAYDATA)m_pData)->iBlockCount = 0;
}
-CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize)
: m_iChunkSize(iChunkSize)
, m_iBlockSize(iBlockSize)
, m_iChunkCount(0)
@@ -162,20 +162,20 @@ CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() RemoveAll();
delete m_pData;
}
-FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBYTE pChunk;
if (index < m_iBlockCount) {
pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
} else {
- FX_INT32 iMemSize = m_iChunkSize * m_iBlockSize;
+ int32_t iMemSize = m_iChunkSize * m_iBlockSize;
while (TRUE) {
if (index < m_iChunkCount * m_iChunkSize) {
pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
break;
} else {
- pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize);
+ pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize);
if (m_iChunkCount < m_pData->GetSize()) {
m_pData->SetAt(m_iChunkCount, pChunk);
} else {
@@ -189,17 +189,17 @@ FX_LPBYTE CFX_BaseMassArrayImp::AddSpaceTo(FX_INT32 index) m_iBlockCount = index + 1;
return pChunk + (index % m_iChunkSize) * m_iBlockSize;
}
-FX_LPBYTE CFX_BaseMassArrayImp::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseMassArrayImp::GetAt(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_iBlockCount);
FX_LPBYTE pChunk = (FX_LPBYTE)m_pData->GetAt(index / m_iChunkSize);
FXSYS_assert(pChunk != NULL);
return pChunk + (index % m_iChunkSize) * m_iBlockSize;
}
-FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount)
{
FXSYS_assert(m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iAdded = src.m_iBlockCount;
+ int32_t iAdded = src.m_iBlockCount;
FXSYS_assert(iStart > -1 && iStart < iAdded);
if (iCount < 0) {
iCount = iAdded;
@@ -210,16 +210,16 @@ FX_INT32 CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp &src, FX_INT32 if (iCount < 1) {
return m_iBlockCount;
}
- FX_INT32 iBlockCount = m_iBlockCount;
- FX_INT32 iTotal = m_iBlockCount + iCount;
+ int32_t iBlockCount = m_iBlockCount;
+ int32_t iTotal = m_iBlockCount + iCount;
AddSpaceTo(iTotal - 1);
Append(iBlockCount, src, iStart, iCount);
return m_iBlockCount;
}
-FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, int32_t iStart, int32_t iCount)
{
FXSYS_assert(m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iCopied = src.m_iBlockCount;
+ int32_t iCopied = src.m_iBlockCount;
FXSYS_assert(iStart > -1);
if (iStart >= iCopied) {
return 0;
@@ -240,20 +240,20 @@ FX_INT32 CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iS Append(0, src, iStart, iCount);
return m_iBlockCount;
}
-void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart, FX_INT32 iSrcCount)
+void CFX_BaseMassArrayImp::Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart, int32_t iSrcCount)
{
FXSYS_assert(iDstStart > -1 && m_iBlockSize == src.m_iBlockSize);
- FX_INT32 iSrcTotal = src.m_iBlockCount;
+ int32_t iSrcTotal = src.m_iBlockCount;
FXSYS_assert(iSrcTotal > 0 && m_iBlockCount >= iDstStart + iSrcCount);
FXSYS_assert(iSrcStart > -1 && iSrcStart < iSrcTotal && iSrcCount > 0 && iSrcStart + iSrcCount <= iSrcTotal);
- FX_INT32 iDstChunkIndex = iDstStart / m_iChunkSize;
- FX_INT32 iSrcChunkIndex = iSrcStart / src.m_iChunkSize;
+ int32_t iDstChunkIndex = iDstStart / m_iChunkSize;
+ int32_t iSrcChunkIndex = iSrcStart / src.m_iChunkSize;
FX_LPBYTE pDstChunk = (FX_LPBYTE)GetAt(iDstStart);
FX_LPBYTE pSrcChunk = (FX_LPBYTE)src.GetAt(iSrcStart);
- FX_INT32 iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize);
- FX_INT32 iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize);
- FX_INT32 iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize));
- FX_INT32 iCopyBytes = iCopySize * m_iBlockSize;
+ int32_t iDstChunkSize = m_iChunkSize - (iDstStart % m_iChunkSize);
+ int32_t iSrcChunkSize = src.m_iChunkSize - (iSrcStart % src.m_iChunkSize);
+ int32_t iCopySize = FX_MIN(iSrcCount, FX_MIN(iSrcChunkSize, iDstChunkSize));
+ int32_t iCopyBytes = iCopySize * m_iBlockSize;
while (iSrcCount > 0) {
FXSYS_assert(pDstChunk != NULL && pSrcChunk != NULL);
FXSYS_memcpy(pDstChunk, pSrcChunk, iCopyBytes);
@@ -278,7 +278,7 @@ void CFX_BaseMassArrayImp::Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp iCopyBytes = iCopySize * m_iBlockSize;
}
}
-FX_INT32 CFX_BaseMassArrayImp::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseMassArrayImp::RemoveLast(int32_t iCount)
{
if (iCount < 0 || iCount >= m_iBlockCount) {
m_iBlockCount = 0;
@@ -293,7 +293,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iBlockCount = 0;
return;
}
- for (FX_INT32 i = 0; i < m_iChunkCount; i ++) {
+ for (int32_t i = 0; i < m_iChunkCount; i ++) {
FX_LPVOID p = m_pData->GetAt(i);
if (p == NULL) {
continue;
@@ -304,7 +304,7 @@ void CFX_BaseMassArrayImp::RemoveAll(FX_BOOL bLeaveMemory) m_iChunkCount = 0;
m_iBlockCount = 0;
}
-CFX_BaseMassArray::CFX_BaseMassArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseMassArray::CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize)
{
m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize);
}
@@ -312,27 +312,27 @@ CFX_BaseMassArray::~CFX_BaseMassArray() {
FXTARGET_Delete m_pData;
}
-FX_INT32 CFX_BaseMassArray::GetSize() const
+int32_t CFX_BaseMassArray::GetSize() const
{
return m_pData->m_iBlockCount;
}
-FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseMassArray::AddSpaceTo(int32_t index)
{
return m_pData->AddSpaceTo(index);
}
-FX_LPBYTE CFX_BaseMassArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseMassArray::GetAt(int32_t index) const
{
return m_pData->GetAt(index);
}
-FX_INT32 CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArray::Append(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount)
{
return m_pData->Append(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount);
}
-FX_INT32 CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, FX_INT32 iStart, FX_INT32 iCount)
+int32_t CFX_BaseMassArray::Copy(const CFX_BaseMassArray &src, int32_t iStart, int32_t iCount)
{
return m_pData->Copy(*(CFX_BaseMassArrayImp*)src.m_pData, iStart, iCount);
}
-FX_INT32 CFX_BaseMassArray::RemoveLast(FX_INT32 iCount)
+int32_t CFX_BaseMassArray::RemoveLast(int32_t iCount)
{
return m_pData->RemoveLast(iCount);
}
@@ -341,13 +341,13 @@ void CFX_BaseMassArray::RemoveAll(FX_BOOL bLeaveMemory) m_pData->RemoveAll(bLeaveMemory);
}
typedef struct _FX_BASEDISCRETEARRAYDATA {
- FX_INT32 iBlockSize;
- FX_INT32 iChunkSize;
- FX_INT32 iChunkCount;
+ int32_t iBlockSize;
+ int32_t iChunkSize;
+ int32_t iChunkCount;
CFX_PtrArray ChunkBuffer;
} FX_BASEDISCRETEARRAYDATA, * FX_LPBASEDISCRETEARRAYDATA;
typedef FX_BASEDISCRETEARRAYDATA const * FX_LPCBASEDISCRETEARRAYDATA;
-CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize)
{
FXSYS_assert(iChunkSize > 0 && iBlockSize > 0);
FX_LPBASEDISCRETEARRAYDATA pData;
@@ -362,20 +362,20 @@ CFX_BaseDiscreteArray::~CFX_BaseDiscreteArray() RemoveAll();
delete (FX_LPBASEDISCRETEARRAYDATA)m_pData;
}
-FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index)
+FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(int32_t index)
{
FXSYS_assert(index > -1);
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
- FX_INT32 &iChunkCount = pData->iChunkCount;
- FX_INT32 iChunkSize = pData->iChunkSize;
+ int32_t &iChunkCount = pData->iChunkCount;
+ int32_t iChunkSize = pData->iChunkSize;
FX_LPBYTE pChunk = NULL;
- FX_INT32 iChunk = index / iChunkSize;
+ int32_t iChunk = index / iChunkSize;
if (iChunk < iChunkCount) {
pChunk = (FX_LPBYTE)pData->ChunkBuffer.GetAt(iChunk);
}
if (pChunk == NULL) {
- FX_INT32 iMemSize = iChunkSize * pData->iBlockSize;
- pChunk = (FX_LPBYTE)FX_Alloc(FX_BYTE, iMemSize);
+ int32_t iMemSize = iChunkSize * pData->iBlockSize;
+ pChunk = (FX_LPBYTE)FX_Alloc(uint8_t, iMemSize);
FXSYS_memset(pChunk, 0, iMemSize);
pData->ChunkBuffer.SetAtGrow(iChunk, pChunk);
if (iChunkCount <= iChunk) {
@@ -384,12 +384,12 @@ FX_LPBYTE CFX_BaseDiscreteArray::AddSpaceTo(FX_INT32 index) }
return pChunk + (index % iChunkSize) * pData->iBlockSize;
}
-FX_LPBYTE CFX_BaseDiscreteArray::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseDiscreteArray::GetAt(int32_t index) const
{
FXSYS_assert(index > -1);
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
- FX_INT32 iChunkSize = pData->iChunkSize;
- FX_INT32 iChunk = index / iChunkSize;
+ int32_t iChunkSize = pData->iChunkSize;
+ int32_t iChunk = index / iChunkSize;
if (iChunk >= pData->iChunkCount) {
return NULL;
}
@@ -403,8 +403,8 @@ void CFX_BaseDiscreteArray::RemoveAll() {
FX_LPBASEDISCRETEARRAYDATA pData = (FX_LPBASEDISCRETEARRAYDATA)m_pData;
CFX_PtrArray &ChunkBuffer = pData->ChunkBuffer;
- FX_INT32 &iChunkCount = pData->iChunkCount;
- for (FX_INT32 i = 0; i < iChunkCount; i++) {
+ int32_t &iChunkCount = pData->iChunkCount;
+ for (int32_t i = 0; i < iChunkCount; i++) {
FX_LPVOID p = ChunkBuffer.GetAt(i);
if (p == NULL) {
continue;
@@ -414,7 +414,7 @@ void CFX_BaseDiscreteArray::RemoveAll() ChunkBuffer.RemoveAll();
iChunkCount = 0;
}
-CFX_BaseStack::CFX_BaseStack(FX_INT32 iChunkSize, FX_INT32 iBlockSize)
+CFX_BaseStack::CFX_BaseStack(int32_t iChunkSize, int32_t iBlockSize)
{
m_pData = FXTARGET_New CFX_BaseMassArrayImp(iChunkSize, iBlockSize);
}
@@ -428,7 +428,7 @@ FX_LPBYTE CFX_BaseStack::Push() }
void CFX_BaseStack::Pop()
{
- FX_INT32 &iBlockCount = m_pData->m_iBlockCount;
+ int32_t &iBlockCount = m_pData->m_iBlockCount;
if (iBlockCount < 1) {
return;
}
@@ -436,17 +436,17 @@ void CFX_BaseStack::Pop() }
FX_LPBYTE CFX_BaseStack::GetTopElement() const
{
- FX_INT32 iSize = m_pData->m_iBlockCount;
+ int32_t iSize = m_pData->m_iBlockCount;
if (iSize < 1) {
return NULL;
}
return m_pData->GetAt(iSize - 1);
}
-FX_INT32 CFX_BaseStack::GetSize() const
+int32_t CFX_BaseStack::GetSize() const
{
return m_pData->m_iBlockCount;
}
-FX_LPBYTE CFX_BaseStack::GetAt(FX_INT32 index) const
+FX_LPBYTE CFX_BaseStack::GetAt(int32_t index) const
{
return m_pData->GetAt(index);
}
diff --git a/xfa/src/fgas/src/crt/fx_utils.h b/xfa/src/fgas/src/crt/fx_utils.h index a073b80e57..92c2bcb198 100644 --- a/xfa/src/fgas/src/crt/fx_utils.h +++ b/xfa/src/fgas/src/crt/fx_utils.h @@ -9,24 +9,24 @@ class CFX_BaseMassArrayImp : public CFX_Target
{
public:
- CFX_BaseMassArrayImp(FX_INT32 iChunkSize, FX_INT32 iBlockSize);
+ CFX_BaseMassArrayImp(int32_t iChunkSize, int32_t iBlockSize);
~CFX_BaseMassArrayImp();
FX_LPBYTE AddSpace()
{
return AddSpaceTo(m_iBlockCount);
}
- FX_LPBYTE AddSpaceTo(FX_INT32 index);
- FX_LPBYTE GetAt(FX_INT32 index) const;
- FX_INT32 Append(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 Copy(const CFX_BaseMassArrayImp &src, FX_INT32 iStart = 0, FX_INT32 iCount = -1);
- FX_INT32 RemoveLast(FX_INT32 iCount = -1);
+ FX_LPBYTE AddSpaceTo(int32_t index);
+ FX_LPBYTE GetAt(int32_t index) const;
+ int32_t Append(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t Copy(const CFX_BaseMassArrayImp &src, int32_t iStart = 0, int32_t iCount = -1);
+ int32_t RemoveLast(int32_t iCount = -1);
void RemoveAll(FX_BOOL bLeaveMemory = FALSE);
- FX_INT32 m_iChunkSize;
- FX_INT32 m_iBlockSize;
- FX_INT32 m_iChunkCount;
- FX_INT32 m_iBlockCount;
+ int32_t m_iChunkSize;
+ int32_t m_iBlockSize;
+ int32_t m_iChunkCount;
+ int32_t m_iBlockCount;
CFX_PtrArray *m_pData;
protected:
- void Append(FX_INT32 iDstStart, const CFX_BaseMassArrayImp &src, FX_INT32 iSrcStart = 0, FX_INT32 iSrcCount = -1);
+ void Append(int32_t iDstStart, const CFX_BaseMassArrayImp &src, int32_t iSrcStart = 0, int32_t iSrcCount = -1);
};
#endif
diff --git a/xfa/src/fgas/src/font/fx_fontutils.cpp b/xfa/src/fgas/src/font/fx_fontutils.cpp index b2a7028fb8..24e77c1c93 100644 --- a/xfa/src/fgas/src/font/fx_fontutils.cpp +++ b/xfa/src/fgas/src/font/fx_fontutils.cpp @@ -218,9 +218,9 @@ static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { };
FGAS_LPCFONTUSB FGAS_GetUnicodeBitField(FX_WCHAR wUnicode)
{
- FX_INT32 iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1;
+ int32_t iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1;
FXSYS_assert(iEnd >= 0);
- FX_INT32 iStart = 0, iMid;
+ int32_t iStart = 0, iMid;
do {
iMid = (iStart + iEnd) / 2;
const FGAS_FONTUSB &usb = g_FXGdiFontUSBTable[iMid];
diff --git a/xfa/src/fgas/src/font/fx_gdifont.cpp b/xfa/src/fgas/src/font/fx_gdifont.cpp index e9ab665b5a..437a25c7e4 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.cpp +++ b/xfa/src/fgas/src/font/fx_gdifont.cpp @@ -16,7 +16,7 @@ CFX_GdiFontCache::CFX_GdiFontCache() CFX_GdiFontCache::~CFX_GdiFontCache()
{
FX_POSITION pos = m_GlyphMap.GetStartPosition();
- FX_INT32 iGlyph;
+ int32_t iGlyph;
FX_LPGDIGOCACHE pGlyph;
while (pos != NULL) {
pGlyph = NULL;
@@ -53,7 +53,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX }
return pFont;
}
-IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr)
+IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr)
{
CFX_GdiFont *pFont = FX_NEW CFX_GdiFont(pFontMgr);
if (!pFont->LoadFont(pBuffer, iLength)) {
@@ -107,8 +107,8 @@ CFX_GdiFont::CFX_GdiFont(IFX_FontMgr *pFontMgr) }
CFX_GdiFont::~CFX_GdiFont()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
pFont->Release();
}
@@ -131,8 +131,8 @@ CFX_GdiFont::~CFX_GdiFont() }
void CFX_GdiFont::ClearCache()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
((CFX_GdiFont*)pFont)->ClearCache();
}
@@ -181,7 +181,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F lf.lfCharSet = SYMBOL_CHARSET;
} else {
FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage);
- lf.lfCharSet = wCharSet != 0xFFFF ? (FX_BYTE)wCharSet : DEFAULT_CHARSET;
+ lf.lfCharSet = wCharSet != 0xFFFF ? (uint8_t)wCharSet : DEFAULT_CHARSET;
}
if (pszFontFamily == NULL) {
lf.lfFaceName[0] = L'\0';
@@ -190,7 +190,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, F }
return LoadFont(lf);
}
-FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength)
+FX_BOOL CFX_GdiFont::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength)
{
FXSYS_assert(m_hFont == NULL && pBuffer != NULL && iLength > 0);
Gdiplus::PrivateFontCollection pfc;
@@ -247,7 +247,7 @@ FX_BOOL CFX_GdiFont::LoadFont(FX_LPCWSTR pszFileName) FX_BOOL CFX_GdiFont::LoadFont(IFX_Stream *pFontStream)
{
FXSYS_assert(m_hFont == NULL && pFontStream != NULL);
- FX_INT32 iLength = pFontStream->GetLength();
+ int32_t iLength = pFontStream->GetLength();
if (iLength < 1) {
return FALSE;
}
@@ -272,9 +272,9 @@ FX_BOOL CFX_GdiFont::LoadFont(const LOGFONTW &lf) ::GetOutlineTextMetricsW(m_hDC, sizeof(m_OutlineTM), &m_OutlineTM);
return TRUE;
}
-FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc)
+int32_t CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc)
{
- FX_INT32 iCount = fc.GetFamilyCount();
+ int32_t iCount = fc.GetFamilyCount();
if (iCount < 1) {
return iCount;
}
@@ -282,9 +282,9 @@ FX_INT32 CFX_GdiFont::GetFontFamilies(Gdiplus::FontCollection &fc) if (pFontFamilies == NULL) {
return -1;
}
- FX_INT32 iFind = 0;
+ int32_t iFind = 0;
fc.GetFamilies(iCount, pFontFamilies, &iFind);
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
CFX_WideString wsFamilyName;
FX_LPWSTR pName = wsFamilyName.GetBuffer(LF_FACESIZE);
pFontFamilies[i].GetFamilyName(pName);
@@ -306,12 +306,12 @@ void CFX_GdiFont::GetFamilyName(CFX_WideString &wsFamily) const FXSYS_assert(m_hFont != NULL);
wsFamily = m_LogFont.lfFaceName;
}
-FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
+FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
{
- iWidth = (FX_INT32)(FX_SHORT)m_WidthCache.GetAt(wUnicode, 0);
+ iWidth = (int32_t)(int16_t)m_WidthCache.GetAt(wUnicode, 0);
if (iWidth == 0 || iWidth == -1) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
if (!::GetCharWidthI(m_hDC, iGlyph, 1, NULL, &iWidth)) {
@@ -324,18 +324,18 @@ FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL b iWidth = -1;
}
Lock();
- m_WidthCache.SetAtGrow(wUnicode, (FX_SHORT)iWidth);
+ m_WidthCache.SetAtGrow(wUnicode, (int16_t)iWidth);
Unlock();
}
return iWidth > 0;
}
-FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode)
+FX_BOOL CFX_GdiFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode)
{
return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode);
}
-FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
+int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
{
- FX_INT32 iGlyph = 0XFFFF;
+ int32_t iGlyph = 0XFFFF;
if (::GetGlyphIndicesW(m_hDC, &wUnicode, 1, (LPWORD)&iGlyph, GGI_MARK_NONEXISTING_GLYPHS) != GDI_ERROR && iGlyph != 0xFFFF) {
if (ppFont != NULL) {
*ppFont = (IFX_Font*)this;
@@ -355,7 +355,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F if (pFont != NULL && pFont != (IFX_Font*)this) {
iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyph != 0xFFFF) {
- FX_INT32 i = m_SubstFonts.Find(pFont);
+ int32_t i = m_SubstFonts.Find(pFont);
if (i > -1) {
iGlyph |= ((i + 1) << 24);
if (ppFont != NULL) {
@@ -373,7 +373,7 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F return 0xFFFF;
}
m_FontMapper.SetAt((void*)wBitField, (void*)pFont);
- FX_INT32 i = m_SubstFonts.GetSize();
+ int32_t i = m_SubstFonts.GetSize();
m_SubstFonts.Add(pFont);
iGlyph = ((CFX_GdiFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyph != 0xFFFF) {
@@ -387,21 +387,21 @@ FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_F }
return 0xFFFF;
}
-FX_INT32 CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
+int32_t CFX_GdiFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
{
return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode);
}
-FX_INT32 CFX_GdiFont::GetAscent() const
+int32_t CFX_GdiFont::GetAscent() const
{
return m_OutlineTM.otmAscent;
}
-FX_INT32 CFX_GdiFont::GetDescent() const
+int32_t CFX_GdiFont::GetDescent() const
{
return m_OutlineTM.otmDescent;
}
FX_BOOL CFX_GdiFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode)
{
- FX_INT32 iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode);
+ int32_t iGlyphIndex = GetGlyphIndex(wUnicode, bCharCode);
if (iGlyphIndex == 0xFFFF) {
return FALSE;
}
@@ -429,7 +429,7 @@ FX_BOOL CFX_GdiFont::GetBBox(CFX_Rect &bbox) bbox.height = m_OutlineTM.otmrcFontBox.bottom - m_OutlineTM.otmrcFontBox.top;
return TRUE;
}
-FX_INT32 CFX_GdiFont::GetItalicAngle() const
+int32_t CFX_GdiFont::GetItalicAngle() const
{
return m_OutlineTM.otmItalicAngle / 10;
}
@@ -440,9 +440,9 @@ void CFX_GdiFont::Reset() ClearCache();
Unlock();
}
-IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const
+IFX_Font* CFX_GdiFont::GetSubstFont(int32_t iGlyphIndex) const
{
- FX_INT32 iHigher = (iGlyphIndex & 0x7F000000) >> 24;
+ int32_t iHigher = (iGlyphIndex & 0x7F000000) >> 24;
if (iHigher == 0) {
return (IFX_Font*)this;
}
@@ -451,7 +451,7 @@ IFX_Font* CFX_GdiFont::GetSubstFont(FX_INT32 iGlyphIndex) const }
return (IFX_Font*)m_SubstFonts[iHigher - 1];
}
-FX_DWORD CFX_GdiFont::GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize)
+FX_DWORD CFX_GdiFont::GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize)
{
static const UINT uFormat = GGO_GLYPH_INDEX | GGO_GRAY8_BITMAP;
IFX_Font *pFont = GetSubstFont(iGlyphIndex);
@@ -511,11 +511,11 @@ FX_DWORD CFX_GdiFont::GetMAT2HashCode(const FIXED *pFixed) }
return ((dwHash1 & 0x0000FFFF) << 16) | (dwHash2 & 0x0000FFFF);
}
-void CFX_GdiFont::CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb)
+void CFX_GdiFont::CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb)
{
- FX_INT32 padding = ((iWidth + 3) / 4) * 4 - iWidth;
+ int32_t padding = ((iWidth + 3) / 4) * 4 - iWidth;
FX_DWORD alpha;
- FX_INT32 i, j;
+ int32_t i, j;
for (j = iHeight - 1; j >= 0; --j) {
for (i = iWidth - 1; i >= 0; --i) {
if ((alpha = *pOutline++) == 0) {
diff --git a/xfa/src/fgas/src/font/fx_gdifont.h b/xfa/src/fgas/src/font/fx_gdifont.h index 3c159f5057..b9143602e6 100644 --- a/xfa/src/fgas/src/font/fx_gdifont.h +++ b/xfa/src/fgas/src/font/fx_gdifont.h @@ -31,7 +31,7 @@ public: virtual void Release();
virtual IFX_Font* Retain();
FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage);
- FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength);
+ FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t iLength);
FX_BOOL LoadFont(FX_LPCWSTR pszFileName);
FX_BOOL LoadFont(IFX_Stream *pFontStream);
FX_BOOL LoadFont(const LOGFONTW &lf);
@@ -44,23 +44,23 @@ public: {
return m_dwStyles;
}
- virtual FX_BYTE GetCharSet() const
+ virtual uint8_t GetCharSet() const
{
return m_LogFont.lfCharSet;
}
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetAscent() const;
- virtual FX_INT32 GetDescent() const;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetAscent() const;
+ virtual int32_t GetDescent() const;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE);
virtual FX_BOOL GetBBox(CFX_Rect &bbox);
- virtual FX_INT32 GetItalicAngle() const;
+ virtual int32_t GetItalicAngle() const;
virtual void Reset();
- FX_DWORD GetGlyphDIBits(FX_INT32 iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize);
+ FX_DWORD GetGlyphDIBits(int32_t iGlyphIndex, FX_ARGB argb, const MAT2 *pMatrix, GLYPHMETRICS &gm, FX_LPVOID pBuffer, FX_DWORD bufSize);
FX_DWORD GetHashCode() const;
protected:
IFX_FontMgr *m_pFontMgr;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
CFX_WordDiscreteArray m_WidthCache;
OUTLINETEXTMETRICW m_OutlineTM;
HGDIOBJ m_hOldFont;
@@ -75,13 +75,13 @@ protected: CFX_MapPtrToPtr m_FontMapper;
CFX_MapPtrToPtr m_FontCache;
void ClearCache();
- FX_INT32 GetFontFamilies(Gdiplus::FontCollection &fc);
+ int32_t GetFontFamilies(Gdiplus::FontCollection &fc);
void RetrieveFontStyles();
- IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const;
- FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
+ IFX_Font* GetSubstFont(int32_t iGlyphIndex) const;
+ FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
+ int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
FX_DWORD GetMAT2HashCode(const FIXED *pFixed);
- void CreateGlyphBitmap(FX_INT32 iWidth, FX_INT32 iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb);
+ void CreateGlyphBitmap(int32_t iWidth, int32_t iHeight, FX_LPBYTE pOutline, FX_LPDWORD pDIB, FX_ARGB argb);
friend class CFX_GdiFontMgr;
};
#endif
diff --git a/xfa/src/fgas/src/font/fx_gefont.cpp b/xfa/src/fgas/src/font/fx_gefont.cpp index f952bc730e..a67b7b47bb 100644 --- a/xfa/src/fgas/src/font/fx_gefont.cpp +++ b/xfa/src/fgas/src/font/fx_gefont.cpp @@ -24,7 +24,7 @@ IFX_Font* IFX_Font::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX return pFont;
#endif
}
-IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, IFX_FontMgr *pFontMgr)
+IFX_Font* IFX_Font::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, IFX_FontMgr *pFontMgr)
{
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
if (NULL != pFontMgr) {
@@ -138,8 +138,8 @@ CFX_GEFont::CFX_GEFont(const CFX_GEFont &src, FX_DWORD dwFontStyles) }
CFX_GEFont::~CFX_GEFont()
{
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
pFont->Release();
}
@@ -213,7 +213,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX if (dwFontStyles & FX_FONTSTYLE_ExactMatch) {
dwFlags |= FXFONT_EXACTMATCH;
}
- FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
+ int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
FX_WORD wCharSet = FX_GetCharsetFromCodePage(wCodePage);
if (wCharSet == 0xFFFF) {
wCharSet = FXSYS_GetACP();
@@ -235,7 +235,7 @@ FX_BOOL CFX_GEFont::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX Unlock();
return bRet;
}
-FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length)
+FX_BOOL CFX_GEFont::LoadFont(FX_LPCBYTE pBuffer, int32_t length)
{
if (m_pFont != NULL) {
return FALSE;
@@ -355,11 +355,11 @@ IFX_Font* CFX_GEFont::Derive(FX_DWORD dwFontStyles, FX_WORD wCodePage ) }
return FX_NEW CFX_GEFont(*this, dwFontStyles);
}
-FX_BYTE CFX_GEFont::GetCharSet() const
+uint8_t CFX_GEFont::GetCharSet() const
{
FXSYS_assert(m_pFont != NULL);
if (m_wCharSet != 0xFFFF) {
- return (FX_BYTE)m_wCharSet;
+ return (uint8_t)m_wCharSet;
}
if (m_pFont->m_pSubstFont == NULL) {
return FX_CHARSET_Default;
@@ -405,18 +405,18 @@ FX_DWORD CFX_GEFont::GetFontStyles() const }
return dwStyles;
}
-FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode)
+FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode)
{
return GetCharWidth(wUnicode, iWidth, TRUE, bCharCode);
}
-FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
+FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode)
{
FXSYS_assert (m_pCharWidthMap != NULL);
iWidth = m_pCharWidthMap->GetAt(wUnicode, 0);
if (iWidth < 1) {
if (!m_pProvider || !m_pProvider->GetCharWidth(this, wUnicode, iWidth, bCharCode)) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
iWidth = m_pFont->GetGlyphWidth(iGlyph);
@@ -431,7 +431,7 @@ FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bR }
}
Lock();
- m_pCharWidthMap->SetAtGrow(wUnicode, (FX_SHORT)iWidth);
+ m_pCharWidthMap->SetAtGrow(wUnicode, (int16_t)iWidth);
Unlock();
} else if (iWidth == 65535) {
iWidth = -1;
@@ -447,9 +447,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu FXSYS_assert(m_pRectArray != NULL);
FXSYS_assert(m_pBBoxMap != NULL);
FX_LPVOID pRect = NULL;
- if (!m_pBBoxMap->Lookup((void*)(FX_UINTPTR)wUnicode, pRect)) {
+ if (!m_pBBoxMap->Lookup((void*)(uintptr_t)wUnicode, pRect)) {
IFX_Font *pFont = NULL;
- FX_INT32 iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
+ int32_t iGlyph = GetGlyphIndex(wUnicode, TRUE, &pFont, bCharCode);
if (iGlyph != 0xFFFF && pFont != NULL) {
if (pFont == (IFX_Font*)this) {
FX_RECT rtBBox;
@@ -457,9 +457,9 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecu Lock();
CFX_Rect rt;
rt.Set(rtBBox.left, rtBBox.top, rtBBox.Width(), rtBBox.Height());
- FX_INT32 index = m_pRectArray->Add(rt);
+ int32_t index = m_pRectArray->Add(rt);
pRect = m_pRectArray->GetPtrAt(index);
- m_pBBoxMap->SetAt((void*)(FX_UINTPTR)wUnicode, pRect);
+ m_pBBoxMap->SetAt((void*)(uintptr_t)wUnicode, pRect);
Unlock();
}
} else if (((CFX_GEFont*)pFont)->GetCharBBox(wUnicode, bbox, FALSE, bCharCode)) {
@@ -485,21 +485,21 @@ FX_BOOL CFX_GEFont::GetBBox(CFX_Rect &bbox) }
return bRet;
}
-FX_INT32 CFX_GEFont::GetItalicAngle() const
+int32_t CFX_GEFont::GetItalicAngle() const
{
if (m_pFont->m_pSubstFont == NULL) {
return 0;
}
return m_pFont->m_pSubstFont->m_ItalicAngle;
}
-FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
+int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode)
{
return GetGlyphIndex(wUnicode, TRUE, NULL, bCharCode);
}
-FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
+int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode)
{
FXSYS_assert (m_pFontEncoding != NULL);
- FX_INT32 iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode);
+ int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode);
if (iGlyphIndex > 0) {
if (ppFont != NULL) {
*ppFont = (IFX_Font*)this;
@@ -515,11 +515,11 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo return 0xFFFF;
}
IFX_Font *pFont = NULL;
- m_FontMapper.Lookup((void*)(FX_UINTPTR)wUnicode, (void*&)pFont);
+ m_FontMapper.Lookup((void*)(uintptr_t)wUnicode, (void*&)pFont);
if (pFont != NULL && pFont != (IFX_Font*)this) {
iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyphIndex != 0xFFFF) {
- FX_INT32 i = m_SubstFonts.Find(pFont);
+ int32_t i = m_SubstFonts.Find(pFont);
if (i > -1) {
iGlyphIndex |= ((i + 1) << 24);
if (ppFont != NULL) {
@@ -545,8 +545,8 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo pFont->Release();
return 0xFFFF;
}
- m_FontMapper.SetAt((void*)(FX_UINTPTR)wUnicode, (void*)pFont);
- FX_INT32 i = m_SubstFonts.GetSize();
+ m_FontMapper.SetAt((void*)(uintptr_t)wUnicode, (void*)pFont);
+ int32_t i = m_SubstFonts.GetSize();
m_SubstFonts.Add(pFont);
iGlyphIndex = ((CFX_GEFont*)pFont)->GetGlyphIndex(wUnicode, FALSE, NULL, bCharCode);
if (iGlyphIndex != 0xFFFF) {
@@ -560,19 +560,19 @@ FX_INT32 CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Fo }
return 0xFFFF;
}
-FX_INT32 CFX_GEFont::GetAscent() const
+int32_t CFX_GEFont::GetAscent() const
{
return m_pFont->GetAscent();
}
-FX_INT32 CFX_GEFont::GetDescent() const
+int32_t CFX_GEFont::GetDescent() const
{
return m_pFont->GetDescent();
}
void CFX_GEFont::Reset()
{
Lock();
- FX_INT32 iCount = m_SubstFonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_SubstFonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_SubstFonts[i];
((CFX_GEFont*)pFont)->Reset();
}
@@ -587,7 +587,7 @@ void CFX_GEFont::Reset() }
Unlock();
}
-IFX_Font* CFX_GEFont::GetSubstFont(FX_INT32 iGlyphIndex) const
+IFX_Font* CFX_GEFont::GetSubstFont(int32_t iGlyphIndex) const
{
iGlyphIndex = ((FX_DWORD)iGlyphIndex) >> 24;
return iGlyphIndex == 0 ? (IFX_Font*)this : (IFX_Font*)m_SubstFonts[iGlyphIndex - 1];
diff --git a/xfa/src/fgas/src/font/fx_gefont.h b/xfa/src/fgas/src/font/fx_gefont.h index 585a04c638..e03fd8844e 100644 --- a/xfa/src/fgas/src/font/fx_gefont.h +++ b/xfa/src/fgas/src/font/fx_gefont.h @@ -20,7 +20,7 @@ public: virtual void Release();
virtual IFX_Font* Retain();
FX_BOOL LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage);
- FX_BOOL LoadFont(FX_LPCBYTE pBuffer, FX_INT32 length);
+ FX_BOOL LoadFont(FX_LPCBYTE pBuffer, int32_t length);
FX_BOOL LoadFont(FX_LPCWSTR pszFileName);
FX_BOOL LoadFont(IFX_Stream *pFontStream, FX_BOOL bSaveStream);
FX_BOOL LoadFont(CFX_Font *pExtFont, FX_BOOL bTakeOver = FALSE);
@@ -28,16 +28,16 @@ public: virtual void GetFamilyName(CFX_WideString &wsFamily) const;
virtual void GetPsName(CFX_WideString &wsName) const;
virtual FX_DWORD GetFontStyles() const;
- virtual FX_BYTE GetCharSet() const;
- virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
- virtual FX_INT32 GetAscent() const;
- virtual FX_INT32 GetDescent() const;
+ virtual uint8_t GetCharSet() const;
+ virtual FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bCharCode = FALSE);
+ virtual int32_t GetAscent() const;
+ virtual int32_t GetDescent() const;
virtual FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bCharCode = FALSE);
virtual FX_BOOL GetBBox(CFX_Rect &bbox);
- virtual FX_INT32 GetItalicAngle() const;
+ virtual int32_t GetItalicAngle() const;
virtual void Reset();
- virtual IFX_Font* GetSubstFont(FX_INT32 iGlyphIndex) const;
+ virtual IFX_Font* GetSubstFont(int32_t iGlyphIndex) const;
virtual void* GetDevFont()const
{
return (void*)m_pFont;
@@ -60,7 +60,7 @@ protected: #endif
CFX_Font *m_pFont;
IFX_FontMgr *m_pFontMgr;
- FX_INT32 m_iRefCount;
+ int32_t m_iRefCount;
FX_BOOL m_bExtFont;
IFX_Stream *m_pStream;
IFX_FileRead *m_pFileRead;
@@ -74,8 +74,8 @@ protected: CFX_MapPtrToPtr m_FontMapper;
void InitFont();
FX_BOOL GetCharBBox(FX_WCHAR wUnicode, CFX_Rect &bbox, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_BOOL GetCharWidth(FX_WCHAR wUnicode, FX_INT32 &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
- FX_INT32 GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
+ FX_BOOL GetCharWidth(FX_WCHAR wUnicode, int32_t &iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode = FALSE);
+ int32_t GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font **ppFont, FX_BOOL bCharCode = FALSE);
};
#endif
#endif
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp index 7f153b16d3..2f4ef2038f 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.cpp +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.cpp @@ -44,7 +44,7 @@ CFX_StdFontMgrImp::~CFX_StdFontMgrImp() m_FileFonts.RemoveAll();
m_StreamFonts.RemoveAll();
m_DeriveFonts.RemoveAll();
- for (FX_INT32 i = m_Fonts.GetUpperBound(); i >= 0; i--) {
+ for (int32_t i = m_Fonts.GetUpperBound(); i >= 0; i--) {
IFX_Font *pFont = (IFX_Font*)m_Fonts[i];
if (pFont != NULL) {
pFont->Release();
@@ -56,7 +56,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw {
FX_DWORD dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
IFX_Font *pFont = NULL;
- if (m_CPFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_CPFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD;
@@ -69,14 +69,14 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dw pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontFamilyHash(pFD->wsFontFace, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
}
-IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily)
+IFX_Font* CFX_StdFontMgrImp::GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily)
{
return GetDefFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily);
}
@@ -89,7 +89,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF }
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, pRet->wBitField);
IFX_Font *pFont = NULL;
- if (m_UnicodeFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_UnicodeFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, pRet->wCodePage) : NULL;
}
#ifdef _FX_USEGASFONTMGR_
@@ -109,7 +109,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF if (pBuiltinMapper == NULL) {
return NULL;
}
- FX_INT32 iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
+ int32_t iWeight = (dwFontStyles & FX_FONTSTYLE_Bold) ? FXFONT_FW_BOLD : FXFONT_FW_NORMAL;
int italic_angle = 0;
FXFT_Face ftFace = pBuiltinMapper->FindSubstFontByUnicode(wUnicode, dwFontStyles, iWeight, italic_angle);
if (ftFace == NULL) {
@@ -129,11 +129,11 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwF #endif
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_UnicodeFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_UnicodeFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontFamilyHash(pFontFace, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
@@ -146,7 +146,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontFamily, dwFontStyles, wCodePage);
IFX_Font *pFont = NULL;
- if (m_FamilyFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_FamilyFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
return pFont ? LoadFont(pFont, dwFontStyles, wCodePage) : NULL;
}
FX_LPCFONTDESCRIPTOR pFD = NULL;
@@ -161,14 +161,14 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontS pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
dwHash = FGAS_GetFontHashCode(wCodePage, dwFontStyles);
- m_CPFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_CPFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return LoadFont(pFont, dwFontStyles, wCodePage);
}
return NULL;
}
-IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength)
+IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCBYTE pBuffer, int32_t iLength)
{
FXSYS_assert(pBuffer != NULL && iLength > 0);
IFX_Font *pFont = NULL;
@@ -190,7 +190,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) FXSYS_assert(pszFileName != NULL);
FX_DWORD dwHash = FX_HashCode_String_GetW(pszFileName, -1);
IFX_Font *pFont = NULL;
- if (m_FileFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont)) {
+ if (m_FileFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) {
if (pFont != NULL) {
return pFont->Retain();
}
@@ -198,7 +198,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(FX_LPCWSTR pszFileName) pFont = IFX_Font::LoadFont(pszFileName, NULL);
if (pFont != NULL) {
m_Fonts.Add(pFont);
- m_FileFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FileFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
return pFont->Retain();
}
return NULL;
@@ -211,7 +211,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon if (pFont != NULL) {
if (pszFontAlias != NULL) {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
}
return LoadFont(pFont, dwFontStyles, wCodePage);
}
@@ -222,7 +222,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFon m_StreamFonts.SetAt((void*)pFontStream, (void*)pFont);
if (pszFontAlias != NULL) {
FX_DWORD dwHash = FGAS_GetFontFamilyHash(pszFontAlias, dwFontStyles, wCodePage);
- m_FamilyFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
+ m_FamilyFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
}
return LoadFont(pFont, dwFontStyles, wCodePage);
}
@@ -234,19 +234,19 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, if (pSrcFont->GetFontStyles() == dwFontStyles) {
return pSrcFont->Retain();
}
- void* buffer[3] = {pSrcFont, (void*)(FX_UINTPTR)dwFontStyles, (void*)(FX_UINTPTR)wCodePage};
+ void* buffer[3] = {pSrcFont, (void*)(uintptr_t)dwFontStyles, (void*)(uintptr_t)wCodePage};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)buffer, 3 * sizeof(void*));
IFX_Font *pFont = NULL;
if (m_DeriveFonts.GetCount() > 0) {
- m_DeriveFonts.Lookup((void*)(FX_UINTPTR)dwHash, (void*&)pFont);
+ m_DeriveFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont);
if (pFont != NULL) {
return pFont->Retain();
}
}
pFont = pSrcFont->Derive(dwFontStyles, wCodePage);
if (pFont != NULL) {
- m_DeriveFonts.SetAt((void*)(FX_UINTPTR)dwHash, (void*)pFont);
- FX_INT32 index = m_Fonts.Find(pFont);
+ m_DeriveFonts.SetAt((void*)(uintptr_t)dwHash, (void*)pFont);
+ int32_t index = m_Fonts.Find(pFont);
if (index < 0) {
m_Fonts.Add(pFont);
pFont->Retain();
@@ -257,8 +257,8 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, }
void CFX_StdFontMgrImp::ClearFontCache()
{
- FX_INT32 iCount = m_Fonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_Fonts.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
IFX_Font *pFont = (IFX_Font*)m_Fonts[i];
if (pFont != NULL) {
pFont->Reset();
@@ -289,7 +289,7 @@ void CFX_StdFontMgrImp::RemoveFont(IFX_Font *pFont) RemoveFont(m_FileFonts, pFont);
RemoveFont(m_StreamFonts, pFont);
RemoveFont(m_DeriveFonts, pFont);
- FX_INT32 iFind = m_Fonts.Find(pFont);
+ int32_t iFind = m_Fonts.Find(pFont);
if (iFind > -1) {
m_Fonts.RemoveAt(iFind, 1);
}
@@ -319,7 +319,7 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW if (pDesc == NULL) {
return NULL;
}
- for (FX_INT32 i = m_FontFaces.GetSize() - 1; i >= 0; i--) {
+ for (int32_t i = m_FontFaces.GetSize() - 1; i >= 0; i--) {
FX_LPCFONTDESCRIPTOR pMatch = m_FontFaces.GetPtrAt(i);
if (*pMatch == *pDesc) {
return pMatch;
@@ -333,10 +333,10 @@ FX_LPCFONTDESCRIPTOR CFX_StdFontMgrImp::FindFont(FX_LPCWSTR pszFontFamily, FX_DW FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData)
{
FX_LPCFONTDESCRIPTOR pBestFont = NULL;
- FX_INT32 iBestSimilar = 0;
+ int32_t iBestSimilar = 0;
FX_BOOL bMatchStyle = (pParams->dwMatchFlags & FX_FONTMATCHPARA_MacthStyle) > 0;
- FX_INT32 iCount = fonts.GetSize();
- for (FX_INT32 i = 0; i < iCount; ++i) {
+ int32_t iCount = fonts.GetSize();
+ for (int32_t i = 0; i < iCount; ++i) {
FX_LPCFONTDESCRIPTOR pFont = fonts.GetPtrAt(i);
if ((pFont->dwFontStyles & FX_FONTSTYLE_BoldItalic) == FX_FONTSTYLE_BoldItalic) {
continue;
@@ -377,7 +377,7 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F return pFont;
}
}
- FX_INT32 iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles);
+ int32_t iSimilarValue = FX_GetSimilarValue(pFont, pParams->dwFontStyles);
if (iBestSimilar < iSimilarValue) {
iBestSimilar = iSimilarValue;
pBestFont = pFont;
@@ -385,9 +385,9 @@ FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_F }
return iBestSimilar < 1 ? NULL : pBestFont;
}
-FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles)
+int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles)
{
- FX_INT32 iValue = 0;
+ int32_t iValue = 0;
if ((dwFontStyles & FX_FONTSTYLE_Symbolic) == (pFont->dwFontStyles & FX_FONTSTYLE_Symbolic)) {
iValue += 64;
}
@@ -412,7 +412,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) if ((lf.lfPitchAndFamily & 0x03) == FIXED_PITCH) {
dwStyles |= FX_FONTSTYLE_FixedPitch;
}
- FX_BYTE nFamilies = lf.lfPitchAndFamily & 0xF0;
+ uint8_t nFamilies = lf.lfPitchAndFamily & 0xF0;
if (nFamilies == FF_ROMAN) {
dwStyles |= FX_FONTSTYLE_Serif;
}
@@ -424,7 +424,7 @@ FX_DWORD FX_GetGdiFontStyles(const LOGFONTW &lf) }
return dwStyles;
}
-static FX_INT32 CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
+static int32_t CALLBACK FX_GdiFontEnumProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, DWORD dwFontType, LPARAM lParam)
{
if (dwFontType != TRUETYPE_FONTTYPE) {
return 1;
@@ -481,7 +481,7 @@ FX_LPCSTR g_FontFolders[] = { };
CFX_FontSourceEnum_File::CFX_FontSourceEnum_File()
{
- for (FX_INT32 i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) {
+ for (int32_t i = 0; i < sizeof(g_FontFolders) / sizeof(FX_LPCSTR); i++) {
m_FolderPaths.Add(g_FontFolders[i]);
}
}
@@ -601,13 +601,13 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() pFontSource->Release();
continue;
}
- FX_INT32 nFaceCount = pFace->num_faces;
+ int32_t nFaceCount = pFace->num_faces;
ReportFace(pFace, m_InstalledFonts, pFontSource);
if (FXFT_Get_Face_External_Stream(pFace)) {
FXFT_Clear_Face_External_Stream(pFace);
}
FXFT_Done_Face(pFace);
- for (FX_INT32 i = 1; i < nFaceCount; i++) {
+ for (int32_t i = 1; i < nFaceCount; i++) {
if (NULL == (pFace = LoadFace(pFontStream, i))) {
continue;
}
@@ -624,7 +624,7 @@ FX_BOOL CFX_FontMgrImp::EnumFonts() }
void CFX_FontMgrImp::Release()
{
- for (FX_INT32 i = 0; i < m_InstalledFonts.GetSize(); i++) {
+ for (int32_t i = 0; i < m_InstalledFonts.GetSize(); i++) {
delete m_InstalledFonts[i];
}
FX_POSITION pos = m_Hash2CandidateList.GetStartPosition();
@@ -677,7 +677,7 @@ IFX_Font* CFX_FontMgrImp::GetDefFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFo {
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCodePage(this, wCodePage, dwFontStyles, pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
+IFX_Font* CFX_FontMgrImp::GetDefFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
{
return NULL == m_pDelegate ? NULL : m_pDelegate->GetDefFontByCharset(this, nCharset, dwFontStyles, pszFontFamily);
}
@@ -729,7 +729,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByCodePage( FX_WORD wCodePage, FX_DWORD dwFontS pFonts->Add(pFont);
return pFont;
}
-IFX_Font* CFX_FontMgrImp::GetFontByCharset( FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
+IFX_Font* CFX_FontMgrImp::GetFontByCharset( uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily )
{
return GetFontByCodePage(FX_GetCodePageFromCharset(nCharset), dwFontStyles, pszFontFamily);
}
@@ -756,7 +756,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt return NULL;
}
if (0 != pFonts->GetSize()) {
- for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < pFonts->GetSize(); i++) {
if (VerifyUnicode(pFonts->GetAt(i), wUnicode)) {
return pFonts->GetAt(i)->Retain();
}
@@ -776,7 +776,7 @@ IFX_Font* CFX_FontMgrImp::GetFontByUnicode( FX_WCHAR wUnicode, FX_DWORD dwFontSt MatchFonts(*sortedFonts, wCodePage, dwFontStyles, CFX_WideString(pszFontFamily), wUnicode);
m_Hash2CandidateList.SetAt(dwHash, sortedFonts);
}
- for (FX_INT32 i = 0; i < sortedFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < sortedFonts->GetSize(); i++) {
CFX_FontDescriptor* pDesc = sortedFonts->GetAt(i).pFont;
if (VerifyUnicode(pDesc, wUnicode)) {
pFont = LoadFont(pDesc->m_pFileAccess, pDesc->m_nFaceIndex, NULL);
@@ -846,9 +846,9 @@ IFX_Font* CFX_FontMgrImp::GetFontByLanguage( FX_WORD wLanguage, FX_DWORD dwFontS {
return GetFontByCodePage(FX_GetDefCodePageByLanguage(wLanguage), dwFontStyles, pszFontFamily);
}
-IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount )
+IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount )
{
- FX_LPVOID Hash[2] = {(FX_LPVOID)(FX_UINTPTR)pBuffer, (FX_LPVOID)(FX_UINTPTR)iLength};
+ FX_LPVOID Hash[2] = {(FX_LPVOID)(uintptr_t)pBuffer, (FX_LPVOID)(uintptr_t)iLength};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 2 * sizeof (FX_LPVOID));
IFX_FileAccess* pFontAccess = NULL;
if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) {
@@ -859,7 +859,7 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount )
+IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount )
{
CFX_ByteString bsHash;
bsHash += CFX_WideString(pszFileName).UTF8Encode();
@@ -875,9 +875,9 @@ IFX_Font* CFX_FontMgrImp::LoadFont( FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream )
+IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream )
{
- FX_LPVOID Hash[1] = {(FX_LPVOID)(FX_UINTPTR)pFontStream};
+ FX_LPVOID Hash[1] = {(FX_LPVOID)(uintptr_t)pFontStream};
FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 1 * sizeof (FX_LPVOID));
IFX_FileAccess* pFontAccess = NULL;
if (!m_Hash2FileAccess.Lookup(dwHash, pFontAccess)) {
@@ -888,13 +888,13 @@ IFX_Font* CFX_FontMgrImp::LoadFont( IFX_Stream* pFontStream, FX_INT32 iFaceIndex return NULL;
}
}
-IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache )
+IFX_Font* CFX_FontMgrImp::LoadFont( IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache )
{
FX_DWORD dwHash = 0;
IFX_Font* pFont = NULL;
if (bWantCache) {
CFX_ByteString bsHash;
- bsHash.Format("%d, %d", (FX_UINTPTR)pFontAccess, iFaceIndex);
+ bsHash.Format("%d, %d", (uintptr_t)pFontAccess, iFaceIndex);
dwHash = FX_HashCode_String_GetA(bsHash, bsHash.GetLength());
if (m_FileAccess2IFXFont.Lookup(dwHash, pFont)) {
if (NULL != pFont) {
@@ -952,7 +952,7 @@ extern "C" {
}
};
-FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, FX_INT32 iFaceIndex )
+FXFT_Face CFX_FontMgrImp::LoadFace( IFX_FileRead* pFontStream, int32_t iFaceIndex )
{
FXFT_Library& library = CFX_GEModule::Get()->GetFontMgr()->m_FTLibrary;
FXFT_Open_Args ftArgs;
@@ -991,17 +991,17 @@ BadRet: }
return NULL;
}
-FX_INT32 CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
+int32_t CFX_FontMgrImp::MatchFonts( CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
{
MatchedFonts.RemoveAll();
CFX_WideString wsNormalizedFontName = FontName;
NormalizeFontName(wsNormalizedFontName);
- static const FX_INT32 nMax = 0xffff;
+ static const int32_t nMax = 0xffff;
CFX_FontDescriptor* pFont = NULL;
- FX_INT32 nCount = m_InstalledFonts.GetSize();
- for (FX_INT32 i = 0; i < nCount; i++) {
+ int32_t nCount = m_InstalledFonts.GetSize();
+ for (int32_t i = 0; i < nCount; i++) {
pFont = m_InstalledFonts[i];
- FX_INT32 nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode);
+ int32_t nPenalty = CalcPenalty(pFont, wCodePage, dwFontStyles, wsNormalizedFontName, wcUnicode);
if (nPenalty >= 0xFFFF) {
continue;
}
@@ -1092,7 +1092,7 @@ static const FX_BitCodePage g_Bit2CodePage[] = { };
FX_WORD FX_GetCodePageBit(FX_WORD wCodePage)
{
- for (FX_INT32 i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) {
+ for (int32_t i = 0; i < sizeof(g_Bit2CodePage) / sizeof (FX_BitCodePage); i++) {
if (g_Bit2CodePage[i].wCodePage == wCodePage) {
return g_Bit2CodePage[i].wBit;
}
@@ -1107,12 +1107,12 @@ FX_WORD FX_GetUnicodeBit(FX_WCHAR wcUnicode) }
return x->wBitField;
}
-FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
+int32_t CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode )
{
- FX_INT32 nPenalty = 30000;
+ int32_t nPenalty = 30000;
if (0 != FontName.GetLength()) {
if (FontName != pInstalled->m_wsFaceName) {
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) {
if (pInstalled->m_wsFamilyNames[i] == FontName) {
break;
@@ -1127,7 +1127,7 @@ FX_INT32 CFX_FontMgrImp::CalcPenalty( CFX_FontDescriptor* pInstalled, FX_WORD wC nPenalty -= 30000;
}
if (30000 == nPenalty && 0 == IsPartName(pInstalled->m_wsFaceName, FontName)) {
- FX_INT32 i;
+ int32_t i;
for (i = 0; i < pInstalled->m_wsFamilyNames.GetSize(); i++) {
if (0 != IsPartName(pInstalled->m_wsFamilyNames[i], FontName)) {
break;
@@ -1236,7 +1236,7 @@ void CFX_FontMgrImp::RemoveFont( IFX_Font* pEFont ) CFX_ArrayTemplate<IFX_Font*>* pFonts;
m_Hash2Fonts.GetNextAssoc(pos, dwHash, pFonts);
if (NULL != pFonts) {
- for (FX_INT32 i = 0; i < pFonts->GetSize(); i++) {
+ for (int32_t i = 0; i < pFonts->GetSize(); i++) {
if (pFonts->GetAt(i) == pEFont) {
pFonts->SetAt(i, NULL);
}
@@ -1267,7 +1267,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF FT_ENC_TAG(dwTag, 'n', 'a', 'm', 'e');
unsigned int error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, NULL, &nLength);
if (0 == error && 0 != nLength) {
- pTable = FX_Alloc(FX_BYTE, nLength);
+ pTable = FX_Alloc(uint8_t, nLength);
if (NULL != pTable) {
error = FXFT_Load_Sfnt_Table(pFace, dwTag, 0, pTable, NULL);
if (0 != error) {
@@ -1285,7 +1285,7 @@ void CFX_FontMgrImp::ReportFace( FXFT_Face pFace, CFX_FontDescriptors& Fonts, IF pFont->m_nFaceIndex = pFace->face_index;
pFont->m_pFileAccess = pFontAccess->Retain();
NormalizeFontName(pFont->m_wsFaceName);
- for (FX_INT32 i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) {
+ for (int32_t i = 0; i < pFont->m_wsFamilyNames.GetSize(); i++) {
NormalizeFontName(pFont->m_wsFamilyNames[i]);
}
Fonts.Add(pFont);
@@ -1304,16 +1304,16 @@ FX_DWORD CFX_FontMgrImp::GetFlags(FXFT_Face pFace) flag |= FX_FONTSTYLE_Symbolic;
}
if (pOS2->panose[0] == 2) {
- FX_BYTE uSerif = pOS2->panose[1];
+ uint8_t uSerif = pOS2->panose[1];
if ((uSerif > 1 && uSerif < 10) || uSerif > 13) {
flag |= FX_FONTSTYLE_Serif;
}
}
return flag;
}
-#define GetUInt8(p) ((FX_UINT8)((p)[0]))
-#define GetUInt16(p) ((FX_UINT16)((p)[0] << 8 | (p)[1]))
-#define GetUInt32(p) ((FX_UINT32)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]))
+#define GetUInt8(p) ((uint8_t)((p)[0]))
+#define GetUInt16(p) ((uint16_t)((p)[0] << 8 | (p)[1]))
+#define GetUInt32(p) ((uint32_t)((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]))
void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names)
{
if (NULL == name_table) {
@@ -1323,25 +1323,25 @@ void CFX_FontMgrImp::GetNames(FX_LPCBYTE name_table, CFX_WideStringArray& Names) CFX_WideString wsFamily;
FX_LPBYTE sp = lpTable + 2;
FX_LPBYTE lpNameRecord = lpTable + 6;
- FX_UINT16 nNameCount = GetUInt16(sp);
+ uint16_t nNameCount = GetUInt16(sp);
FX_LPBYTE lpStr = lpTable + GetUInt16(sp + 2);
- for (FX_UINT16 j = 0; j < nNameCount; j++) {
- FX_UINT16 nNameID = GetUInt16(lpNameRecord + j * 12 + 6);
+ for (uint16_t j = 0; j < nNameCount; j++) {
+ uint16_t nNameID = GetUInt16(lpNameRecord + j * 12 + 6);
if (nNameID != 1) {
continue;
}
- FX_UINT16 nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0);
- FX_UINT16 nNameLength = GetUInt16(lpNameRecord + j * 12 + 8);
- FX_UINT16 nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10);
+ uint16_t nPlatformID = GetUInt16(lpNameRecord + j * 12 + 0);
+ uint16_t nNameLength = GetUInt16(lpNameRecord + j * 12 + 8);
+ uint16_t nNameOffset = GetUInt16(lpNameRecord + j * 12 + 10);
wsFamily.Empty();
if (nPlatformID != 1) {
- for (FX_UINT16 k = 0; k < nNameLength / 2; k++) {
+ for (uint16_t k = 0; k < nNameLength / 2; k++) {
FX_WCHAR wcTemp = GetUInt16(lpStr + nNameOffset + k * 2);
wsFamily += wcTemp;
}
Names.Add(wsFamily);
} else {
- for (FX_UINT16 k = 0; k < nNameLength; k++) {
+ for (uint16_t k = 0; k < nNameLength; k++) {
FX_WCHAR wcTemp = GetUInt8(lpStr + nNameOffset + k);
wsFamily += wcTemp;
}
@@ -1429,7 +1429,7 @@ FX_BIT2CHARSET g_FX_Bit2Charset4[16] = { {1 << 15 , FX_CHARSET_US },
};
#define CODEPAGERANGE_IMPLEMENT(n) \
- for (FX_INT32 i = 0; i < 16; i++)\
+ for (int32_t i = 0; i < 16; i++)\
{\
if ((a##n & g_FX_Bit2Charset##n[i].wBit) != 0)\
{\
@@ -1480,7 +1480,7 @@ void CFX_FontMgrImp::NormalizeFontName( CFX_WideString& FontName ) FontName.Remove(' ');
FontName.Remove('-');
}
-FX_INT32 CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 )
+int32_t CFX_FontMgrImp::IsPartName( const CFX_WideString& Name1, const CFX_WideString& Name2 )
{
if (Name1.Find((FX_LPCWSTR)Name2) != -1) {
return 1;
diff --git a/xfa/src/fgas/src/font/fx_stdfontmgr.h b/xfa/src/fgas/src/font/fx_stdfontmgr.h index ba44233ad0..37b0b63da0 100644 --- a/xfa/src/fgas/src/font/fx_stdfontmgr.h +++ b/xfa/src/fgas/src/font/fx_stdfontmgr.h @@ -7,7 +7,7 @@ #ifndef _FX_FONTMGR_IMP
#define _FX_FONTMGR_IMP
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_INT32 FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles);
+int32_t FX_GetSimilarValue(FX_LPCFONTDESCRIPTOR pFont, FX_DWORD dwFontStyles);
FX_LPCFONTDESCRIPTOR FX_DefFontMatcher(FX_LPFONTMATCHPARAMS pParams, const CFX_FontDescriptors &fonts, FX_LPVOID pUserData);
class CFX_StdFontMgrImp : public IFX_FontMgr
{
@@ -19,11 +19,11 @@ public: delete this;
}
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFontFamily, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength);
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength);
virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName);
virtual IFX_Font* LoadFont(IFX_Stream *pFontStream, FX_LPCWSTR pszFontAlias = NULL, FX_DWORD dwFontStyles = 0, FX_WORD wCodePage = 0, FX_BOOL bSaveStream = FALSE);
virtual IFX_Font* LoadFont(IFX_Font *pSrcFont, FX_DWORD dwFontStyles, FX_WORD wCodePage = 0xFFFF);
@@ -66,7 +66,7 @@ public: }
}
IFX_FileAccess* m_pFileAccess;
- FX_INT32 m_nFaceIndex;
+ int32_t m_nFaceIndex;
CFX_WideString m_wsFaceName;
CFX_WideStringArray m_wsFamilyNames;
FX_DWORD m_dwFontStyles;
@@ -77,7 +77,7 @@ typedef CFX_ArrayTemplate<CFX_FontDescriptor*> CFX_FontDescriptors; struct FX_FontDescriptorInfo {
public:
CFX_FontDescriptor* pFont;
- FX_INT32 nPenalty;
+ int32_t nPenalty;
FX_BOOL operator > (const FX_FontDescriptorInfo& x)
{
return this->nPenalty > x.nPenalty;
@@ -133,16 +133,16 @@ public: CFX_FontMgrImp(IFX_FontSourceEnum* pFontEnum, IFX_FontMgrDelegate* pDelegate = NULL, FX_LPVOID pUserData = NULL);
virtual void Release();
virtual IFX_Font* GetDefFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetDefFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetDefFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetDefFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByCodePage(FX_WORD wCodePage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* GetFontByCharset(FX_BYTE nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
+ virtual IFX_Font* GetFontByCharset(uint8_t nCharset, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByUnicode(FX_WCHAR wUnicode, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
virtual IFX_Font* GetFontByLanguage(FX_WORD wLanguage, FX_DWORD dwFontStyles, FX_LPCWSTR pszFontFamily = NULL);
- virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, FX_INT32 iLength, FX_INT32 iFaceIndex, FX_INT32* pFaceCount);
- virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, FX_INT32 iFaceIndex, FX_INT32* pFaceCount);
- virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bSaveStream = FALSE);
+ virtual IFX_Font* LoadFont(FX_LPCBYTE pBuffer, int32_t iLength, int32_t iFaceIndex, int32_t* pFaceCount);
+ virtual IFX_Font* LoadFont(FX_LPCWSTR pszFileName, int32_t iFaceIndex, int32_t* pFaceCount);
+ virtual IFX_Font* LoadFont(IFX_Stream* pFontStream, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bSaveStream = FALSE);
virtual void ClearFontCache();
virtual void RemoveFont(IFX_Font* pFont);
FX_BOOL EnumFonts();
@@ -156,11 +156,11 @@ protected: FX_BOOL VerifyUnicode(CFX_FontDescriptor* pDesc, FX_WCHAR wcUnicode);
FX_BOOL VerifyUnicode(IFX_Font* pFont, FX_WCHAR wcUnicode);
void NormalizeFontName( CFX_WideString& FontName );
- FX_INT32 IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
- FX_INT32 MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
- FX_INT32 CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
- IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, FX_INT32 iFaceIndex, FX_INT32* pFaceCount, FX_BOOL bWantCache = FALSE);
- FXFT_Face LoadFace(IFX_FileRead* pFontStream, FX_INT32 iFaceIndex);
+ int32_t IsPartName(const CFX_WideString& Name1, const CFX_WideString& Name2);
+ int32_t MatchFonts(CFX_FontDescriptorInfos& MatchedFonts, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
+ int32_t CalcPenalty(CFX_FontDescriptor* pInstalled, FX_WORD wCodePage, FX_DWORD dwFontStyles, const CFX_WideString& FontName, FX_WCHAR wcUnicode = 0xFFFE);
+ IFX_Font* LoadFont(IFX_FileAccess* pFontAccess, int32_t iFaceIndex, int32_t* pFaceCount, FX_BOOL bWantCache = FALSE);
+ FXFT_Face LoadFace(IFX_FileRead* pFontStream, int32_t iFaceIndex);
CFX_HashFontDescsMap m_Hash2CandidateList;
CFX_HashFontsMap m_Hash2Fonts;
CFX_HashFileMap m_Hash2FileAccess;
diff --git a/xfa/src/fgas/src/layout/fx_linebreak.cpp b/xfa/src/fgas/src/layout/fx_linebreak.cpp index 4662e1c122..dde8b8cc61 100644 --- a/xfa/src/fgas/src/layout/fx_linebreak.cpp +++ b/xfa/src/fgas/src/layout/fx_linebreak.cpp @@ -72,7 +72,7 @@ extern const FX_LINEBREAKTYPE gs_FX_LineBreak_PairTable[64][32] = { {FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN},
{FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN, FX_LBUN},
};
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX_INT32 iLength)
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, int32_t iLength)
{
if (iLength < 2) {
return;
@@ -82,7 +82,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX wch = *pwsText ++;
dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
iLength --;
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pwsText ++;
dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
if (dwNext == FX_CBP_SP) {
@@ -94,7 +94,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_LINEBREAKTYPE *pBrkType, FX }
pBrkType[iLength] = FX_LBT_INDIRECT_BRK;
}
-void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32MassArray &bp)
+void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, int32_t iLength, CFX_Int32MassArray &bp)
{
if (iLength < 2) {
return;
@@ -105,7 +105,7 @@ void FX_GetLineBreakPositions(FX_LPCWSTR pwsText, FX_INT32 iLength, CFX_Int32Mas wch = *pwsText ++;
dwCur = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
iLength --;
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pwsText ++;
dwNext = gs_FX_TextLayout_CodeProperties[(FX_WORD)wch] & 0x003F;
if (dwNext == FX_CBP_SP) {
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp index 24c64c453b..95c9118f90 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.cpp @@ -76,7 +76,7 @@ void CFX_RTFBreak::SetLineWidth(FX_FLOAT fLineStart, FX_FLOAT fLineEnd) }
void CFX_RTFBreak::SetLinePos(FX_FLOAT fLinePos)
{
- FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f);
+ int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f);
if (iLinePos > m_iLineEnd) {
iLinePos = m_iLineEnd;
}
@@ -118,7 +118,7 @@ void CFX_RTFBreak::SetFont(IFX_Font *pFont) }
void CFX_RTFBreak::SetFontSize(FX_FLOAT fFontSize)
{
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
if (m_iFontSize == iFontSize) {
return;
}
@@ -139,16 +139,16 @@ void CFX_RTFBreak::SetTabWidth(FX_FLOAT fTabWidth) }
void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos)
{
- FX_INT32 iLineEnd = m_iLineEnd;
- FX_INT32 iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart;
+ int32_t iLineEnd = m_iLineEnd;
+ int32_t iTabPos = FXSYS_round(fTabPos * 20000.0f) + m_iLineStart;
if (iTabPos > iLineEnd) {
iTabPos = iLineEnd;
}
if (m_PositionedTabs.Find(iTabPos, 0) > -1) {
return;
}
- FX_INT32 iCount = m_PositionedTabs.GetSize();
- FX_INT32 iFind = 0;
+ int32_t iCount = m_PositionedTabs.GetSize();
+ int32_t iFind = 0;
for (; iFind < iCount; iFind ++) {
if (m_PositionedTabs[iFind] > iTabPos) {
break;
@@ -164,11 +164,11 @@ void CFX_RTFBreak::AddPositionedTab(FX_FLOAT fTabPos) void CFX_RTFBreak::SetPositionedTabs(const CFX_FloatArray &tabs)
{
m_PositionedTabs.RemoveAll();
- FX_INT32 iCount = tabs.GetSize();
+ int32_t iCount = tabs.GetSize();
m_PositionedTabs.SetSize(iCount);
- FX_INT32 iLineEnd = m_iLineEnd;
- FX_INT32 iTabPos;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iLineEnd = m_iLineEnd;
+ int32_t iTabPos;
+ for (int32_t i = 0; i < iCount; i ++) {
iTabPos = FXSYS_round(tabs[i] * 20000.0f) + m_iLineStart;
if (iTabPos > iLineEnd) {
iTabPos = iLineEnd;
@@ -210,7 +210,7 @@ void CFX_RTFBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) {
m_iTolerance = FXSYS_round(fTolerance * 20000.0f);
}
-void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale)
+void CFX_RTFBreak::SetHorizontalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -221,7 +221,7 @@ void CFX_RTFBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus();
m_iHorizontalScale = iScale;
}
-void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale)
+void CFX_RTFBreak::SetVerticalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -232,7 +232,7 @@ void CFX_RTFBreak::SetVerticalScale(FX_INT32 iScale) SetBreakStatus();
m_iVerticalScale = iScale;
}
-void CFX_RTFBreak::SetCharRotation(FX_INT32 iCharRotation)
+void CFX_RTFBreak::SetCharRotation(int32_t iCharRotation)
{
if (iCharRotation < 0) {
iCharRotation += (-iCharRotation / 4 + 1) * 4;
@@ -260,7 +260,7 @@ void CFX_RTFBreak::SetReadingOrder(FX_BOOL bRTL) {
m_bRTL = bRTL;
}
-void CFX_RTFBreak::SetAlignment(FX_INT32 iAlignment)
+void CFX_RTFBreak::SetAlignment(int32_t iAlignment)
{
FXSYS_assert(iAlignment >= FX_RTFLINEALIGNMENT_Left && iAlignment <= FX_RTFLINEALIGNMENT_Distributed);
m_iAlignment = iAlignment;
@@ -279,15 +279,15 @@ void CFX_RTFBreak::SetUserData(IFX_Unknown *pUserData) m_pUserData->AddRef();
}
}
-static const FX_INT32 gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
-FX_INT32 CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const
+static const int32_t gs_FX_RTFLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
+int32_t CFX_RTFBreak::GetLineRotation(FX_DWORD dwStyles) const
{
return gs_FX_RTFLineRotations[(dwStyles & 0x0E) >> 1];
}
void CFX_RTFBreak::SetBreakStatus()
{
m_dwIdentity ++;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 1) {
return;
}
@@ -296,15 +296,15 @@ void CFX_RTFBreak::SetBreakStatus() tc.m_dwStatus = FX_RTFBREAK_PieceBreak;
}
}
-CFX_RTFChar* CFX_RTFBreak::GetLastChar(FX_INT32 index) const
+CFX_RTFChar* CFX_RTFBreak::GetLastChar(int32_t index) const
{
CFX_RTFCharArray &tca = m_pCurLine->m_LineChars;
- FX_INT32 iCount = tca.GetSize();
+ int32_t iCount = tca.GetSize();
if (index < 0 || index >= iCount) {
return NULL;
}
CFX_RTFChar *pTC;
- FX_INT32 iStart = iCount - 1;
+ int32_t iStart = iCount - 1;
while (iStart > -1) {
pTC = tca.GetDataPtr(iStart --);
if (pTC->m_iCharWidth >= 0 || pTC->GetCharType() != FX_CHARTYPE_Combination) {
@@ -341,18 +341,18 @@ inline FX_DWORD CFX_RTFBreak::GetUnifiedCharType(FX_DWORD dwType) const {
return dwType >= FX_CHARTYPE_ArabicAlef ? FX_CHARTYPE_Arabic : dwType;
}
-FX_INT32 CFX_RTFBreak::GetLastPositionedTab() const
+int32_t CFX_RTFBreak::GetLastPositionedTab() const
{
- FX_INT32 iCount = m_PositionedTabs.GetSize();
+ int32_t iCount = m_PositionedTabs.GetSize();
if (iCount < 1) {
return m_iLineStart;
}
return m_PositionedTabs[iCount - 1];
}
-FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const
+FX_BOOL CFX_RTFBreak::GetPositionedTab(int32_t &iTabPos) const
{
- FX_INT32 iCount = m_PositionedTabs.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_PositionedTabs.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
if (m_PositionedTabs[i] > iTabPos) {
iTabPos = m_PositionedTabs[i];
return TRUE;
@@ -360,7 +360,7 @@ FX_BOOL CFX_RTFBreak::GetPositionedTab(FX_INT32 &iTabPos) const }
return FALSE;
}
-typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
+typedef FX_DWORD (CFX_RTFBreak::*FX_RTFBreak_LPFAppendChar)(CFX_RTFChar *pCurChar, int32_t iRotation);
static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = {
&CFX_RTFBreak::AppendChar_Others,
&CFX_RTFBreak::AppendChar_Tab,
@@ -410,14 +410,14 @@ FX_DWORD CFX_RTFBreak::AppendChar(FX_WCHAR wch) if (!m_bSingleLine && !m_bOrphanLine && m_dwCharType > 0 && m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance) {
if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) {
dwRet1 = EndBreak(FX_RTFBREAK_LineBreak);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount > 0) {
pCurChar = m_pCurLine->m_LineChars.GetDataPtr(iCount - 1);
}
}
}
}
- FX_INT32 iRotation = m_iRotation;
+ int32_t iRotation = m_iRotation;
if (m_bVertical && (dwProps & 0x8000) != 0) {
iRotation = (iRotation + 1) % 4;
}
@@ -448,7 +448,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) m_pUserData->AddRef();
}
pCurChar->m_pUserData = m_pUserData;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(m_iRotation)) {
iCharWidth = 1000;
} else {
@@ -467,9 +467,9 @@ FX_DWORD CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation)
{
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else {
@@ -491,15 +491,15 @@ FX_DWORD CFX_RTFBreak::AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iR }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation)
{
if (m_dwLayoutStyles & FX_RTFLAYOUTSTYLE_ExpandTab) {
FX_BOOL bBreak = FALSE;
if ((m_dwPolicies & FX_RTFBREAKPOLICY_TabBreak) != 0) {
bBreak = (m_pCurLine->GetLineEnd() > m_iLineEnd + m_iTolerance);
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = iLineWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = iLineWidth;
if (GetPositionedTab(iCharWidth)) {
iCharWidth -= iLineWidth;
} else {
@@ -513,7 +513,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation) }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation)
{
FX_DWORD dwRet2 = FX_RTFBREAK_None;
if (!m_bSingleLine) {
@@ -540,11 +540,11 @@ FX_DWORD CFX_RTFBreak::AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotat }
return dwRet2;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation)
{
CFX_RTFChar *pLastChar = NULL;
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = 0;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = 0;
FX_WCHAR wForm;
FX_BOOL bAlef = FALSE;
if (m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) {
@@ -554,7 +554,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati CFX_RTFChar *pPrevChar = GetLastChar(2);
wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
- FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
+ int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) {
iLastRotation ++;
}
@@ -592,7 +592,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotati }
return FX_RTFBREAK_None;
}
-FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation)
{
FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK);
FX_WCHAR wForm;
@@ -607,7 +607,7 @@ FX_DWORD CFX_RTFBreak::AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotati } else {
wForm = pCurChar->m_wCharCode;
}
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
if (m_bVertical != FX_IsOdd(iRotation)) {
iCharWidth = 1000;
} else {
@@ -634,7 +634,7 @@ FX_DWORD CFX_RTFBreak::EndBreak(FX_DWORD dwStatus) FXSYS_assert(dwStatus >= FX_RTFBREAK_PieceBreak && dwStatus <= FX_RTFBREAK_PageBreak);
m_dwIdentity ++;
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iCount = pCurPieces->GetSize();
if (iCount > 0) {
CFX_RTFPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount);
if (dwStatus > FX_RTFBREAK_PieceBreak) {
@@ -723,8 +723,8 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha tp.m_pChars = &m_pCurLine->m_LineChars;
FX_BOOL bNew = TRUE;
FX_DWORD dwIdentity = (FX_DWORD) - 1;
- FX_INT32 iLast = m_pCurLine->CountChars() - 1, j = 0;
- for (FX_INT32 i = 0; i <= iLast;) {
+ int32_t iLast = m_pCurLine->CountChars() - 1, j = 0;
+ for (int32_t i = 0; i <= iLast;) {
pTC = pCurChars + i;
if (bNew) {
tp.m_iStartChar = i;
@@ -760,7 +760,7 @@ FX_BOOL CFX_RTFBreak::EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllCha return TRUE;
}
if (bAllChars && !bDone) {
- FX_INT32 iEndPos = m_pCurLine->GetLineEnd();
+ int32_t iEndPos = m_pCurLine->GetLineEnd();
GetBreakPos(m_pCurLine->m_LineChars, iEndPos, bAllChars, TRUE);
}
return FALSE;
@@ -770,12 +770,12 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) FX_TPO tpo;
CFX_RTFPiece tp;
CFX_RTFChar *pTC;
- FX_INT32 i, j;
+ int32_t i, j;
CFX_RTFCharArray &chars = m_pCurLine->m_LineChars;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = (!m_bPagination && !m_bCharCode && (m_pCurLine->m_iArabicChars > 0 || m_bRTL));
if (bDone) {
- FX_INT32 iBidiNum = 0;
+ int32_t iBidiNum = 0;
for (i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
pTC->m_iBidiPos = i;
@@ -799,7 +799,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_iStartPos = m_pCurLine->m_iStart;
tp.m_pChars = &chars;
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iBidiLevel = -1, iCharWidth;
+ int32_t iBidiLevel = -1, iCharWidth;
FX_DWORD dwIdentity = (FX_DWORD) - 1;
i = j = 0;
while (i < iCount) {
@@ -851,7 +851,7 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (!m_bCharCode) {
j = tpos.GetSize() - 1;
FX_TEXTLAYOUT_PieceSort(tpos, 0, j);
- FX_INT32 iStartPos = m_pCurLine->m_iStart;
+ int32_t iStartPos = m_pCurLine->m_iStart;
for (i = 0; i <= j; i ++) {
tpo = tpos.GetAt(i);
CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -863,11 +863,11 @@ void CFX_RTFBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
CFX_RTFPieceArray *pCurPieces = &m_pCurLine->m_LinePieces;
- FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
+ int32_t iCount = pCurPieces->GetSize();
FX_BOOL bFind = FALSE;
FX_DWORD dwCharType;
- FX_INT32 i, j;
+ int32_t i, j;
FX_TPO tpo;
for (i = iCount - 1; i > -1; i --) {
tpo = tpos.GetAt(i);
@@ -904,11 +904,11 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break;
}
}
- FX_INT32 iOffset = m_iLineEnd - iNetWidth;
- FX_INT32 iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask);
- FX_INT32 iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask);
+ int32_t iOffset = m_iLineEnd - iNetWidth;
+ int32_t iLowerAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_LowerMask);
+ int32_t iHigherAlignment = (m_iAlignment & FX_RTFLINEALIGNMENT_HigherMask);
if (iGapChars > 0 && (iHigherAlignment == FX_RTFLINEALIGNMENT_Distributed || (iHigherAlignment == FX_RTFLINEALIGNMENT_Justified && dwStatus != FX_RTFBREAK_ParagraphBreak))) {
- FX_INT32 iStart = -1;
+ int32_t iStart = -1;
for (i = 0; i < iCount; i ++) {
tpo = tpos.GetAt(i);
CFX_RTFPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -917,7 +917,7 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else {
ttp.m_iStartPos = iStart;
}
- FX_INT32 k;
+ int32_t k;
for (j = 0; j < ttp.m_iChars; j ++) {
CFX_RTFChar &tc = ttp.GetChar(j);
if (tc.m_nBreakType != FX_LBT_DIRECT_BRK || tc.m_iCharWidth < 0) {
@@ -946,13 +946,13 @@ void CFX_RTFBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ }
}
}
-FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
+int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
{
- FX_INT32 iLength = tca.GetSize() - 1;
+ int32_t iLength = tca.GetSize() - 1;
if (iLength < 1) {
return iLength;
}
- FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
+ int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
if (m_bSingleLine || m_bOrphanLine || iEndPos <= m_iLineEnd) {
if (!bAllChars || m_bCharCode) {
return iLength;
@@ -963,7 +963,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ CFX_RTFChar *pCharArray = tca.GetData();
if (m_bCharCode) {
const CFX_RTFChar *pChar;
- FX_INT32 iCharWidth;
+ int32_t iCharWidth;
while (iLength > 0) {
if (iEndPos <= m_iLineEnd) {
break;
@@ -988,7 +988,7 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ }
nCodeProp = pCur->m_dwCharProps;
nNext = nCodeProp & 0x003F;
- FX_INT32 iCharWidth = pCur->m_iCharWidth;
+ int32_t iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0) {
iEndPos -= iCharWidth;
}
@@ -1076,13 +1076,13 @@ FX_INT32 CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, FX_BOOL bAllChars)
{
FXSYS_assert(pCurLine != NULL && pNextLine != NULL);
- FX_INT32 iCount = pCurLine->CountChars();
+ int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 iEndPos = pCurLine->GetLineEnd();
+ int32_t iEndPos = pCurLine->GetLineEnd();
CFX_RTFCharArray &curChars = pCurLine->m_LineChars;
- FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
if (iCharPos < 0) {
iCharPos = 0;
}
@@ -1107,7 +1107,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_nBreakType = FX_LBT_UNKNOWN;
iCount = nextChars.GetSize();
CFX_RTFChar *pNextChars = nextChars.GetData();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
CFX_RTFChar* tc = pNextChars + i;
if (tc->GetCharType() >= FX_CHARTYPE_ArabicAlef) {
pCurLine->m_iArabicChars --;
@@ -1120,7 +1120,7 @@ void CFX_RTFBreak::SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, tc->m_dwStatus = 0;
}
}
-FX_INT32 CFX_RTFBreak::CountBreakPieces() const
+int32_t CFX_RTFBreak::CountBreakPieces() const
{
CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE);
if (pRTFPieces == NULL) {
@@ -1128,7 +1128,7 @@ FX_INT32 CFX_RTFBreak::CountBreakPieces() const }
return pRTFPieces->GetSize();
}
-const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(FX_INT32 index) const
+const CFX_RTFPiece* CFX_RTFBreak::GetBreakPiece(int32_t index) const
{
CFX_RTFPieceArray *pRTFPieces = GetRTFPieces(TRUE);
if (pRTFPieces == NULL) {
@@ -1151,16 +1151,16 @@ void CFX_RTFBreak::GetLineRect(CFX_RectF &rect) const rect.left = ((FX_FLOAT)pRTFLine->m_iStart) / 20000.0f;
rect.width = ((FX_FLOAT)pRTFLine->m_iWidth) / 20000.0f;
CFX_RTFPieceArray &rtfPieces = pRTFLine->m_LinePieces;
- FX_INT32 iCount = rtfPieces.GetSize();
+ int32_t iCount = rtfPieces.GetSize();
if (iCount < 1) {
rect.width = 0;
return;
}
CFX_RTFPiece *pBreakPiece;
- FX_INT32 iLineHeight = 0, iMax;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iLineHeight = 0, iMax;
+ for (int32_t i = 0; i < iCount; i ++) {
pBreakPiece = rtfPieces.GetPtrAt(i);
- FX_INT32 iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f);
+ int32_t iFontHeight = FXSYS_round(pBreakPiece->m_iFontHeight * pBreakPiece->m_iVerticalScale / 100.0f);
iMax = FX_MAX(pBreakPiece->m_iFontSize, iFontHeight);
if (i == 0) {
iLineHeight = iMax;
@@ -1184,24 +1184,24 @@ void CFX_RTFBreak::Reset() m_RTFLine1.RemoveAll(TRUE);
m_RTFLine2.RemoveAll(TRUE);
}
-FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
+int32_t CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
{
if (pText == NULL || pText->iLength < 1) {
return 0;
}
FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL);
FX_LPCWSTR pStr = pText->pStr;
- FX_INT32 *pWidths = pText->pWidths;
- FX_INT32 iLength = pText->iLength - 1;
+ int32_t *pWidths = pText->pWidths;
+ int32_t iLength = pText->iLength - 1;
IFX_Font *pFont = pText->pFont;
FX_DWORD dwStyles = pText->dwLayoutStyles;
CFX_RectF rtText(*pText->pRect);
FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
- FX_INT32 iAscent = pFont->GetAscent();
- FX_INT32 iDescent = pFont->GetDescent();
- FX_INT32 iMaxHeight = iAscent - iDescent;
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iAscent = pFont->GetAscent();
+ int32_t iDescent = pFont->GetDescent();
+ int32_t iMaxHeight = iAscent - iDescent;
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
@@ -1209,13 +1209,13 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh FX_BOOL bVerticalChar = (dwStyles & FX_RTFLAYOUTSTYLE_VerticalChars) != 0;
FX_BOOL bArabicNumber = (dwStyles & FX_RTFLAYOUTSTYLE_ArabicNumber) != 0;
FX_BOOL bMBCSCode = (dwStyles & FX_RTFLAYOUTSTYLE_MBCSCode) != 0;
- FX_INT32 iRotation = GetLineRotation(dwStyles) + pText->iCharRotation;
- FX_INT32 iCharRotation;
+ int32_t iRotation = GetLineRotation(dwStyles) + pText->iCharRotation;
+ int32_t iCharRotation;
FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm;
- FX_INT32 iWidth, iCharWidth, iCharHeight;
+ int32_t iWidth, iCharWidth, iCharHeight;
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
- FX_INT32 iHorScale = pText->iHorizontalScale;
- FX_INT32 iVerScale = pText->iVerticalScale;
+ int32_t iHorScale = pText->iHorizontalScale;
+ int32_t iVerScale = pText->iVerticalScale;
FX_BOOL bEmptyChar;
FX_DWORD dwProps, dwCharType;
fX = rtText.left;
@@ -1231,8 +1231,8 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh }
fY += fAscent;
}
- FX_INT32 iCount = 0;
- for (FX_INT32 i = 0; i <= iLength; i ++) {
+ int32_t iCount = 0;
+ for (int32_t i = 0; i <= iLength; i ++) {
wch = *pStr ++;
iWidth = *pWidths ++;
if (!bMBCSCode) {
@@ -1417,19 +1417,19 @@ FX_INT32 CFX_RTFBreak::GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCh }
return iCount;
}
-FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
+int32_t CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
{
if (pText == NULL || pText->iLength < 1) {
return 0;
}
FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && pText->pFont != NULL && pText->pRect != NULL);
FX_LPCWSTR pStr = pText->pStr;
- FX_INT32 *pWidths = pText->pWidths;
- FX_INT32 iLength = pText->iLength;
+ int32_t *pWidths = pText->pWidths;
+ int32_t iLength = pText->iLength;
CFX_RectF rect(*pText->pRect);
FX_BOOL bRTLPiece = FX_IsOdd(pText->iBidiLevel);
FX_FLOAT fFontSize = pText->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
IFX_Font *pFont = pText->pFont;
if (pFont == NULL) {
@@ -1450,14 +1450,14 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr FX_BOOL bSingleLine = (dwStyles & FX_RTFLAYOUTSTYLE_SingleLine) != 0;
FX_BOOL bCombText = (dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pText->wLineBreakChar;
- FX_INT32 iCharSize;
+ int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
if (bVertical) {
fStart = bRTLPiece ? rect.bottom() : rect.top;
} else {
fStart = bRTLPiece ? rect.right() : rect.left;
}
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
wch = *pStr ++;
iCharSize = *pWidths ++;
fCharSize = (FX_FLOAT)iCharSize / 20000.0f;
@@ -1489,7 +1489,7 @@ FX_INT32 CFX_RTFBreak::GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtAr rect.width = fCharSize;
}
if (bCharBBox && !bRet) {
- FX_INT32 iCharWidth = 1000;
+ int32_t iCharWidth = 1000;
pFont->GetCharWidth(wch, iCharWidth);
FX_FLOAT fRTLeft = 0, fCharWidth = 0;
if (iCharWidth > 0) {
diff --git a/xfa/src/fgas/src/layout/fx_rtfbreak.h b/xfa/src/fgas/src/layout/fx_rtfbreak.h index c8f69277da..394d433412 100644 --- a/xfa/src/fgas/src/layout/fx_rtfbreak.h +++ b/xfa/src/fgas/src/layout/fx_rtfbreak.h @@ -22,35 +22,35 @@ public: {
RemoveAll();
}
- FX_INT32 CountChars() const
+ int32_t CountChars() const
{
return m_LineChars.GetSize();
}
- CFX_RTFChar& GetChar(FX_INT32 index)
+ CFX_RTFChar& GetChar(int32_t index)
{
FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
return *m_LineChars.GetDataPtr(index);
}
- CFX_RTFChar* GetCharPtr(FX_INT32 index)
+ CFX_RTFChar* GetCharPtr(int32_t index)
{
FXSYS_assert(index > -1 && index < m_LineChars.GetSize());
return m_LineChars.GetDataPtr(index);
}
- FX_INT32 CountPieces() const
+ int32_t CountPieces() const
{
return m_LinePieces.GetSize();
}
- CFX_RTFPiece& GetPiece(FX_INT32 index) const
+ CFX_RTFPiece& GetPiece(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
return m_LinePieces.GetAt(index);
}
- CFX_RTFPiece* GetPiecePtr(FX_INT32 index) const
+ CFX_RTFPiece* GetPiecePtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_LinePieces.GetSize());
return m_LinePieces.GetPtrAt(index);
}
- FX_INT32 GetLineEnd() const
+ int32_t GetLineEnd() const
{
return m_iStart + m_iWidth;
}
@@ -58,8 +58,8 @@ public: {
CFX_RTFChar *pChar;
IFX_Unknown *pUnknown;
- FX_INT32 iCount = m_LineChars.GetSize();
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCount = m_LineChars.GetSize();
+ for (int32_t i = 0; i < iCount; i ++) {
pChar = m_LineChars.GetDataPtr(i);
if ((pUnknown = pChar->m_pUserData) != NULL) {
pUnknown->Release();
@@ -73,10 +73,10 @@ public: }
CFX_RTFCharArray m_LineChars;
CFX_RTFPieceArray m_LinePieces;
- FX_INT32 m_iStart;
- FX_INT32 m_iWidth;
- FX_INT32 m_iArabicChars;
- FX_INT32 m_iMBCSChars;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
+ int32_t m_iMBCSChars;
};
class CFX_RTFBreak : public IFX_RTFBreak
{
@@ -103,75 +103,75 @@ public: virtual void SetDefaultChar(FX_WCHAR wch);
virtual void SetLineBreakChar(FX_WCHAR wch);
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void SetHorizontalScale(FX_INT32 iScale);
- virtual void SetVerticalScale(FX_INT32 iScale);
- virtual void SetCharRotation(FX_INT32 iCharRotation);
+ virtual void SetHorizontalScale(int32_t iScale);
+ virtual void SetVerticalScale(int32_t iScale);
+ virtual void SetCharRotation(int32_t iCharRotation);
virtual void SetCharSpace(FX_FLOAT fCharSpace);
virtual void SetWordSpace(FX_BOOL bDefault, FX_FLOAT fWordSpace);
virtual void SetReadingOrder(FX_BOOL bRTL = FALSE);
- virtual void SetAlignment(FX_INT32 iAlignment = FX_RTFLINEALIGNMENT_Left);
+ virtual void SetAlignment(int32_t iAlignment = FX_RTFLINEALIGNMENT_Left);
virtual void SetUserData(IFX_Unknown *pUserData);
virtual FX_DWORD AppendChar(FX_WCHAR wch);
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_RTFBREAK_PieceBreak);
- virtual FX_INT32 CountBreakPieces() const;
- virtual const CFX_RTFPiece* GetBreakPiece(FX_INT32 index) const;
+ virtual int32_t CountBreakPieces() const;
+ virtual const CFX_RTFPiece* GetBreakPiece(int32_t index) const;
virtual void GetLineRect(CFX_RectF &rect) const;
virtual void ClearBreakPieces();
virtual void Reset();
- virtual FX_INT32 GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
- virtual FX_INT32 GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
+ virtual int32_t GetDisplayPos(FX_LPCRTFTEXTOBJ pText, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ virtual int32_t GetCharRects(FX_LPCRTFTEXTOBJ pText, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
FX_DWORD AppendChar_CharCode(FX_WCHAR wch);
- FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, FX_INT32 iRotation);
+ FX_DWORD AppendChar_Combination(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_RTFChar *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_RTFChar *pCurChar, int32_t iRotation);
protected:
FX_DWORD m_dwPolicies;
IFX_ArabicChar *m_pArabicChar;
- FX_INT32 m_iLineStart;
- FX_INT32 m_iLineEnd;
+ int32_t m_iLineStart;
+ int32_t m_iLineEnd;
FX_DWORD m_dwLayoutStyles;
FX_BOOL m_bPagination;
FX_BOOL m_bVertical;
FX_BOOL m_bSingleLine;
FX_BOOL m_bCharCode;
IFX_Font *m_pFont;
- FX_INT32 m_iFontHeight;
- FX_INT32 m_iFontSize;
- FX_INT32 m_iTabWidth;
+ int32_t m_iFontHeight;
+ int32_t m_iFontSize;
+ int32_t m_iTabWidth;
CFX_Int32Array m_PositionedTabs;
FX_BOOL m_bOrphanLine;
FX_WCHAR m_wDefChar;
- FX_INT32 m_iDefChar;
+ int32_t m_iDefChar;
FX_WCHAR m_wLineBreakChar;
- FX_INT32 m_iHorizontalScale;
- FX_INT32 m_iVerticalScale;
- FX_INT32 m_iLineRotation;
- FX_INT32 m_iCharRotation;
- FX_INT32 m_iRotation;
- FX_INT32 m_iCharSpace;
+ int32_t m_iHorizontalScale;
+ int32_t m_iVerticalScale;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iCharSpace;
FX_BOOL m_bWordSpace;
- FX_INT32 m_iWordSpace;
+ int32_t m_iWordSpace;
FX_BOOL m_bRTL;
- FX_INT32 m_iAlignment;
+ int32_t m_iAlignment;
IFX_Unknown *m_pUserData;
FX_DWORD m_dwCharType;
FX_DWORD m_dwIdentity;
CFX_RTFLine m_RTFLine1;
CFX_RTFLine m_RTFLine2;
CFX_RTFLine *m_pCurLine;
- FX_INT32 m_iReady;
- FX_INT32 m_iTolerance;
- FX_INT32 GetLineRotation(FX_DWORD dwStyles) const;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
void SetBreakStatus();
- CFX_RTFChar* GetLastChar(FX_INT32 index) const;
+ CFX_RTFChar* GetLastChar(int32_t index) const;
CFX_RTFLine* GetRTFLine(FX_BOOL bReady) const;
CFX_RTFPieceArray* GetRTFPieces(FX_BOOL bReady) const;
FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
- FX_INT32 GetLastPositionedTab() const;
- FX_BOOL GetPositionedTab(FX_INT32 &iTabPos) const;
- FX_INT32 GetBreakPos(CFX_RTFCharArray &tca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
+ int32_t GetLastPositionedTab() const;
+ FX_BOOL GetPositionedTab(int32_t &iTabPos) const;
+ int32_t GetBreakPos(CFX_RTFCharArray &tca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
void SplitTextLine(CFX_RTFLine *pCurLine, CFX_RTFLine *pNextLine, FX_BOOL bAllChars = FALSE);
FX_BOOL EndBreak_SplitLine(CFX_RTFLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus);
void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus);
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.cpp b/xfa/src/fgas/src/layout/fx_textbreak.cpp index 0bb7b69585..80d56c7191 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.cpp +++ b/xfa/src/fgas/src/layout/fx_textbreak.cpp @@ -78,7 +78,7 @@ void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) }
void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos)
{
- FX_INT32 iLinePos = FXSYS_round(fLinePos * 20000.0f);
+ int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f);
if (iLinePos < 0) {
iLinePos = 0;
}
@@ -120,7 +120,7 @@ void CFX_TxtBreak::SetFont(IFX_Font *pFont) }
void CFX_TxtBreak::SetFontSize(FX_FLOAT fFontSize)
{
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
if (m_iFontSize == iFontSize) {
return;
}
@@ -164,7 +164,7 @@ void CFX_TxtBreak::SetLineBreakTolerance(FX_FLOAT fTolerance) {
m_iTolerance = FXSYS_round(fTolerance * 20000.0f);
}
-void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation)
+void CFX_TxtBreak::SetCharRotation(int32_t iCharRotation)
{
if (iCharRotation < 0) {
iCharRotation += (-iCharRotation / 4 + 1) * 4;
@@ -179,7 +179,7 @@ void CFX_TxtBreak::SetCharRotation(FX_INT32 iCharRotation) m_iRotation = m_iLineRotation + m_iCharRotation;
m_iRotation %= 4;
}
-void CFX_TxtBreak::SetAlignment(FX_INT32 iAlignment)
+void CFX_TxtBreak::SetAlignment(int32_t iAlignment)
{
FXSYS_assert(iAlignment >= FX_TXTLINEALIGNMENT_Left && iAlignment <= FX_TXTLINEALIGNMENT_Distributed);
m_iAlignment = iAlignment;
@@ -229,7 +229,7 @@ void CFX_TxtBreak::SetBreakStatus() if (m_bPagination) {
return;
}
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 1) {
return;
}
@@ -238,7 +238,7 @@ void CFX_TxtBreak::SetBreakStatus() pTC->m_dwStatus = FX_TXTBREAK_PieceBreak;
}
}
-void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale)
+void CFX_TxtBreak::SetHorizontalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -249,7 +249,7 @@ void CFX_TxtBreak::SetHorizontalScale(FX_INT32 iScale) SetBreakStatus();
m_iHorScale = iScale;
}
-void CFX_TxtBreak::SetVerticalScale(FX_INT32 iScale)
+void CFX_TxtBreak::SetVerticalScale(int32_t iScale)
{
if (iScale < 0) {
iScale = 0;
@@ -264,20 +264,20 @@ void CFX_TxtBreak::SetCharSpace(FX_FLOAT fCharSpace) {
m_iCharSpace = FXSYS_round(fCharSpace * 20000.0f);
}
-static const FX_INT32 gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
-FX_INT32 CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const
+static const int32_t gs_FX_TxtLineRotations[8] = {0, 3, 1, 0, 2, 1, 3, 2};
+int32_t CFX_TxtBreak::GetLineRotation(FX_DWORD dwStyles) const
{
return gs_FX_TxtLineRotations[(dwStyles & 0x0E) >> 1];
}
-CFX_TxtChar* CFX_TxtBreak::GetLastChar(FX_INT32 index, FX_BOOL bOmitChar) const
+CFX_TxtChar* CFX_TxtBreak::GetLastChar(int32_t index, FX_BOOL bOmitChar) const
{
CFX_TxtCharArray &ca = *m_pCurLine->m_pLineChars;
- FX_INT32 iCount = ca.GetSize();
+ int32_t iCount = ca.GetSize();
if (index < 0 || index >= iCount) {
return NULL;
}
CFX_TxtChar *pTC;
- FX_INT32 iStart = iCount - 1;
+ int32_t iStart = iCount - 1;
while (iStart > -1) {
pTC = ca.GetDataPtr(iStart --);
if (bOmitChar && pTC->GetCharType() == FX_CHARTYPE_Combination) {
@@ -346,8 +346,8 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) ((CFX_TxtChar*)pCurChar)->m_pUserData = m_pUserData;
}
if (m_bArabicContext || m_bArabicShapes) {
- FX_INT32 iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
- FX_INT32 iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1);
+ int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
+ int32_t iArabicContext = (iBidiCls == FX_BIDICLASS_R || iBidiCls == FX_BIDICLASS_AL) ? 2 : ((iBidiCls == FX_BIDICLASS_L || iBidiCls == FX_BIDICLASS_S) ? 0 : 1);
if (iArabicContext != m_iArabicContext && iArabicContext != 1) {
m_iArabicContext = iArabicContext;
if (m_iCurArabicContext == 1) {
@@ -364,12 +364,12 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps) }
pCurChar->m_dwCharStyles = m_dwContextCharStyles;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation)
{
FXSYS_assert(pCurChar != NULL);
FX_WCHAR wch = pCurChar->m_wCharCode;
FX_WCHAR wForm;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
CFX_Char *pLastChar;
pCurChar->m_iCharWidth = -1;
if (m_bCombText) {
@@ -412,14 +412,14 @@ FX_DWORD CFX_TxtBreak::AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRota pCurChar->m_iCharWidth = -iCharWidth;
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation)
{
m_dwCharType = FX_CHARTYPE_Tab;
if ((m_dwLayoutStyles & FX_TXTLAYOUTSTYLE_ExpandTab) == 0) {
return FX_TXTBREAK_None;
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth;
if (m_bCombText) {
iCharWidth = m_iCombWidth;
} else {
@@ -440,7 +440,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation)
{
m_dwCharType = FX_CHARTYPE_Control;
FX_DWORD dwRet = FX_TXTBREAK_None;
@@ -469,12 +469,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation }
return dwRet;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation)
{
FX_DWORD dwType = (pCurChar->m_dwCharProps & FX_CHARTYPEBITSMASK);
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
FX_WCHAR wForm;
- FX_INT32 iCharWidth = 0;
+ int32_t iCharWidth = 0;
CFX_Char *pLastChar = NULL;
FX_BOOL bAlef = FALSE;
if (!m_bCombText && m_dwCharType >= FX_CHARTYPE_ArabicAlef && m_dwCharType <= FX_CHARTYPE_ArabicDistortion) {
@@ -487,7 +487,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) CFX_Char *pPrevChar = GetLastChar(2);
wForm = m_pArabicChar->GetFormChar(pLastChar, pPrevChar, pCurChar);
bAlef = (wForm == 0xFEFF && pLastChar->GetCharType() == FX_CHARTYPE_ArabicAlef);
- FX_INT32 iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
+ int32_t iLastRotation = pLastChar->m_nRotation + m_iLineRotation;
if (m_bVertical && (pLastChar->m_dwCharProps & 0x8000) != 0) {
iLastRotation ++;
}
@@ -530,12 +530,12 @@ FX_DWORD CFX_TxtBreak::AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation)
+FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation)
{
FX_DWORD dwProps = pCurChar->m_dwCharProps;
FX_DWORD dwType = (dwProps & FX_CHARTYPEBITSMASK);
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
- FX_INT32 iCharWidth = 0;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t iCharWidth = 0;
m_dwCharType = dwType;
FX_WCHAR wch = pCurChar->m_wCharCode;
FX_WCHAR wForm = wch;
@@ -572,7 +572,7 @@ FX_DWORD CFX_TxtBreak::AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation) }
return FX_TXTBREAK_None;
}
-typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, FX_INT32 iRotation);
+typedef FX_DWORD (CFX_TxtBreak::*FX_TxtBreak_LPFAppendChar)(CFX_Char *pCurChar, int32_t iRotation);
static const FX_TxtBreak_LPFAppendChar g_FX_TxtBreak_lpfAppendChar[16] = {
&CFX_TxtBreak::AppendChar_Others,
&CFX_TxtBreak::AppendChar_Tab,
@@ -615,14 +615,14 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) if (m_dwCharType > 0 && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance && !m_bSingleLine) {
if (m_dwCharType != FX_CHARTYPE_Space || dwType != FX_CHARTYPE_Control) {
dwRet1 = EndBreak(FX_TXTBREAK_LineBreak);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount > 0) {
pCurChar = m_pCurLine->m_pLineChars->GetDataPtr(iCount - 1);
}
}
}
}
- FX_INT32 iRotation = m_iRotation;
+ int32_t iRotation = m_iRotation;
if (m_bVertical && (dwProps & 0x8000) != 0) {
iRotation = (iRotation + 1) % 4;
}
@@ -632,18 +632,18 @@ FX_DWORD CFX_TxtBreak::AppendChar(FX_WCHAR wch) void CFX_TxtBreak::EndBreak_UpdateArabicShapes()
{
FXSYS_assert(m_bArabicShapes);
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 &iLineWidth = m_pCurLine->m_iWidth;
+ int32_t &iLineWidth = m_pCurLine->m_iWidth;
CFX_Char *pCur, *pNext;
pCur = m_pCurLine->GetCharPtr(0);
FX_BOOL bPrevNum = (pCur->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicIndic) != 0;
pCur = m_pCurLine->GetCharPtr(1);
FX_WCHAR wch, wForm;
FX_BOOL bNextNum;
- FX_INT32 i = 1, iCharWidth, iRotation;
+ int32_t i = 1, iCharWidth, iRotation;
do {
i ++;
if (i < iCount) {
@@ -683,7 +683,7 @@ void CFX_TxtBreak::EndBreak_UpdateArabicShapes() }
FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = FALSE;
CFX_Char *pTC;
if (!m_bSingleLine && m_pCurLine->m_iWidth > m_iLineWidth + m_iTolerance) {
@@ -725,7 +725,7 @@ FX_BOOL CFX_TxtBreak::EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllCha return TRUE;
}
if (bAllChars && !bDone) {
- FX_INT32 iEndPos = m_pCurLine->m_iWidth;
+ int32_t iEndPos = m_pCurLine->m_iWidth;
GetBreakPos(*m_pCurLine->m_pLineChars, iEndPos, bAllChars, TRUE);
}
return FALSE;
@@ -735,12 +735,12 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) CFX_TxtPiece tp;
FX_TPO tpo;
CFX_TxtChar *pTC;
- FX_INT32 i, j;
+ int32_t i, j;
CFX_TxtCharArray &chars = *m_pCurLine->m_pLineChars;
- FX_INT32 iCount = m_pCurLine->CountChars();
+ int32_t iCount = m_pCurLine->CountChars();
FX_BOOL bDone = (m_pCurLine->m_iArabicChars > 0 || m_bCurRTL);
if (!m_bPagination && bDone) {
- FX_INT32 iBidiNum = 0;
+ int32_t iBidiNum = 0;
for (i = 0; i < iCount; i ++) {
pTC = chars.GetDataPtr(i);
pTC->m_iBidiPos = i;
@@ -758,7 +758,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) tp.m_dwStatus = FX_TXTBREAK_PieceBreak;
tp.m_iStartPos = m_pCurLine->m_iStart;
tp.m_pChars = m_pCurLine->m_pLineChars;
- FX_INT32 iBidiLevel = -1, iCharWidth;
+ int32_t iBidiLevel = -1, iCharWidth;
i = 0, j = -1;
while (i < iCount) {
pTC = chars.GetDataPtr(i);
@@ -809,7 +809,7 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) if (j > -1) {
if (j > 0) {
FX_TEXTLAYOUT_PieceSort(tpos, 0, j);
- FX_INT32 iStartPos = 0;
+ int32_t iStartPos = 0;
for (i = 0; i <= j; i ++) {
tpo = tpos.GetAt(i);
CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -840,9 +840,9 @@ void CFX_TxtBreak::EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus) }
void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus)
{
- FX_INT32 iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
+ int32_t iNetWidth = m_pCurLine->m_iWidth, iGapChars = 0, iCharWidth;
CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces;
- FX_INT32 i, j, iCount = pCurPieces->GetSize();
+ int32_t i, j, iCount = pCurPieces->GetSize();
FX_BOOL bFind = FALSE;
FX_TPO tpo;
CFX_TxtChar *pTC;
@@ -882,11 +882,11 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ break;
}
}
- FX_INT32 iOffset = m_iLineWidth - iNetWidth;
- FX_INT32 iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask);
- FX_INT32 iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask);
+ int32_t iOffset = m_iLineWidth - iNetWidth;
+ int32_t iLowerAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_LowerMask);
+ int32_t iHigherAlignment = (m_iCurAlignment & FX_TXTLINEALIGNMENT_HigherMask);
if (iGapChars > 0 && (iHigherAlignment == FX_TXTLINEALIGNMENT_Distributed || (iHigherAlignment == FX_TXTLINEALIGNMENT_Justified && dwStatus != FX_TXTBREAK_ParagraphBreak))) {
- FX_INT32 iStart = -1;
+ int32_t iStart = -1;
for (i = 0; i < iCount; i ++) {
tpo = tpos.GetAt(i);
CFX_TxtPiece &ttp = pCurPieces->GetAt(tpo.index);
@@ -895,7 +895,7 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_ } else {
ttp.m_iStartPos = iStart;
}
- FX_INT32 k;
+ int32_t k;
for (j = 0; j < ttp.m_iChars; j ++) {
pTC = ttp.GetCharPtr(j);
if (pTC->m_nBreakType != FX_LBT_DIRECT_BRK || pTC->m_iCharWidth < 0) {
@@ -928,7 +928,7 @@ FX_DWORD CFX_TxtBreak::EndBreak(FX_DWORD dwStatus) {
FXSYS_assert(dwStatus >= FX_TXTBREAK_PieceBreak && dwStatus <= FX_TXTBREAK_PageBreak);
CFX_TxtPieceArray *pCurPieces = m_pCurLine->m_pLinePieces;
- FX_INT32 iCount = pCurPieces->GetSize();
+ int32_t iCount = pCurPieces->GetSize();
if (iCount > 0) {
CFX_TxtPiece *pLastPiece = pCurPieces->GetPtrAt(-- iCount);
if (dwStatus > FX_TXTBREAK_PieceBreak) {
@@ -990,13 +990,13 @@ EndBreak_Ret: }
return dwStatus;
}
-FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
+int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars, FX_BOOL bOnlyBrk)
{
- FX_INT32 iLength = ca.GetSize() - 1;
+ int32_t iLength = ca.GetSize() - 1;
if (iLength < 1) {
return iLength;
}
- FX_INT32 iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
+ int32_t iBreak = -1, iBreakPos = -1, iIndirect = -1, iIndirectPos = -1, iLast = -1, iLastPos = -1;
if (m_bSingleLine || iEndPos <= m_iLineWidth) {
if (!bAllChars) {
return iLength;
@@ -1014,7 +1014,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B }
nCodeProp = pCur->m_dwCharProps;
nNext = nCodeProp & 0x003F;
- FX_INT32 iCharWidth = pCur->m_iCharWidth;
+ int32_t iCharWidth = pCur->m_iCharWidth;
if (iCharWidth > 0) {
iEndPos -= iCharWidth;
}
@@ -1038,7 +1038,7 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B }
}
if (bAllChars) {
- pCur->m_nBreakType = (FX_BYTE)eType;
+ pCur->m_nBreakType = (uint8_t)eType;
}
if (!bOnlyBrk) {
if (m_bSingleLine || iEndPos <= m_iLineWidth || (nCur == FX_CBP_SP && !bSpaceBreak)) {
@@ -1085,13 +1085,13 @@ FX_INT32 CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_B void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars)
{
FXSYS_assert(pCurLine != NULL && pNextLine != NULL);
- FX_INT32 iCount = pCurLine->CountChars();
+ int32_t iCount = pCurLine->CountChars();
if (iCount < 2) {
return;
}
- FX_INT32 iEndPos = pCurLine->m_iWidth;
+ int32_t iEndPos = pCurLine->m_iWidth;
CFX_TxtCharArray &curChars = *pCurLine->m_pLineChars;
- FX_INT32 iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
+ int32_t iCharPos = GetBreakPos(curChars, iEndPos, bAllChars, FALSE);
if (iCharPos < 0) {
iCharPos = 0;
}
@@ -1113,8 +1113,8 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, CFX_TxtChar *pTC = curChars.GetDataPtr(iCharPos - 1);
pTC->m_nBreakType = FX_LBT_UNKNOWN;
iCount = nextChars.GetSize();
- FX_INT32 iCharWidth, iWidth = 0;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ int32_t iCharWidth, iWidth = 0;
+ for (int32_t i = 0; i < iCount; i ++) {
pTC = nextChars.GetDataPtr(i);
if (pTC->GetCharType() >= FX_CHARTYPE_ArabicAlef) {
pCurLine->m_iArabicChars --;
@@ -1131,12 +1131,12 @@ void CFX_TxtBreak::SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, }
pNextLine->m_iWidth = iWidth;
}
-FX_INT32 CFX_TxtBreak::CountBreakChars() const
+int32_t CFX_TxtBreak::CountBreakChars() const
{
CFX_TxtLine *pTxtLine = GetTxtLine(TRUE);
return pTxtLine == NULL ? 0 : pTxtLine->CountChars();
}
-FX_INT32 CFX_TxtBreak::CountBreakPieces() const
+int32_t CFX_TxtBreak::CountBreakPieces() const
{
CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE);
if (pTxtPieces == NULL) {
@@ -1144,7 +1144,7 @@ FX_INT32 CFX_TxtBreak::CountBreakPieces() const }
return pTxtPieces->GetSize();
}
-const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(FX_INT32 index) const
+const CFX_TxtPiece* CFX_TxtBreak::GetBreakPiece(int32_t index) const
{
CFX_TxtPieceArray *pTxtPieces = GetTxtPieces(TRUE);
if (pTxtPieces == NULL) {
@@ -1174,10 +1174,10 @@ void CFX_TxtBreak::Reset() typedef struct _FX_FORMCHAR {
FX_WORD wch;
FX_WORD wForm;
- FX_INT32 iWidth;
+ int32_t iWidth;
} FX_FORMCHAR, * FX_LPFORMCHAR;
typedef FX_FORMCHAR const * FX_LPCFORMCHAR;
-FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
+int32_t CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode , CFX_WideString *pWSForms , FX_AdjustCharDisplayPos pAdjustPos ) const
{
if (pTxtRun == NULL || pTxtRun->iLength < 1) {
return 0;
@@ -1185,8 +1185,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar IFX_TxtAccess *pAccess = pTxtRun->pAccess;
FX_LPVOID pIdentity = pTxtRun->pIdentity;
FX_LPCWSTR pStr = pTxtRun->pStr;
- FX_INT32 *pWidths = pTxtRun->pWidths;
- FX_INT32 iLength = pTxtRun->iLength - 1;
+ int32_t *pWidths = pTxtRun->pWidths;
+ int32_t iLength = pTxtRun->iLength - 1;
IFX_Font *pFont = pTxtRun->pFont;
FX_DWORD dwStyles = pTxtRun->dwStyles;
CFX_RectF rtText(*pTxtRun->pRect);
@@ -1194,22 +1194,22 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar FX_BOOL bArabicNumber = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicNumber) != 0;
FX_BOOL bArabicComma = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_ArabicComma) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
- FX_INT32 iAscent = pFont->GetAscent();
- FX_INT32 iDescent = pFont->GetDescent();
- FX_INT32 iMaxHeight = iAscent - iDescent;
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iAscent = pFont->GetAscent();
+ int32_t iDescent = pFont->GetDescent();
+ int32_t iMaxHeight = iAscent - iDescent;
FX_FLOAT fFontHeight = fFontSize;
FX_FLOAT fAscent = fFontHeight * (FX_FLOAT)iAscent / (FX_FLOAT)iMaxHeight;
FX_FLOAT fDescent = fFontHeight * (FX_FLOAT)iDescent / (FX_FLOAT)iMaxHeight;
FX_BOOL bVerticalDoc = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalLayout) != 0;
FX_BOOL bVerticalChar = (dwStyles & FX_TXTLAYOUTSTYLE_VerticalChars) != 0;
- FX_INT32 iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation;
- FX_INT32 iCharRotation;
+ int32_t iRotation = GetLineRotation(dwStyles) + pTxtRun->iCharRotation;
+ int32_t iCharRotation;
FX_WCHAR wch, wPrev = 0xFEFF, wNext, wForm, wLast = 0xFEFF;
- FX_INT32 iWidth, iCharWidth, iCharHeight;
+ int32_t iWidth, iCharWidth, iCharHeight;
FX_FLOAT fX, fY, fCharWidth, fCharHeight;
- FX_INT32 iHorScale = pTxtRun->iHorizontalScale;
- FX_INT32 iVerScale = pTxtRun->iVerticalScale;
+ int32_t iHorScale = pTxtRun->iHorizontalScale;
+ int32_t iVerScale = pTxtRun->iVerticalScale;
FX_BOOL bSkipSpace = pTxtRun->bSkipSpace;
FX_BOOL bEmptyChar, bShadda = FALSE, bLam = FALSE;
FX_DWORD dwProps, dwCharType;
@@ -1227,8 +1227,8 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar fYBase = rtText.top + (rtText.height - fFontSize) / 2.0f;
fY = fYBase + fAscent;
}
- FX_INT32 iCount = 0, iNext, iForms;
- for (FX_INT32 i = 0; i <= iLength; i ++) {
+ int32_t iCount = 0, iNext, iForms;
+ for (int32_t i = 0; i <= iLength; i ++) {
if (pAccess != NULL) {
wch = pAccess->GetChar(pIdentity, i);
iWidth = pAccess->GetWidth(pIdentity, i);
@@ -1259,7 +1259,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar wNext = 0xFEFF;
}
} else {
- FX_INT32 j = -1;
+ int32_t j = -1;
do {
j ++;
if (i + j >= iLength) {
@@ -1386,7 +1386,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pFont->GetCharWidth(0x0670, iCharWidth, FALSE);
formChars[2].iWidth = iCharWidth;
}
- for (FX_INT32 j = 0; j < iForms; j ++) {
+ for (int32_t j = 0; j < iForms; j ++) {
wForm = (FX_WCHAR)formChars[j].wForm;
iCharWidth = formChars[j].iWidth;
if (j > 0) {
@@ -1421,7 +1421,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar pCharPos->m_OriginX = fX;
pCharPos->m_OriginY = fY;
if ((dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0) {
- FX_INT32 iFormWidth = iCharWidth;
+ int32_t iFormWidth = iCharWidth;
pFont->GetCharWidth(wForm, iFormWidth, FALSE);
FX_FLOAT fOffset = fFontSize * (iCharWidth - iFormWidth) / 2000.0f;
if (bVerticalDoc) {
@@ -1544,7 +1544,7 @@ FX_INT32 CFX_TxtBreak::GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pChar }
return iCount;
}
-FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
+int32_t CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox ) const
{
if (pTxtRun == NULL || pTxtRun->iLength < 1) {
return 0;
@@ -1552,12 +1552,12 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra IFX_TxtAccess *pAccess = pTxtRun->pAccess;
FX_LPVOID pIdentity = pTxtRun->pIdentity;
FX_LPCWSTR pStr = pTxtRun->pStr;
- FX_INT32 *pWidths = pTxtRun->pWidths;
- FX_INT32 iLength = pTxtRun->iLength;
+ int32_t *pWidths = pTxtRun->pWidths;
+ int32_t iLength = pTxtRun->iLength;
CFX_RectF rect(*pTxtRun->pRect);
FX_BOOL bRTLPiece = (pTxtRun->dwCharStyles & FX_TXTCHARSTYLE_OddBidiLevel) != 0;
FX_FLOAT fFontSize = pTxtRun->fFontSize;
- FX_INT32 iFontSize = FXSYS_round(fFontSize * 20.0f);
+ int32_t iFontSize = FXSYS_round(fFontSize * 20.0f);
FX_FLOAT fScale = fFontSize / 1000.0f;
IFX_Font *pFont = pTxtRun->pFont;
if (pFont == NULL) {
@@ -1576,14 +1576,14 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra FX_BOOL bSingleLine = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_SingleLine) != 0;
FX_BOOL bCombText = (pTxtRun->dwStyles & FX_TXTLAYOUTSTYLE_CombText) != 0;
FX_WCHAR wch, wLineBreakChar = pTxtRun->wLineBreakChar;
- FX_INT32 iCharSize;
+ int32_t iCharSize;
FX_FLOAT fCharSize, fStart;
if (bVertical) {
fStart = bRTLPiece ? rect.bottom() : rect.top;
} else {
fStart = bRTLPiece ? rect.right() : rect.left;
}
- for (FX_INT32 i = 0; i < iLength; i ++) {
+ for (int32_t i = 0; i < iLength; i ++) {
if (pAccess != NULL) {
wch = pAccess->GetChar(pIdentity, i);
iCharSize = pAccess->GetWidth(pIdentity, i);
@@ -1620,7 +1620,7 @@ FX_INT32 CFX_TxtBreak::GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArra rect.width = fCharSize;
}
if (bCharBBox && !bRet) {
- FX_INT32 iCharWidth = 1000;
+ int32_t iCharWidth = 1000;
pFont->GetCharWidth(wch, iCharWidth);
FX_FLOAT fRTLeft = 0, fCharWidth = 0;
if (iCharWidth > 0) {
diff --git a/xfa/src/fgas/src/layout/fx_textbreak.h b/xfa/src/fgas/src/layout/fx_textbreak.h index a80b16c1b3..c38fc0b1ba 100644 --- a/xfa/src/fgas/src/layout/fx_textbreak.h +++ b/xfa/src/fgas/src/layout/fx_textbreak.h @@ -11,7 +11,7 @@ class CFX_Txtbreak; class CFX_TxtLine
{
public:
- CFX_TxtLine(FX_INT32 iBlockSize) : m_iStart(0)
+ CFX_TxtLine(int32_t iBlockSize) : m_iStart(0)
, m_iWidth(0)
, m_iArabicChars(0)
{
@@ -24,30 +24,30 @@ public: delete m_pLineChars;
FXTARGET_Delete m_pLinePieces;
}
- FX_INT32 CountChars() const
+ int32_t CountChars() const
{
return m_pLineChars->GetSize();
}
- CFX_TxtChar* GetCharPtr(FX_INT32 index) const
+ CFX_TxtChar* GetCharPtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_pLineChars->GetSize());
return m_pLineChars->GetDataPtr(index);
}
- FX_INT32 CountPieces() const
+ int32_t CountPieces() const
{
return m_pLinePieces->GetSize();
}
- CFX_TxtPiece* GetPiecePtr(FX_INT32 index) const
+ CFX_TxtPiece* GetPiecePtr(int32_t index) const
{
FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize());
return m_pLinePieces->GetPtrAt(index);
}
void GetString(CFX_WideString &wsStr) const
{
- FX_INT32 iCount = m_pLineChars->GetSize();
+ int32_t iCount = m_pLineChars->GetSize();
FX_LPWSTR pBuf = wsStr.GetBuffer(iCount);
CFX_Char *pChar;
- for (FX_INT32 i = 0; i < iCount; i ++) {
+ for (int32_t i = 0; i < iCount; i ++) {
pChar = m_pLineChars->GetDataPtr(i);
*pBuf ++ = (FX_WCHAR)pChar->m_wCharCode;
}
@@ -62,9 +62,9 @@ public: }
CFX_TxtCharArray *m_pLineChars;
CFX_TxtPieceArray *m_pLinePieces;
- FX_INT32 m_iStart;
- FX_INT32 m_iWidth;
- FX_INT32 m_iArabicChars;
+ int32_t m_iStart;
+ int32_t m_iWidth;
+ int32_t m_iArabicChars;
};
class CFX_TxtBreak : public IFX_TxtBreak
{
@@ -88,35 +88,35 @@ public: virtual void SetDefaultChar(FX_WCHAR wch);
virtual void SetParagraphBreakChar(FX_WCHAR wch);
virtual void SetLineBreakTolerance(FX_FLOAT fTolerance);
- virtual void SetHorizontalScale(FX_INT32 iScale);
- virtual void SetVerticalScale(FX_INT32 iScale);
- virtual void SetCharRotation(FX_INT32 iCharRotation);
+ virtual void SetHorizontalScale(int32_t iScale);
+ virtual void SetVerticalScale(int32_t iScale);
+ virtual void SetCharRotation(int32_t iCharRotation);
virtual void SetCharSpace(FX_FLOAT fCharSpace);
- virtual void SetAlignment(FX_INT32 iAlignment);
+ virtual void SetAlignment(int32_t iAlignment);
virtual FX_DWORD GetContextCharStyles() const;
virtual void SetContextCharStyles(FX_DWORD dwCharStyles);
virtual void SetCombWidth(FX_FLOAT fCombWidth);
virtual void SetUserData(FX_LPVOID pUserData);
virtual FX_DWORD AppendChar(FX_WCHAR wch);
virtual FX_DWORD EndBreak(FX_DWORD dwStatus = FX_TXTBREAK_PieceBreak);
- virtual FX_INT32 CountBreakChars() const;
- virtual FX_INT32 CountBreakPieces() const;
- virtual const CFX_TxtPiece* GetBreakPiece(FX_INT32 index) const;
+ virtual int32_t CountBreakChars() const;
+ virtual int32_t CountBreakPieces() const;
+ virtual const CFX_TxtPiece* GetBreakPiece(int32_t index) const;
virtual void ClearBreakPieces();
virtual void Reset();
- virtual FX_INT32 GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
- virtual FX_INT32 GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
+ virtual int32_t GetDisplayPos(FX_LPCTXTRUN pTxtRun, FXTEXT_CHARPOS *pCharPos, FX_BOOL bCharCode = FALSE, CFX_WideString *pWSForms = NULL, FX_AdjustCharDisplayPos pAdjustPos = NULL) const;
+ virtual int32_t GetCharRects(FX_LPCTXTRUN pTxtRun, CFX_RectFArray &rtArray, FX_BOOL bCharBBox = FALSE) const;
void AppendChar_PageLoad(CFX_Char *pCurChar, FX_DWORD dwProps);
- FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Control(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, FX_INT32 iRotation);
- FX_DWORD AppendChar_Others(CFX_Char *pCurChar, FX_INT32 iRotation);
+ FX_DWORD AppendChar_Combination(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Tab(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Control(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Arabic(CFX_Char *pCurChar, int32_t iRotation);
+ FX_DWORD AppendChar_Others(CFX_Char *pCurChar, int32_t iRotation);
protected:
FX_DWORD m_dwPolicies;
FX_BOOL m_bPagination;
IFX_ArabicChar *m_pArabicChar;
- FX_INT32 m_iLineWidth;
+ int32_t m_iLineWidth;
FX_DWORD m_dwLayoutStyles;
FX_BOOL m_bVertical;
FX_BOOL m_bArabicContext;
@@ -124,38 +124,38 @@ protected: FX_BOOL m_bRTL;
FX_BOOL m_bSingleLine;
FX_BOOL m_bCombText;
- FX_INT32 m_iArabicContext;
- FX_INT32 m_iCurArabicContext;
+ int32_t m_iArabicContext;
+ int32_t m_iCurArabicContext;
IFX_Font *m_pFont;
- FX_INT32 m_iFontSize;
+ int32_t m_iFontSize;
FX_BOOL m_bEquidistant;
- FX_INT32 m_iTabWidth;
+ int32_t m_iTabWidth;
FX_WCHAR m_wDefChar;
FX_WCHAR m_wParagBreakChar;
- FX_INT32 m_iDefChar;
- FX_INT32 m_iLineRotation;
- FX_INT32 m_iCharRotation;
- FX_INT32 m_iRotation;
- FX_INT32 m_iAlignment;
+ int32_t m_iDefChar;
+ int32_t m_iLineRotation;
+ int32_t m_iCharRotation;
+ int32_t m_iRotation;
+ int32_t m_iAlignment;
FX_DWORD m_dwContextCharStyles;
- FX_INT32 m_iCombWidth;
+ int32_t m_iCombWidth;
FX_LPVOID m_pUserData;
FX_DWORD m_dwCharType;
FX_BOOL m_bCurRTL;
- FX_INT32 m_iCurAlignment;
+ int32_t m_iCurAlignment;
FX_BOOL m_bArabicNumber;
FX_BOOL m_bArabicComma;
CFX_TxtLine *m_pTxtLine1;
CFX_TxtLine *m_pTxtLine2;
CFX_TxtLine *m_pCurLine;
- FX_INT32 m_iReady;
- FX_INT32 m_iTolerance;
- FX_INT32 m_iHorScale;
- FX_INT32 m_iVerScale;
- FX_INT32 m_iCharSpace;
+ int32_t m_iReady;
+ int32_t m_iTolerance;
+ int32_t m_iHorScale;
+ int32_t m_iVerScale;
+ int32_t m_iCharSpace;
void SetBreakStatus();
- FX_INT32 GetLineRotation(FX_DWORD dwStyles) const;
- CFX_TxtChar* GetLastChar(FX_INT32 index, FX_BOOL bOmitChar = TRUE) const;
+ int32_t GetLineRotation(FX_DWORD dwStyles) const;
+ CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const;
CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const;
CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const;
FX_DWORD GetUnifiedCharType(FX_DWORD dwType) const;
@@ -165,7 +165,7 @@ protected: FX_BOOL EndBreak_SplitLine(CFX_TxtLine *pNextLine, FX_BOOL bAllChars, FX_DWORD dwStatus);
void EndBreak_BidiLine(CFX_TPOArray &tpos, FX_DWORD dwStatus);
void EndBreak_Alignment(CFX_TPOArray &tpos, FX_BOOL bAllChars, FX_DWORD dwStatus);
- FX_INT32 GetBreakPos(CFX_TxtCharArray &ca, FX_INT32 &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
+ int32_t GetBreakPos(CFX_TxtCharArray &ca, int32_t &iEndPos, FX_BOOL bAllChars = FALSE, FX_BOOL bOnlyBrk = FALSE);
void SplitTextLine(CFX_TxtLine *pCurLine, CFX_TxtLine *pNextLine, FX_BOOL bAllChars = FALSE);
};
#endif
diff --git a/xfa/src/fgas/src/layout/fx_unicode.cpp b/xfa/src/fgas/src/layout/fx_unicode.cpp index def5d707f5..b93990551c 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.cpp +++ b/xfa/src/fgas/src/layout/fx_unicode.cpp @@ -6,16 +6,16 @@ #include "../fgas_base.h"
#include "fx_unicode.h"
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd)
+void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd)
{
FXSYS_assert(iStart > -1 && iStart < tpos.GetSize());
FXSYS_assert(iEnd > -1 && iEnd < tpos.GetSize());
if (iStart >= iEnd) {
return;
}
- FX_INT32 i = iStart, j = iEnd;
+ int32_t i = iStart, j = iEnd;
FX_TPO *pCur = tpos.GetPtrAt(iStart), *pSort;
- FX_INT32 v = pCur->pos;
+ int32_t v = pCur->pos;
while (i < j) {
while (j > i) {
pSort = tpos.GetPtrAt(j);
@@ -95,10 +95,10 @@ static const FX_JAPCHARPROPERTYEX gs_FX_JapCharPropertysEx[] = { };
FX_LPCJAPCHARPROPERTYEX FX_GetJapCharPropertyEx(FX_WCHAR wch)
{
- FX_INT32 iStart = 0;
- FX_INT32 iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX);
+ int32_t iStart = 0;
+ int32_t iEnd = sizeof(gs_FX_JapCharPropertysEx) / sizeof(FX_JAPCHARPROPERTYEX);
while (iStart <= iEnd) {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FX_WCHAR wJapChar = gs_FX_JapCharPropertysEx[iMid].wChar;
if (wch == wJapChar) {
return gs_FX_JapCharPropertysEx + iMid;
diff --git a/xfa/src/fgas/src/layout/fx_unicode.h b/xfa/src/fgas/src/layout/fx_unicode.h index 5eadb5506f..08f9528347 100644 --- a/xfa/src/fgas/src/layout/fx_unicode.h +++ b/xfa/src/fgas/src/layout/fx_unicode.h @@ -7,9 +7,9 @@ #ifndef _FGAS_UNICODE_IMP
#define _FGAS_UNICODE_IMP
typedef struct _FX_TPO {
- FX_INT32 index;
- FX_INT32 pos;
+ int32_t index;
+ int32_t pos;
} FX_TPO;
typedef CFX_MassArrayTemplate<FX_TPO> CFX_TPOArray;
-void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, FX_INT32 iStart, FX_INT32 iEnd);
+void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray &tpos, int32_t iStart, int32_t iEnd);
#endif
diff --git a/xfa/src/fgas/src/localization/fx_datetime.cpp b/xfa/src/fgas/src/localization/fx_datetime.cpp index 7c2b3d3540..9a1da457d9 100644 --- a/xfa/src/fgas/src/localization/fx_datetime.cpp +++ b/xfa/src/fgas/src/localization/fx_datetime.cpp @@ -5,56 +5,56 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../fgas_base.h"
-const FX_BYTE g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-const FX_BYTE g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-const FX_INT32 g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-const FX_INT32 g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
-const FX_INT32 g_FXDaysPerYear = 365;
-const FX_INT32 g_FXDaysPerLeapYear = 366;
-const FX_INT32 g_FXDaysPer4Years = 1461;
-const FX_INT32 g_FXDaysPer100Years = 36524;
-const FX_INT32 g_FXDaysPer400Years = 146097;
-const FX_INT64 g_FXMillisecondsPerSecond = 1000;
-const FX_INT64 g_FXMillisecondsPerMinute = 60000;
-const FX_INT64 g_FXMillisecondsPerHour = 3600000;
-const FX_INT64 g_FXMillisecondsPerDay = 86400000;
+const uint8_t g_FXDaysPerMonth[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+const uint8_t g_FXDaysPerLeapMonth[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+const int32_t g_FXDaysBeforeMonth[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
+const int32_t g_FXDaysBeforeLeapMonth[12] = {0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
+const int32_t g_FXDaysPerYear = 365;
+const int32_t g_FXDaysPerLeapYear = 366;
+const int32_t g_FXDaysPer4Years = 1461;
+const int32_t g_FXDaysPer100Years = 36524;
+const int32_t g_FXDaysPer400Years = 146097;
+const int64_t g_FXMillisecondsPerSecond = 1000;
+const int64_t g_FXMillisecondsPerMinute = 60000;
+const int64_t g_FXMillisecondsPerHour = 3600000;
+const int64_t g_FXMillisecondsPerDay = 86400000;
#if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || _FX_OS_ == _FX_WIN64_
-const FX_INT64 g_FXMillisecondsPerYear = 0x0757B12C00;
-const FX_INT64 g_FXMillisecondsPerLeapYear = 0x075CD78800;
-const FX_INT64 g_FXMillisecondsPer4Years = 0x1D63EB0C00;
-const FX_INT64 g_FXMillisecondsPer100Years = 0x02DEBCCDD000;
-const FX_INT64 g_FXMillisecondsPer400Years = 0x0B7AF85D9C00;
+const int64_t g_FXMillisecondsPerYear = 0x0757B12C00;
+const int64_t g_FXMillisecondsPerLeapYear = 0x075CD78800;
+const int64_t g_FXMillisecondsPer4Years = 0x1D63EB0C00;
+const int64_t g_FXMillisecondsPer100Years = 0x02DEBCCDD000;
+const int64_t g_FXMillisecondsPer400Years = 0x0B7AF85D9C00;
#endif
-FX_BOOL FX_IsLeapYear(FX_INT32 iYear)
+FX_BOOL FX_IsLeapYear(int32_t iYear)
{
FXSYS_assert(iYear != 0);
return ((iYear % 4) == 0 && (iYear % 100) != 0) || (iYear % 400) == 0;
}
-FX_INT32 FX_DaysInYear(FX_INT32 iYear)
+int32_t FX_DaysInYear(int32_t iYear)
{
FXSYS_assert(iYear != 0);
return FX_IsLeapYear(iYear) ? g_FXDaysPerLeapYear : g_FXDaysPerYear;
}
-FX_BYTE FX_DaysInMonth(FX_INT32 iYear, FX_BYTE iMonth)
+uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
- const FX_BYTE *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth;
+ const uint8_t *p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth;
return p[iMonth - 1];
}
-static FX_INT32 FX_DaysBeforeMonthInYear(FX_INT32 iYear, FX_BYTE iMonth)
+static int32_t FX_DaysBeforeMonthInYear(int32_t iYear, uint8_t iMonth)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
- const FX_INT32 *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth;
+ const int32_t *p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth;
return p[iMonth - 1];
}
-static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_BOOL bIncludeThisDay = FALSE)
+static int64_t FX_DateToDays(int32_t iYear, uint8_t iMonth, uint8_t iDay, FX_BOOL bIncludeThisDay = FALSE)
{
FXSYS_assert(iYear != 0);
FXSYS_assert(iMonth >= 1 && iMonth <= 12);
FXSYS_assert(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth));
- FX_INT64 iDays = FX_DaysBeforeMonthInYear(iYear, iMonth);
+ int64_t iDays = FX_DaysBeforeMonthInYear(iYear, iMonth);
iDays += iDay;
if (!bIncludeThisDay) {
iDays --;
@@ -65,9 +65,9 @@ static FX_INT64 FX_DateToDays(FX_INT32 iYear, FX_BYTE iMonth, FX_BYTE iDay, FX_B iDays -= FX_DaysInYear(iYear);
iYear ++;
}
- return iDays + (FX_INT64)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400;
+ return iDays + (int64_t)iYear * 365 + iYear / 4 - iYear / 100 + iYear / 400;
}
-static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_BYTE &iDay)
+static void FX_DaysToDate(int64_t iDays, int32_t &iYear, uint8_t &iMonth, uint8_t &iDay)
{
FX_BOOL bBC = iDays < 0;
if (bBC) {
@@ -77,7 +77,7 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iMonth = 1;
iDay = 1;
if (iDays >= g_FXDaysPer400Years) {
- iYear += (FX_INT32)(iDays / g_FXDaysPer400Years * 400);
+ iYear += (int32_t)(iDays / g_FXDaysPer400Years * 400);
iDays %= g_FXDaysPer400Years;
}
if (iDays >= g_FXDaysPer100Years) {
@@ -85,16 +85,16 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iYear += 300;
iDays -= g_FXDaysPer100Years * 3;
} else {
- iYear += (FX_INT32)(iDays / g_FXDaysPer100Years * 100);
+ iYear += (int32_t)(iDays / g_FXDaysPer100Years * 100);
iDays %= g_FXDaysPer100Years;
}
}
if (iDays >= g_FXDaysPer4Years) {
- iYear += (FX_INT32)(iDays / g_FXDaysPer4Years * 4);
+ iYear += (int32_t)(iDays / g_FXDaysPer4Years * 4);
iDays %= g_FXDaysPer4Years;
}
while (TRUE) {
- FX_INT32 iYearDays = FX_DaysInYear(iYear);
+ int32_t iYearDays = FX_DaysInYear(iYear);
if (iDays < iYearDays) {
if (bBC) {
iYear = -iYear;
@@ -106,14 +106,14 @@ static void FX_DaysToDate(FX_INT64 iDays, FX_INT32 &iYear, FX_BYTE &iMonth, FX_B iDays -= iYearDays;
}
while (TRUE) {
- FX_INT32 iMonthDays = FX_DaysInMonth(iYear, iMonth);
+ int32_t iMonthDays = FX_DaysInMonth(iYear, iMonth);
if (iDays < iMonthDays) {
break;
}
iMonth ++;
iDays -= iMonthDays;
}
- iDay += (FX_BYTE)iDays;
+ iDay += (uint8_t)iDays;
}
#if _FX_OS_ == _FX_LINUX_DESKTOP_ || _FX_OS_ == _FX_ANDROID_ || _FX_OS_ == _FX_MACOSX_ || _FX_OS_ == _FX_IOS_
#include <time.h>
@@ -153,8 +153,8 @@ void CFX_Unitime::Now() utLocal.wSecond = st.tm_sec;
utLocal.wMilliseconds = curTime.tv_usec / 1000;
#endif
- Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay,
- (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
+ Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay,
+ (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
}
void CFX_Unitime::SetGMTime()
{
@@ -180,16 +180,16 @@ void CFX_Unitime::SetGMTime() utLocal.wSecond = st.tm_sec;
utLocal.wMilliseconds = curTime.tv_usec / 1000;
#endif
- Set(utLocal.wYear, (FX_BYTE)utLocal.wMonth, (FX_BYTE)utLocal.wDay,
- (FX_BYTE)utLocal.wHour, (FX_BYTE)utLocal.wMinute, (FX_BYTE)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
+ Set(utLocal.wYear, (uint8_t)utLocal.wMonth, (uint8_t)utLocal.wDay,
+ (uint8_t)utLocal.wHour, (uint8_t)utLocal.wMinute, (uint8_t)utLocal.wSecond, (FX_WORD)utLocal.wMilliseconds);
}
-void CFX_Unitime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond)
+void CFX_Unitime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond)
{
FXSYS_assert(hour <= 23);
FXSYS_assert(minute <= 59);
FXSYS_assert(second <= 59);
FXSYS_assert(millisecond <= 999);
- m_iUnitime = (FX_INT64)hour * g_FXMillisecondsPerHour + (FX_INT64)minute * g_FXMillisecondsPerMinute + (FX_INT64)second * g_FXMillisecondsPerSecond + millisecond;
+ m_iUnitime = (int64_t)hour * g_FXMillisecondsPerHour + (int64_t)minute * g_FXMillisecondsPerMinute + (int64_t)second * g_FXMillisecondsPerSecond + millisecond;
if (year > 0) {
m_iUnitime = m_iUnitime + FX_DateToDays(year, month, day, FALSE) * g_FXMillisecondsPerDay;
}
@@ -198,30 +198,30 @@ void CFX_Unitime::Set(FX_UNITIME t) {
m_iUnitime = t;
}
-FX_INT32 CFX_Unitime::GetYear() const
+int32_t CFX_Unitime::GetYear() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iYear;
}
-FX_BYTE CFX_Unitime::GetMonth() const
+uint8_t CFX_Unitime::GetMonth() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iMonth;
}
-FX_BYTE CFX_Unitime::GetDay() const
+uint8_t CFX_Unitime::GetDay() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return iDay;
}
FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const
{
- FX_INT32 v = (FX_INT32)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7);
+ int32_t v = (int32_t)((m_iUnitime / g_FXMillisecondsPerDay + 1) % 7);
if (v < 0) {
v += 7;
}
@@ -229,62 +229,62 @@ FX_WEEKDAY CFX_Unitime::GetDayOfWeek() const }
FX_WORD CFX_Unitime::GetDayOfYear() const
{
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
return FX_DaysBeforeMonthInYear(iYear, iMonth) + iDay;
}
-FX_INT64 CFX_Unitime::GetDayOfAD() const
+int64_t CFX_Unitime::GetDayOfAD() const
{
FX_BOOL bBC = m_iUnitime < 0;
- FX_INT64 iDays = m_iUnitime / g_FXMillisecondsPerDay;
+ int64_t iDays = m_iUnitime / g_FXMillisecondsPerDay;
iDays += bBC ? -1 : 0;
if (bBC && (m_iUnitime % g_FXMillisecondsPerDay) == 0) {
iDays ++;
}
return iDays;
}
-FX_BYTE CFX_Unitime::GetHour() const
+uint8_t CFX_Unitime::GetHour() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerDay);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerDay);
if (v < 0) {
v += g_FXMillisecondsPerDay;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerHour);
+ return (uint8_t)(v / g_FXMillisecondsPerHour);
}
-FX_BYTE CFX_Unitime::GetMinute() const
+uint8_t CFX_Unitime::GetMinute() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerHour);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerHour);
if (v < 0) {
v += g_FXMillisecondsPerHour;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerMinute);
+ return (uint8_t)(v / g_FXMillisecondsPerMinute);
}
-FX_BYTE CFX_Unitime::GetSecond() const
+uint8_t CFX_Unitime::GetSecond() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerMinute);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerMinute);
if (v < 0) {
v += g_FXMillisecondsPerMinute;
}
- return (FX_BYTE)(v / g_FXMillisecondsPerSecond);
+ return (uint8_t)(v / g_FXMillisecondsPerSecond);
}
FX_WORD CFX_Unitime::GetMillisecond() const
{
- FX_INT32 v = (FX_INT32)(m_iUnitime % g_FXMillisecondsPerSecond);
+ int32_t v = (int32_t)(m_iUnitime % g_FXMillisecondsPerSecond);
if (v < 0) {
v += g_FXMillisecondsPerSecond;
}
return (FX_WORD)v;
}
-FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears)
+FX_BOOL CFX_Unitime::AddYears(int32_t iYears)
{
FX_UNITIME ut = m_iUnitime;
if (ut < 0) {
ut = -ut;
}
FX_UNITIME r = ut % g_FXMillisecondsPerDay;
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
iYear += iYears;
if (iYear == 0) {
@@ -294,7 +294,7 @@ FX_BOOL CFX_Unitime::AddYears(FX_INT32 iYears) m_iUnitime += (iYear < 0) ? -r : r;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths)
+FX_BOOL CFX_Unitime::AddMonths(int32_t iMonths)
{
FX_BOOL b = iMonths > 0;
FX_UNITIME ut = m_iUnitime;
@@ -302,8 +302,8 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) ut = -ut;
}
FX_UNITIME r = ut % g_FXMillisecondsPerDay;
- FX_INT32 iYear;
- FX_BYTE iMonth, iDay;
+ int32_t iYear;
+ uint8_t iMonth, iDay;
FX_DaysToDate(GetDayOfAD(), iYear, iMonth, iDay);
iMonths += iMonth;
while (iMonths < 1) {
@@ -315,36 +315,36 @@ FX_BOOL CFX_Unitime::AddMonths(FX_INT32 iMonths) if (iYear == 0) {
iYear = b ? 1 : -1;
}
- m_iUnitime = FX_DateToDays(iYear, (FX_BYTE)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay;
+ m_iUnitime = FX_DateToDays(iYear, (uint8_t)iMonths, iDay, FALSE) * g_FXMillisecondsPerDay;
m_iUnitime += (iYear < 0) ? -r : r;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddDays(FX_INT32 iDays)
+FX_BOOL CFX_Unitime::AddDays(int32_t iDays)
{
- m_iUnitime += (FX_INT64)iDays * g_FXMillisecondsPerDay;
+ m_iUnitime += (int64_t)iDays * g_FXMillisecondsPerDay;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddHours(FX_INT32 iHours)
+FX_BOOL CFX_Unitime::AddHours(int32_t iHours)
{
- m_iUnitime += (FX_INT64)iHours * g_FXMillisecondsPerHour;
+ m_iUnitime += (int64_t)iHours * g_FXMillisecondsPerHour;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMinutes(FX_INT32 iMinutes)
+FX_BOOL CFX_Unitime::AddMinutes(int32_t iMinutes)
{
- m_iUnitime += (FX_INT64)iMinutes * g_FXMillisecondsPerMinute;
+ m_iUnitime += (int64_t)iMinutes * g_FXMillisecondsPerMinute;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddSeconds(FX_INT32 iSeconds)
+FX_BOOL CFX_Unitime::AddSeconds(int32_t iSeconds)
{
- m_iUnitime += ((FX_INT64)iSeconds) * g_FXMillisecondsPerSecond;
+ m_iUnitime += ((int64_t)iSeconds) * g_FXMillisecondsPerSecond;
return TRUE;
}
-FX_BOOL CFX_Unitime::AddMilliseconds(FX_INT32 iMilliseconds)
+FX_BOOL CFX_Unitime::AddMilliseconds(int32_t iMilliseconds)
{
m_iUnitime += iMilliseconds;
return TRUE;
}
-FX_BOOL CFX_DateTime::Set(FX_INT32 year, FX_BYTE month, FX_BYTE day, FX_BYTE hour, FX_BYTE minute, FX_BYTE second, FX_WORD millisecond)
+FX_BOOL CFX_DateTime::Set(int32_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t minute, uint8_t second, FX_WORD millisecond)
{
ASSERT(year != 0);
ASSERT(month >= 1 && month <= 12);
@@ -374,25 +374,25 @@ FX_BOOL CFX_DateTime::FromUnitime(FX_UNITIME t) }
FX_UNITIME CFX_DateTime::ToUnitime() const
{
- FX_UNITIME v = (FX_INT64)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (FX_INT64)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (FX_INT64)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond + m_DateTime.Time.sTime.millisecond;
+ FX_UNITIME v = (int64_t)m_DateTime.Date.sDate.day * g_FXMillisecondsPerHour + (int64_t)m_DateTime.Time.sTime.minute * g_FXMillisecondsPerMinute + (int64_t)m_DateTime.Time.sTime.second * g_FXMillisecondsPerSecond + m_DateTime.Time.sTime.millisecond;
v += FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, FALSE) * g_FXMillisecondsPerDay;
return v;
}
-FX_INT32 CFX_DateTime::GetYear() const
+int32_t CFX_DateTime::GetYear() const
{
return m_DateTime.Date.sDate.year;
}
-FX_BYTE CFX_DateTime::GetMonth() const
+uint8_t CFX_DateTime::GetMonth() const
{
return m_DateTime.Date.sDate.month;
}
-FX_BYTE CFX_DateTime::GetDay() const
+uint8_t CFX_DateTime::GetDay() const
{
return m_DateTime.Date.sDate.day;
}
FX_WEEKDAY CFX_DateTime::GetDayOfWeek() const
{
- FX_INT32 v = (FX_INT32)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7);
+ int32_t v = (int32_t)(FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE) % 7);
if (v < 0) {
v += 7;
}
@@ -402,19 +402,19 @@ FX_WORD CFX_DateTime::GetDayOfYear() const {
return FX_DaysBeforeMonthInYear(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month) + m_DateTime.Date.sDate.day;
}
-FX_INT64 CFX_DateTime::GetDayOfAD() const
+int64_t CFX_DateTime::GetDayOfAD() const
{
return FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
}
-FX_BYTE CFX_DateTime::GetHour() const
+uint8_t CFX_DateTime::GetHour() const
{
return m_DateTime.Date.sDate.day;
}
-FX_BYTE CFX_DateTime::GetMinute() const
+uint8_t CFX_DateTime::GetMinute() const
{
return m_DateTime.Time.sTime.minute;
}
-FX_BYTE CFX_DateTime::GetSecond() const
+uint8_t CFX_DateTime::GetSecond() const
{
return m_DateTime.Time.sTime.second;
}
@@ -422,12 +422,12 @@ FX_WORD CFX_DateTime::GetMillisecond() const {
return m_DateTime.Time.sTime.millisecond;
}
-FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears)
+FX_BOOL CFX_DateTime::AddYears(int32_t iYears)
{
if (iYears == 0) {
return FALSE;
}
- FX_INT32 v = m_DateTime.Date.sDate.year + iYears;
+ int32_t v = m_DateTime.Date.sDate.year + iYears;
if (v >= 0 && m_DateTime.Date.sDate.year < 0) {
v ++;
} else if (v <= 0 && m_DateTime.Date.sDate.year > 0) {
@@ -436,7 +436,7 @@ FX_BOOL CFX_DateTime::AddYears(FX_INT32 iYears) m_DateTime.Date.sDate.year = v;
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths)
+FX_BOOL CFX_DateTime::AddMonths(int32_t iMonths)
{
if (iMonths == 0) {
return FALSE;
@@ -460,16 +460,16 @@ FX_BOOL CFX_DateTime::AddMonths(FX_INT32 iMonths) if (m_DateTime.Date.sDate.year == 0) {
m_DateTime.Date.sDate.year = b ? 1 : -1;
}
- m_DateTime.Date.sDate.month = (FX_BYTE)iMonths;
+ m_DateTime.Date.sDate.month = (uint8_t)iMonths;
return TRUE;
}
-FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays)
+FX_BOOL CFX_DateTime::AddDays(int32_t iDays)
{
if (iDays == 0) {
return FALSE;
}
- FX_INT64 v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
- FX_INT64 v2 = v1 + iDays;
+ int64_t v1 = FX_DateToDays(m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day, TRUE);
+ int64_t v2 = v1 + iDays;
if (v2 <= 0 && v1 > 0) {
v2 --;
} else if (v2 >= 0 && v1 < 0) {
@@ -478,64 +478,64 @@ FX_BOOL CFX_DateTime::AddDays(FX_INT32 iDays) FX_DaysToDate(v2, m_DateTime.Date.sDate.year, m_DateTime.Date.sDate.month, m_DateTime.Date.sDate.day);
return TRUE;
}
-FX_BOOL CFX_DateTime::AddHours(FX_INT32 iHours)
+FX_BOOL CFX_DateTime::AddHours(int32_t iHours)
{
if (iHours == 0) {
return FALSE;
}
iHours += m_DateTime.Date.sDate.day;
- FX_INT32 iDays = iHours / 24;
+ int32_t iDays = iHours / 24;
iHours %= 24;
if (iHours < 0) {
iDays --, iHours += 24;
}
- m_DateTime.Date.sDate.day = (FX_BYTE)iHours;
+ m_DateTime.Date.sDate.day = (uint8_t)iHours;
if (iDays != 0) {
AddDays(iDays);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMinutes(FX_INT32 iMinutes)
+FX_BOOL CFX_DateTime::AddMinutes(int32_t iMinutes)
{
if (iMinutes == 0) {
return FALSE;
}
iMinutes += m_DateTime.Time.sTime.minute;
- FX_INT32 iHours = iMinutes / 60;
+ int32_t iHours = iMinutes / 60;
iMinutes %= 60;
if (iMinutes < 0) {
iHours --, iMinutes += 60;
}
- m_DateTime.Time.sTime.minute = (FX_BYTE)iMinutes;
+ m_DateTime.Time.sTime.minute = (uint8_t)iMinutes;
if (iHours != 0) {
AddHours(iHours);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddSeconds(FX_INT32 iSeconds)
+FX_BOOL CFX_DateTime::AddSeconds(int32_t iSeconds)
{
if (iSeconds == 0) {
return FALSE;
}
iSeconds += m_DateTime.Time.sTime.second;
- FX_INT32 iMinutes = iSeconds / 60;
+ int32_t iMinutes = iSeconds / 60;
iSeconds %= 60;
if (iSeconds < 0) {
iMinutes --, iSeconds += 60;
}
- m_DateTime.Time.sTime.second = (FX_BYTE)iSeconds;
+ m_DateTime.Time.sTime.second = (uint8_t)iSeconds;
if (iMinutes != 0) {
AddMinutes(iMinutes);
}
return TRUE;
}
-FX_BOOL CFX_DateTime::AddMilliseconds(FX_INT32 iMilliseconds)
+FX_BOOL CFX_DateTime::AddMilliseconds(int32_t iMilliseconds)
{
if (iMilliseconds == 0) {
return FALSE;
}
iMilliseconds += m_DateTime.Time.sTime.millisecond;
- FX_INT32 iSeconds = (FX_INT32)(iMilliseconds / g_FXMillisecondsPerSecond);
+ int32_t iSeconds = (int32_t)(iMilliseconds / g_FXMillisecondsPerSecond);
iMilliseconds %= g_FXMillisecondsPerSecond;
if (iMilliseconds < 0) {
iSeconds --, iMilliseconds += g_FXMillisecondsPerSecond;
diff --git a/xfa/src/fgas/src/localization/fx_locale.cpp b/xfa/src/fgas/src/localization/fx_locale.cpp index 4998201871..4f046df119 100644 --- a/xfa/src/fgas/src/localization/fx_locale.cpp +++ b/xfa/src/fgas/src/localization/fx_locale.cpp @@ -14,9 +14,9 @@ #define FX_LOCALECATEGORY_ZeroHash 0x568cb500
#define FX_LOCALECATEGORY_NullHash 0x052931bb
typedef struct _FX_LOCALESUBCATEGORYINFO {
- FX_UINT32 uHash;
+ uint32_t uHash;
FX_LPCWSTR pName;
- FX_INT32 eSubCategory;
+ int32_t eSubCategory;
} FX_LOCALESUBCATEGORYINFO, * FX_LPLOCALESUBCATEGORYINFO;
typedef FX_LOCALESUBCATEGORYINFO const * FX_LPCLOCALESUBCATEGORYINFO;
const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = {
@@ -26,18 +26,18 @@ const static FX_LOCALESUBCATEGORYINFO g_FXLocaleDateTimeSubCatData[] = { {0xcdce56b3, L"full", FX_LOCALEDATETIMESUBCATEGORY_Full},
{0xf6b4afb0, L"long", FX_LOCALEDATETIMESUBCATEGORY_Long},
};
-const static FX_INT32 g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
+const static int32_t g_iFXLocaleDateTimeSubCatCount = sizeof(g_FXLocaleDateTimeSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
const static FX_LOCALESUBCATEGORYINFO g_FXLocaleNumSubCatData[] = {
{0x46f95531, L"percent", FX_LOCALENUMPATTERN_Percent},
{0x4c4e8acb, L"currency", FX_LOCALENUMPATTERN_Currency},
{0x54034c2f, L"decimal", FX_LOCALENUMPATTERN_Decimal},
{0x7568e6ae, L"integer", FX_LOCALENUMPATTERN_Integer},
};
-const static FX_INT32 g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
+const static int32_t g_iFXLocaleNumSubCatCount = sizeof(g_FXLocaleNumSubCatData) / sizeof(FX_LOCALESUBCATEGORYINFO);
typedef struct _FX_LOCALETIMEZONEINFO {
FX_DWORD uHash;
- FX_INT16 iHour;
- FX_INT16 iMinute;
+ int16_t iHour;
+ int16_t iMinute;
} FX_LOCALETIMEZONEINFO, * FX_LPLOCALETIMEZONEINFO;
typedef FX_LOCALETIMEZONEINFO const * FX_LPCLOCALETIMEZONEINFO;
const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = {
@@ -46,7 +46,7 @@ const static FX_LOCALETIMEZONEINFO g_FXLocaleTimeZoneData[] = { {FXBSTR_ID(0, 'M', 'D', 'T'), -6, 0}, {FXBSTR_ID(0, 'M', 'S', 'T'), -7, 0},
{FXBSTR_ID(0, 'P', 'D', 'T'), -7, 0}, {FXBSTR_ID(0, 'P', 'S', 'T'), -8, 0},
};
-const static FX_INT32 g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO);
+const static int32_t g_iFXLocaleTimeZoneCount = sizeof(g_FXLocaleTimeZoneData) / sizeof(FX_LOCALETIMEZONEINFO);
const static CFX_WideStringC gs_wsTextSymbols = FX_WSTRC(L"AXO09");
const static CFX_WideStringC gs_wsTimeSymbols = FX_WSTRC(L"hHkKMSFAzZ");
const static CFX_WideStringC gs_wsDateSymbols = FX_WSTRC(L"DJMEeGgYwW");
@@ -82,8 +82,8 @@ CFX_WideString CFX_Locale::GetName() static CFX_WideString FX_GetXMLContent(FX_BSTR bsSpace, CXML_Element* pxmlElement, FX_BSTR bsTag, FX_WSTR wsName)
{
CXML_Element* pDatePattern = NULL;
- FX_INT32 nCount = pxmlElement->CountElements(bsSpace, bsTag);
- FX_INT32 i = 0;
+ int32_t nCount = pxmlElement->CountElements(bsSpace, bsTag);
+ int32_t i = 0;
for (; i < nCount; i++) {
pDatePattern = pxmlElement->GetElement(bsSpace, bsTag, i);
if (pDatePattern->GetAttrValue(FX_BSTRC("name")) == wsName) {
@@ -120,7 +120,7 @@ void CFX_Locale::GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const }
wsDtSymbol = pNumberSymbols->GetContent(0);
}
-static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, FX_INT32 index, FX_BOOL bAbbr, CFX_WideString &wsName)
+static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString &symbol_type, int32_t index, FX_BOOL bAbbr, CFX_WideString &wsName)
{
CFX_ByteString bsSpace;
CFX_ByteString pstrSymbolNames = symbol_type + FX_BSTRC("Names");
@@ -142,14 +142,14 @@ static void FX_GetCalendarSymbol(CXML_Element* pXmlElement, const CFX_ByteString }
}
}
-void CFX_Locale::GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
+void CFX_Locale::GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr ) const
{
if (!m_pElement) {
return;
}
FX_GetCalendarSymbol(m_pElement, "month", nMonth, bAbbr, wsMonthName);
}
-void CFX_Locale::GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
+void CFX_Locale::GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr ) const
{
if (!m_pElement) {
return;
@@ -163,15 +163,15 @@ void CFX_Locale::GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM ) c }
FX_GetCalendarSymbol(m_pElement, "meridiem", bAM ? 0 : 1, FALSE, wsMeridiemName);
}
-static FX_INT32 FX_ParseTimeZone(FX_LPCWSTR pStr, FX_INT32 iLen, FX_TIMEZONE& tz)
+static int32_t FX_ParseTimeZone(FX_LPCWSTR pStr, int32_t iLen, FX_TIMEZONE& tz)
{
tz.tzHour = 0;
tz.tzMinute = 0;
if (iLen < 0) {
return 0;
}
- FX_INT32 iStart = 1;
- FX_INT32 iEnd = iStart + 2;
+ int32_t iStart = 1;
+ int32_t iEnd = iStart + 2;
while (iStart < iLen && iStart < iEnd) {
tz.tzHour = tz.tzHour * 10 + pStr[iStart++] - '0';
}
@@ -255,12 +255,12 @@ static FX_BOOL FX_IsSpace(FX_WCHAR c) static const FX_FLOAT gs_fraction_scales[] = {0.1f, 0.01f, 0.001f, 0.0001f, 0.00001f, 0.000001f,
0.0000001f, 0.00000001f, 0.000000001f, 0.0000000001f, 0.00000000001f
};
-static const FX_INT32 gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT);
+static const int32_t gs_fraction_count = sizeof(gs_fraction_scales) / sizeof(FX_FLOAT);
class CFX_LCNumeric
{
public:
CFX_LCNumeric();
- CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional = 0, FX_INT32 exponent = 0);
+ CFX_LCNumeric(int64_t integral, FX_DWORD fractional = 0, int32_t exponent = 0);
CFX_LCNumeric(FX_FLOAT dbRetValue);
CFX_LCNumeric(double dbvalue);
CFX_LCNumeric(CFX_WideString& wsNumeric);
@@ -268,19 +268,19 @@ public: FX_FLOAT GetFloat() const;
double GetDouble() const;
CFX_WideString ToString() const;
- CFX_WideString ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const;
- FX_INT64 m_Integral;
+ CFX_WideString ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const;
+ int64_t m_Integral;
FX_DWORD m_Fractional;
#ifdef FX_NUM_DOUBLE
CFX_WideString m_wsValue;
#endif
- FX_INT32 m_Exponent;
+ int32_t m_Exponent;
};
static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& lcnum)
{
- FX_INT64 *pIntegral = &lcnum.m_Integral;
+ int64_t *pIntegral = &lcnum.m_Integral;
FX_DWORD *pFractional = &lcnum.m_Fractional;
- FX_INT32 *pExponent = &lcnum.m_Exponent;
+ int32_t *pExponent = &lcnum.m_Exponent;
*pIntegral = 0;
*pFractional = 0;
*pExponent = 0;
@@ -290,11 +290,11 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& if (wsValue.IsEmpty()) {
return FALSE;
}
- const FX_INT32 nIntegralMaxLen = 17;
- FX_INT32 cc = 0;
+ const int32_t nIntegralMaxLen = 17;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)wsValue;
- FX_INT32 len = wsValue.GetLength();
+ int32_t len = wsValue.GetLength();
while (cc < len && FX_IsSpace(str[cc])) {
cc++;
}
@@ -307,7 +307,7 @@ static FX_BOOL FX_WStringToNumeric(const CFX_WideString& wsValue, CFX_LCNumeric& bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.') {
break;
@@ -384,7 +384,7 @@ CFX_LCNumeric::CFX_LCNumeric() m_Fractional = 0;
m_Exponent = 0;
}
-CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 exponent )
+CFX_LCNumeric::CFX_LCNumeric(int64_t integral, FX_DWORD fractional , int32_t exponent )
{
m_Integral = integral;
m_Fractional = fractional;
@@ -392,13 +392,13 @@ CFX_LCNumeric::CFX_LCNumeric(FX_INT64 integral, FX_DWORD fractional , FX_INT32 e }
CFX_LCNumeric::CFX_LCNumeric(FX_FLOAT dbRetValue)
{
- m_Integral = (FX_INT64)dbRetValue;
+ m_Integral = (int64_t)dbRetValue;
m_Fractional = (FX_DWORD)(((dbRetValue > 0) ? (dbRetValue - m_Integral) : (m_Integral - dbRetValue)) * 4294967296);
m_Exponent = 0;
}
CFX_LCNumeric::CFX_LCNumeric(double dbvalue)
{
- m_Integral = (FX_INT64)dbvalue;
+ m_Integral = (int64_t)dbvalue;
m_Fractional = (FX_DWORD)(((dbvalue > 0) ? (dbvalue - m_Integral) : (m_Integral - dbvalue)) * 4294967296);
m_Exponent = 0;
}
@@ -428,16 +428,16 @@ CFX_WideString CFX_LCNumeric::ToString() const {
return ToString(8, TRUE);
}
-CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZeros) const
+CFX_WideString CFX_LCNumeric::ToString(int32_t nTreading, FX_BOOL bTrimTailZeros) const
{
#ifdef FX_NUM_DOUBLE
CFX_WideString wsResult;
if (!m_wsValue.IsEmpty()) {
- const FX_INT32 nIntegralMaxLen = 17;
- FX_INT32 cc = 0;
+ const int32_t nIntegralMaxLen = 17;
+ int32_t cc = 0;
FX_BOOL bNegative = FALSE, bExpSign = FALSE;
FX_LPCWSTR str = (FX_LPCWSTR)m_wsValue;
- FX_INT32 len = m_wsValue.GetLength();
+ int32_t len = m_wsValue.GetLength();
while (cc < len && FX_IsSpace(str[cc])) {
cc++;
}
@@ -450,7 +450,7 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero bNegative = TRUE;
cc++;
}
- FX_INT32 nIntegralLen = 0;
+ int32_t nIntegralLen = 0;
while (cc < len) {
if (str[cc] == '.') {
break;
@@ -497,8 +497,8 @@ CFX_WideString CFX_LCNumeric::ToString(FX_INT32 nTreading, FX_BOOL bTrimTailZero }
}
double dbValeu = GetDouble();
- FX_INT64 iInte = (FX_INT64)dbValeu;
- wsResult.Format(L"%l", (FX_INT64)iInte);
+ int64_t iInte = (int64_t)dbValeu;
+ wsResult.Format(L"%l", (int64_t)iInte);
if (m_Fractional) {
CFX_WideString wsFormat;
wsFormat.Format(L"%%.%dG", nTreading);
@@ -539,7 +539,7 @@ CFX_FormatString::~CFX_FormatString() }
void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, CFX_WideStringArray& wsPatterns)
{
- FX_INT32 iStrLen = wsFormatString.GetLength();
+ int32_t iStrLen = wsFormatString.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsFormatString;
FX_LPCWSTR pToken = pStr;
FX_LPCWSTR pEnd = pStr + iStrLen;
@@ -559,14 +559,14 @@ void CFX_FormatString::SplitFormatString(const CFX_WideString& wsFormatString, C pStr ++;
}
}
-static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern, FX_INT32 iLenPattern)
+static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, int32_t &iPattern, int32_t iLenPattern)
{
CFX_WideString wsOutput;
if (pStrPattern[iPattern] != '\'') {
return wsOutput;
}
iPattern++;
- FX_INT32 iQuote = 1;
+ int32_t iQuote = 1;
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
iQuote++;
@@ -577,9 +577,9 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte }
iPattern++;
} else if (pStrPattern[iPattern] == '\\' && (iPattern + 1 < iLenPattern) && pStrPattern[iPattern + 1] == 'u') {
- FX_INT32 iKeyValue = 0;
+ int32_t iKeyValue = 0;
iPattern += 2;
- FX_INT32 i = 0;
+ int32_t i = 0;
while (iPattern < iLenPattern && i++ < 4) {
FX_WCHAR ch = pStrPattern[iPattern++];
if ((ch >= '0' && ch <= '9')) {
@@ -599,14 +599,14 @@ static CFX_WideString FX_GetLiteralText(FX_LPCWSTR pStrPattern, FX_INT32 &iPatte }
return wsOutput;
}
-static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 &iPattern)
+static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, int32_t &iPattern)
{
CFX_WideString wsOutput;
if (pStrPattern[iPattern] != '\'') {
return wsOutput;
}
iPattern--;
- FX_INT32 iQuote = 1;
+ int32_t iQuote = 1;
while (iPattern >= 0) {
if (pStrPattern[iPattern] == '\'') {
iQuote++;
@@ -618,9 +618,9 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 iPattern--;
} else if (pStrPattern[iPattern] == '\\' && pStrPattern[iPattern + 1] == 'u') {
iPattern--;
- FX_INT32 iKeyValue = 0;
- FX_INT32 iLen = wsOutput.GetLength();
- FX_INT32 i = 1;
+ int32_t iKeyValue = 0;
+ int32_t iLen = wsOutput.GetLength();
+ int32_t i = 1;
for (; i < iLen && i < 5; i++) {
FX_WCHAR ch = wsOutput[i];
if ((ch >= '0' && ch <= '9')) {
@@ -644,8 +644,8 @@ static CFX_WideString FX_GetLiteralTextReverse(FX_LPCWSTR pStrPattern, FX_INT32 FX_LOCALECATEGORY CFX_FormatString::GetCategory(const CFX_WideString& wsPattern)
{
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bBraceOpen = FALSE;
while (ccf < iLenf) {
@@ -711,8 +711,8 @@ FX_WORD CFX_FormatString::GetLCID(const CFX_WideString& wsPattern) }
CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern)
{
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
@@ -732,13 +732,13 @@ CFX_WideString CFX_FormatString::GetLocaleName(const CFX_WideString& wsPattern) IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern)
{
IFX_Locale* pLocale = NULL;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bBrackOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -781,18 +781,18 @@ IFX_Locale* CFX_FormatString::GetTextFormat(const CFX_WideString &wsPattern, FX_ #define FX_NUMSTYLE_Percent 0x01
#define FX_NUMSTYLE_Exponent 0x02
#define FX_NUMSTYLE_DotVorv 0x04
-IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern)
+IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern)
{
dwStyle = 0;
IFX_Locale* pLocale = NULL;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
FX_BOOL bFindDot = FALSE;
FX_BOOL bBrackOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsPurgePattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBrackOpen && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -826,7 +826,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, }
FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
FX_LOCALENUMSUBCATEGORY eSubCategory = FX_LOCALENUMPATTERN_Decimal;
- for (FX_INT32 i = 0; i < g_iFXLocaleNumSubCatCount; i++) {
+ for (int32_t i = 0; i < g_iFXLocaleNumSubCatCount; i++) {
if (g_FXLocaleNumSubCatData[i].uHash == dwSubHash) {
eSubCategory = (FX_LOCALENUMSUBCATEGORY)g_FXLocaleNumSubCatData[i].eSubCategory;
break;
@@ -878,12 +878,12 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, }
return pLocale;
}
-static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, FX_INT32 &iDotIndex)
+static FX_BOOL FX_GetNumericDotIndex(const CFX_WideString& wsNum, const CFX_WideString& wsDotSymbol, int32_t &iDotIndex)
{
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsNum.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsNum.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum;
- FX_INT32 iLenDot = wsDotSymbol.GetLength();
+ int32_t iLenDot = wsDotSymbol.GetLength();
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
FX_GetLiteralText(pStr, ccf, iLenf);
@@ -911,16 +911,16 @@ FX_BOOL CFX_FormatString::ParseText(const CFX_WideString& wsSrcText, const CFX_W if (wsTextFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
switch (pStrPattern[iPattern]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
wsValue = wsSrcText;
return FALSE;
@@ -974,23 +974,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwFormatStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iExponent = 0;
+ int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
- FX_INT32 iDotLen = wsDotSymbol.GetLength();
+ int32_t iDotLen = wsDotSymbol.GetLength();
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_INT32 iGroupLen = wsGroupSymbol.GetLength();
+ int32_t iGroupLen = wsGroupSymbol.GetLength();
CFX_WideString wsMinus;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
- FX_INT32 iMinusLen = wsMinus.GetLength();
+ int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum;
int len = wsSrcNum.GetLength();
@@ -1001,7 +1001,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE;
FX_BOOL bNeg = FALSE;
FX_BOOL bReverseParse = FALSE;
- FX_INT32 dot_index = 0;
+ int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
bReverseParse = TRUE;
}
@@ -1013,7 +1013,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1104,7 +1104,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1168,7 +1168,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1235,7 +1235,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1330,7 +1330,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1394,7 +1394,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1455,7 +1455,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -1546,7 +1546,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
}
@@ -1601,7 +1601,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
cc += iSysmbolLen;
}
@@ -1671,12 +1671,12 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid }
void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult)
{
- FX_INT32 iCount = wsNum.GetLength();
+ int32_t iCount = wsNum.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsNum;
FX_LPWSTR pDst = wsResult.GetBuffer(iCount);
- FX_INT32 nIndex = 0;
+ int32_t nIndex = 0;
FX_BOOL bMinus = FALSE;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (i = 0; i < iCount; i++) {
FX_WCHAR wc = pStr[i];
if (wc == '.') {
@@ -1703,7 +1703,7 @@ void FX_ParseNumString(const CFX_WideString& wsNum, CFX_WideString& wsResult) pDst = wsResult.GetBuffer(iCount + 1);
pDst[nIndex++] = '0';
}
- FX_INT32 j = 0;
+ int32_t j = 0;
for (j = iCount - 1; j > i; j--) {
FX_WCHAR wc = pStr[j];
if (wc != L'0' && wc != L' ') {
@@ -1723,23 +1723,23 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid if (wsSrcNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwFormatStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwFormatStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 iExponent = 0;
+ int32_t iExponent = 0;
CFX_WideString wsDotSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Decimal, wsDotSymbol);
- FX_INT32 iDotLen = wsDotSymbol.GetLength();
+ int32_t iDotLen = wsDotSymbol.GetLength();
CFX_WideString wsGroupSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Grouping, wsGroupSymbol);
- FX_INT32 iGroupLen = wsGroupSymbol.GetLength();
+ int32_t iGroupLen = wsGroupSymbol.GetLength();
CFX_WideString wsMinus;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Minus, wsMinus);
- FX_INT32 iMinusLen = wsMinus.GetLength();
+ int32_t iMinusLen = wsMinus.GetLength();
int cc = 0, ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsSrcNum;
int len = wsSrcNum.GetLength();
@@ -1748,7 +1748,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid FX_BOOL bHavePercentSymbol = FALSE;
FX_BOOL bNeg = FALSE;
FX_BOOL bReverseParse = FALSE;
- FX_INT32 dot_index = 0;
+ int32_t dot_index = 0;
if (!FX_GetNumericDotIndex(wsSrcNum, wsDotSymbol, dot_index) && (dwFormatStyle & FX_NUMSTYLE_DotVorv)) {
bReverseParse = TRUE;
}
@@ -1759,7 +1759,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralTextReverse(strf, ccf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
cc -= iLiteralLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
@@ -1851,7 +1851,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
cc -= iSymbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
@@ -1915,7 +1915,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
cc -= iSysmbolLen - 1;
if (cc < 0 || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
return FALSE;
@@ -1984,7 +1984,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid switch (strf[ccf]) {
case '\'': {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2072,7 +2072,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '$': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_CurrencySymbol, wsSymbol);
- FX_INT32 iSymbolLen = wsSymbol.GetLength();
+ int32_t iSymbolLen = wsSymbol.GetLength();
if (cc + iSymbolLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSymbolLen)) {
return FALSE;
}
@@ -2127,7 +2127,7 @@ FX_BOOL CFX_FormatString::ParseNum(const CFX_WideString& wsSrcNum, const CFX_Wid case '%': {
CFX_WideString wsSymbol;
pLocale->GetNumbericSymbol(FX_LOCALENUMSYMBOL_Percent, wsSymbol);
- FX_INT32 iSysmbolLen = wsSymbol.GetLength();
+ int32_t iSysmbolLen = wsSymbol.GetLength();
if (cc + iSysmbolLen <= len && !FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsSymbol, iSysmbolLen)) {
cc += iSysmbolLen;
}
@@ -2202,14 +2202,14 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt pLocale = NULL;
CFX_WideString wsTempPattern;
FX_LOCALECATEGORY eCategory = FX_LOCALECATEGORY_Unknown;
- FX_INT32 ccf = 0;
- FX_INT32 iLenf = wsPattern.GetLength();
+ int32_t ccf = 0;
+ int32_t iLenf = wsPattern.GetLength();
FX_LPCWSTR pStr = (FX_LPCWSTR)wsPattern;
- FX_INT32 iFindCategory = 0;
+ int32_t iFindCategory = 0;
FX_BOOL bBraceOpen = FALSE;
while (ccf < iLenf) {
if (pStr[ccf] == '\'') {
- FX_INT32 iCurChar = ccf;
+ int32_t iCurChar = ccf;
FX_GetLiteralText(pStr, ccf, iLenf);
wsTempPattern += CFX_WideStringC(pStr + iCurChar, ccf - iCurChar + 1);
} else if (!bBraceOpen && iFindCategory != 3 && FX_Local_Find(gs_wsConstChars, pStr[ccf]) < 0) {
@@ -2262,7 +2262,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt }
FX_DWORD dwSubHash = FX_HashCode_String_GetW(wsSubCategory, wsSubCategory.GetLength());
FX_LOCALEDATETIMESUBCATEGORY eSubCategory = FX_LOCALEDATETIMESUBCATEGORY_Medium;
- for (FX_INT32 i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) {
+ for (int32_t i = 0; i < g_iFXLocaleDateTimeSubCatCount; i++) {
if (g_FXLocaleDateTimeSubCatData[i].uHash == dwSubHash) {
eSubCategory = (FX_LOCALEDATETIMESUBCATEGORY)g_FXLocaleDateTimeSubCatData[i].eSubCategory;
break;
@@ -2325,20 +2325,20 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat(const CFX_WideString& wsPatt }
return (FX_DATETIMETYPE)iFindCategory;
}
-static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, FX_INT32 &cc)
+static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideString& wsDatePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc)
{
- FX_INT32 year = 1900;
- FX_INT32 month = 1;
- FX_INT32 day = 1;
- FX_INT32 ccf = 0;
+ int32_t year = 1900;
+ int32_t month = 1;
+ int32_t day = 1;
+ int32_t ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsDate;
- FX_INT32 len = wsDate.GetLength();
+ int32_t len = wsDate.GetLength();
FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern;
- FX_INT32 lenf = wsDatePattern.GetLength();
+ int32_t lenf = wsDatePattern.GetLength();
while (cc < len && ccf < lenf) {
if (strf[ccf] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2451,7 +2451,7 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt }
} else if (dwSymbol == FXBSTR_ID(0, 0, 'E', '4')) {
CFX_WideString wsDayName;
- FX_INT32 i = 0;
+ int32_t i = 0;
for (; i < 7; i++) {
pLocale->GetDayName(i, wsDayName, FALSE);
if (wsDayName == L"") {
@@ -2513,9 +2513,9 @@ static FX_BOOL FX_ParseLocaleDate(const CFX_WideString& wsDate, const CFX_WideSt datetime = datetime + ut;
return cc;
}
-static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale)
+static void FX_ResolveZone(uint8_t& wHour, uint8_t& wMinute, FX_TIMEZONE tzDiff, IFX_Locale* pLocale)
{
- FX_INT32 iMinuteDiff = wHour * 60 + wMinute;
+ int32_t iMinuteDiff = wHour * 60 + wMinute;
FX_TIMEZONE tzLocale;
pLocale->GetTimeZone(tzLocale);
iMinuteDiff += tzLocale.tzHour * 60 + (tzLocale.tzHour < 0 ? -tzLocale.tzMinute : tzLocale.tzMinute);
@@ -2529,13 +2529,13 @@ static void FX_ResolveZone(FX_BYTE& wHour, FX_BYTE& wMinute, FX_TIMEZONE tzDiff, wHour = iMinuteDiff / 60;
wMinute = iMinuteDiff % 60;
}
-static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideString& wsTimePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, FX_INT32 &cc)
+static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideString& wsTimePattern, IFX_Locale* pLocale, CFX_Unitime &datetime, int32_t &cc)
{
- FX_BYTE hour = 0;
- FX_BYTE minute = 0;
- FX_BYTE second = 0;
+ uint8_t hour = 0;
+ uint8_t minute = 0;
+ uint8_t second = 0;
FX_WORD millisecond = 0;
- FX_INT32 ccf = 0;
+ int32_t ccf = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsTime;
int len = wsTime.GetLength();
FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern;
@@ -2545,7 +2545,7 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt while (cc < len && ccf < lenf) {
if (strf[ccf] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(strf, ccf, lenf);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (cc + iLiteralLen > len || FXSYS_wcsncmp(str + cc, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2675,9 +2675,9 @@ static FX_BOOL FX_ParseLocaleTime(const CFX_WideString& wsTime, const CFX_WideSt FX_ResolveZone(hour, minute, tzDiff, pLocale);
} else {
FX_LPCLOCALETIMEZONEINFO pTimeZoneInfo = NULL;
- FX_INT32 iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1;
+ int32_t iStart = 0, iEnd = g_iFXLocaleTimeZoneCount - 1;
do {
- FX_INT32 iMid = (iStart + iEnd) / 2;
+ int32_t iMid = (iStart + iEnd) / 2;
FX_LPCLOCALETIMEZONEINFO pInfo = g_FXLocaleTimeZoneData + iMid;
if (dwHash == pInfo->uHash) {
pTimeZoneInfo = pInfo;
@@ -2739,7 +2739,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE;
}
if (eCategory == FX_DATETIMETYPE_TimeDate) {
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
if (!FX_ParseLocaleTime(wsSrcDateTime, wsTimePattern, pLocale, dtValue, iStart)) {
return FALSE;
}
@@ -2747,7 +2747,7 @@ FX_BOOL CFX_FormatString::ParseDateTime(const CFX_WideString& wsSrcDateTime, con return FALSE;
}
} else {
- FX_INT32 iStart = 0;
+ int32_t iStart = 0;
if ((eCategory & FX_DATETIMETYPE_Date) && !FX_ParseLocaleDate(wsSrcDateTime, wsDatePattern, pLocale, dtValue, iStart)) {
return FALSE;
}
@@ -2761,15 +2761,15 @@ FX_BOOL CFX_FormatString::ParseZero(const CFX_WideString& wsSrcText, const CFX_W {
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2789,15 +2789,15 @@ FX_BOOL CFX_FormatString::ParseNull(const CFX_WideString& wsSrcText, const CFX_W {
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern && iText < iLenText) {
if (pStrPattern[iPattern] == '\'') {
CFX_WideString wsLiteral = FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
- FX_INT32 iLiteralLen = wsLiteral.GetLength();
+ int32_t iLiteralLen = wsLiteral.GetLength();
if (iText + iLiteralLen > iLenText || FXSYS_wcsncmp(pStrText + iText, (FX_LPCWSTR)wsLiteral, iLiteralLen)) {
return FALSE;
}
@@ -2818,16 +2818,16 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ if (wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 iLenText = wsSrcText.GetLength();
+ int32_t iLenText = wsSrcText.GetLength();
if (iLenText == 0) {
return FALSE;
}
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"text"), wsTextFormat);
- FX_INT32 iText = 0, iPattern = 0;
+ int32_t iText = 0, iPattern = 0;
FX_LPCWSTR pStrText = (FX_LPCWSTR)wsSrcText;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
switch (pStrPattern[iPattern]) {
case '\'': {
@@ -2871,13 +2871,13 @@ FX_BOOL CFX_FormatString::FormatText(const CFX_WideString& wsSrcText, const CFX_ }
return iText == iLenText;
}
-static FX_INT32 FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros)
+static int32_t FX_GetNumTrailingLimit(const CFX_WideString& wsFormat, int iDotPos, FX_BOOL &bTrimTailZeros)
{
if (iDotPos < 0) {
return 0;
}
- FX_INT32 iCount = wsFormat.GetLength();
- FX_INT32 iTreading = 0;
+ int32_t iCount = wsFormat.GetLength();
+ int32_t iTreading = 0;
for (iDotPos ++; iDotPos < iCount; iDotPos ++) {
FX_WCHAR wc = wsFormat[iDotPos];
if (wc == L'z' || wc == L'9' || wc == 'Z') {
@@ -2892,14 +2892,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (wsInputNum.IsEmpty() || wsPattern.IsEmpty()) {
return FALSE;
}
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwNumStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 cc = 0, ccf = 0;
+ int32_t cc = 0, ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat;
int lenf = wsNumFormat.GetLength();
CFX_WideString wsSrcNum = wsInputNum;
@@ -2912,7 +2912,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& decimal = decimal * CFX_Decimal(100);
wsSrcNum = decimal;
}
- FX_INT32 exponent = 0;
+ int32_t exponent = 0;
if (dwNumStyle & FX_NUMSTYLE_Exponent) {
int fixed_count = 0;
while (ccf < dot_index_f) {
@@ -2951,8 +2951,8 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& }
}
FX_BOOL bTrimTailZeros = FALSE;
- FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
- FX_INT32 scale = decimal.GetScale();
+ int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
+ int32_t scale = decimal.GetScale();
if (iTreading < scale) {
decimal.SetScale(iTreading);
wsSrcNum = decimal;
@@ -3135,7 +3135,7 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& if (cc >= 0) {
int nPos = dot_index % 3;
wsOutput.Empty();
- for (FX_INT32 i = 0; i < dot_index; i++) {
+ for (int32_t i = 0; i < dot_index; i++) {
if (i % 3 == nPos && i != 0) {
wsOutput += wsGroupSymbol;
}
@@ -3322,14 +3322,14 @@ FX_BOOL CFX_FormatString::FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& }
FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput)
{
- FX_INT32 dot_index_f = -1;
+ int32_t dot_index_f = -1;
FX_DWORD dwNumStyle = 0;
CFX_WideString wsNumFormat;
IFX_Locale* pLocale = GetNumericFormat(wsPattern, dot_index_f, dwNumStyle, wsNumFormat);
if (!pLocale || wsNumFormat.IsEmpty()) {
return FALSE;
}
- FX_INT32 cc = 0, ccf = 0;
+ int32_t cc = 0, ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsNumFormat;
int lenf = wsNumFormat.GetLength();
double dbOrgRaw = lcNum.GetDouble();
@@ -3337,7 +3337,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (dwNumStyle & FX_NUMSTYLE_Percent) {
dbRetValue *= 100;
}
- FX_INT32 exponent = 0;
+ int32_t exponent = 0;
if (dwNumStyle & FX_NUMSTYLE_Exponent) {
int fixed_count = 0;
while (ccf < dot_index_f) {
@@ -3379,7 +3379,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt lcNum = CFX_LCNumeric(dbRetValue);
}
FX_BOOL bTrimTailZeros = FALSE;
- FX_INT32 iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
+ int32_t iTreading = FX_GetNumTrailingLimit(wsNumFormat, dot_index_f, bTrimTailZeros);
CFX_WideString wsNumeric = lcNum.ToString(iTreading, bTrimTailZeros);
if (wsNumeric.IsEmpty()) {
return FALSE;
@@ -3549,7 +3549,7 @@ FX_BOOL CFX_FormatString::FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideSt if (cc >= 0) {
int nPos = dot_index % 3;
wsOutput.Empty();
- for (FX_INT32 i = 0; i < dot_index; i++) {
+ for (int32_t i = 0; i < dot_index; i++) {
if (i % 3 == nPos && i != 0) {
wsOutput += wsGroupSymbol;
}
@@ -3742,9 +3742,9 @@ FX_BOOL CFX_FormatString::FormatNum(FX_FLOAT fNum, const CFX_WideString& wsPatte }
FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime)
{
- FX_INT32 year = 1900;
- FX_INT32 month = 1;
- FX_INT32 day = 1;
+ int32_t year = 1900;
+ int32_t month = 1;
+ int32_t day = 1;
FX_WORD wYear = 0;
int cc_start = 0, cc = 0;
FX_LPCWSTR str = (FX_LPCWSTR)wsDate;
@@ -3767,7 +3767,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime cc++;
}
cc_start = cc;
- FX_BYTE tmpM = 0;
+ uint8_t tmpM = 0;
while (cc < len && cc < cc_start + 2) {
if (!FX_IsDigit(str[cc])) {
return FALSE;
@@ -3782,7 +3782,7 @@ FX_BOOL FX_DateFromCanonical(const CFX_WideString& wsDate, CFX_Unitime& datetime if (str[cc] == '-') {
cc++;
}
- FX_BYTE tmpD = 0;
+ uint8_t tmpD = 0;
cc_start = cc;
while (cc < len && cc < cc_start + 2) {
if (!FX_IsDigit(str[cc])) {
@@ -3821,9 +3821,9 @@ FX_BOOL FX_TimeFromCanonical(FX_WSTR wsTime, CFX_Unitime& datetime, IFX_Locale* if (wsTime.GetLength() == 0) {
return FALSE;
}
- FX_BYTE hour = 0;
- FX_BYTE minute = 0;
- FX_BYTE second = 0;
+ uint8_t hour = 0;
+ uint8_t minute = 0;
+ uint8_t second = 0;
FX_WORD millisecond = 0;
int cc_start = 0, cc = cc_start;
FX_LPCWSTR str = (FX_LPCWSTR)wsTime.GetPtr();
@@ -3945,12 +3945,12 @@ static FX_WORD FX_GetWeekOfYear(FX_WORD year, FX_WORD month, FX_WORD day) static FX_BOOL FX_DateFormat(const CFX_WideString& wsDatePattern, IFX_Locale *pLocale, const CFX_Unitime &datetime, CFX_WideString& wsResult)
{
FX_BOOL bRet = TRUE;
- FX_INT32 year = datetime.GetYear();
- FX_BYTE month = datetime.GetMonth();
- FX_BYTE day = datetime.GetDay();
- FX_INT32 ccf = 0;
+ int32_t year = datetime.GetYear();
+ uint8_t month = datetime.GetMonth();
+ uint8_t day = datetime.GetDay();
+ int32_t ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsDatePattern;
- FX_INT32 lenf = wsDatePattern.GetLength();
+ int32_t lenf = wsDatePattern.GetLength();
while (ccf < lenf) {
if (strf[ccf] == '\'') {
wsResult += FX_GetLiteralText(strf, ccf, lenf);
@@ -4061,13 +4061,13 @@ static FX_BOOL FX_TimeFormat(const CFX_WideString& wsTimePattern, IFX_Locale *pL {
FX_BOOL bGMT = FALSE;
FX_BOOL bRet = TRUE;
- FX_BYTE hour = datetime.GetHour();
- FX_BYTE minute = datetime.GetMinute();
- FX_BYTE second = datetime.GetSecond();
+ uint8_t hour = datetime.GetHour();
+ uint8_t minute = datetime.GetMinute();
+ uint8_t second = datetime.GetSecond();
FX_WORD millisecond = datetime.GetMillisecond();
- FX_INT32 ccf = 0;
+ int32_t ccf = 0;
FX_LPCWSTR strf = (FX_LPCWSTR)wsTimePattern;
- FX_INT32 lenf = wsTimePattern.GetLength();
+ int32_t lenf = wsTimePattern.GetLength();
FX_WORD wHour = hour;
FX_BOOL bPM = FALSE;
if (wsTimePattern.Find('A') != -1) {
@@ -4216,7 +4216,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE;
}
CFX_Unitime dt(0);
- FX_INT32 iT = wsSrcDateTime.Find(L"T");
+ int32_t iT = wsSrcDateTime.Find(L"T");
if (iT < 0) {
if (eCategory == FX_DATETIMETYPE_Date) {
FX_DateFromCanonical(wsSrcDateTime, dt);
@@ -4251,7 +4251,7 @@ FX_BOOL CFX_FormatString::FormatDateTime(const CFX_WideString& wsSrcDateTime, co return FALSE;
}
CFX_Unitime dt(0);
- FX_INT32 iT = wsSrcDateTime.Find(L"T");
+ int32_t iT = wsSrcDateTime.Find(L"T");
if (iT < 0) {
if (eCategory == FX_DATETIMETYPE_Date && FX_DateFromCanonical(wsSrcDateTime, dt)) {
return FX_FormatDateTime(dt, wsDatePattern, wsTimePattern, TRUE, pLocale, wsOutput);
@@ -4290,9 +4290,9 @@ FX_BOOL CFX_FormatString::FormatZero(const CFX_WideString& wsPattern, CFX_WideSt }
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"zero"), wsTextFormat);
- FX_INT32 iPattern = 0;
+ int32_t iPattern = 0;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
@@ -4312,9 +4312,9 @@ FX_BOOL CFX_FormatString::FormatNull(const CFX_WideString& wsPattern, CFX_WideSt }
CFX_WideString wsTextFormat;
IFX_Locale* pLocale = GetTextFormat(wsPattern, FX_WSTRC(L"null"), wsTextFormat);
- FX_INT32 iPattern = 0;
+ int32_t iPattern = 0;
FX_LPCWSTR pStrPattern = (FX_LPCWSTR)wsTextFormat;
- FX_INT32 iLenPattern = wsTextFormat.GetLength();
+ int32_t iLenPattern = wsTextFormat.GetLength();
while (iPattern < iLenPattern) {
if (pStrPattern[iPattern] == '\'') {
wsOutput += FX_GetLiteralText(pStrPattern, iPattern, iLenPattern);
@@ -4338,12 +4338,12 @@ IFX_Locale* CFX_FormatString::GetPatternLocale(FX_WSTR wsLocale) #define FXMATH_DECIMAL_FORCEBOOL(x) (!(!(x)))
#define FXMATH_DECIMAL_MAKEFLAGS(NEG, SCALE) (((SCALE) << 0x10) | ((NEG) ? FXMATH_DECIMAL_NEGMASK : 0))
#define FXMATH_DECIMAL_FLAGS2NEG(FLAGS) FXMATH_DECIMAL_FORCEBOOL((FLAGS) & FXMATH_DECIMAL_NEGMASK)
-#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((FX_UINT8)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10))
+#define FXMATH_DECIMAL_FLAGS2SCALE(FLAGS) ((uint8_t)(((FLAGS) & ~FXMATH_DECIMAL_NEGMASK) >> 0x10))
#define FXMATH_DECIMAL_RSHIFT32BIT(x) ((x)>>0x10>>0x10)
#define FXMATH_DECIMAL_LSHIFT32BIT(x) ((x)<<0x10<<0x10)
-static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline uint8_t fxmath_decimal_helper_div10(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
- FX_UINT8 retVal;
+ uint8_t retVal;
pmid += FXMATH_DECIMAL_LSHIFT32BIT(phi % 0xA);
phi /= 0xA;
plo += FXMATH_DECIMAL_LSHIFT32BIT(pmid % 0xA);
@@ -4352,9 +4352,9 @@ static inline FX_UINT8 fxmath_decimal_helper_div10(FX_UINT64& phi, FX_UINT64& pm plo /= 0xA;
return retVal;
}
-static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT8 numcount)
+static inline uint8_t fxmath_decimal_helper_div10_any(uint64_t nums[], uint8_t numcount)
{
- FX_UINT8 retVal = 0;
+ uint8_t retVal = 0;
for(int i = numcount - 1; i > 0; i --) {
nums[i - 1] += FXMATH_DECIMAL_LSHIFT32BIT(nums[i] % 0xA);
nums[i] /= 0xA;
@@ -4365,49 +4365,49 @@ static inline FX_UINT8 fxmath_decimal_helper_div10_any(FX_UINT64 nums[], FX_UINT }
return retVal;
}
-static inline void fxmath_decimal_helper_mul10(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline void fxmath_decimal_helper_mul10(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
plo *= 0xA;
pmid = pmid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(plo);
- plo = (FX_UINT32)plo;
+ plo = (uint32_t)plo;
phi = phi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
}
-static inline void fxmath_decimal_helper_mul10_any(FX_UINT64 nums[], FX_UINT8 numcount)
+static inline void fxmath_decimal_helper_mul10_any(uint64_t nums[], uint8_t numcount)
{
nums[0] *= 0xA;
for(int i = 1; i < numcount; i++) {
nums[i] = nums[i] * 0xA + FXMATH_DECIMAL_RSHIFT32BIT (nums[i - 1]);
- nums[i - 1] = (FX_UINT32)nums[i - 1];
+ nums[i - 1] = (uint32_t)nums[i - 1];
}
}
-static inline void fxmath_decimal_helper_normalize(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo)
+static inline void fxmath_decimal_helper_normalize(uint64_t& phi, uint64_t& pmid, uint64_t& plo)
{
phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
pmid += FXMATH_DECIMAL_RSHIFT32BIT(plo);
- plo = (FX_UINT32)plo;
+ plo = (uint32_t)plo;
phi += FXMATH_DECIMAL_RSHIFT32BIT(pmid);
- pmid = (FX_UINT32)pmid;
+ pmid = (uint32_t)pmid;
}
-static inline void fxmath_decimal_helper_normalize_any(FX_UINT64 nums[], FX_UINT8 len)
+static inline void fxmath_decimal_helper_normalize_any(uint64_t nums[], uint8_t len)
{
{
for(int i = len - 2; i > 0; i --) {
nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]);
- nums[i] = (FX_UINT32)nums[i];
+ nums[i] = (uint32_t)nums[i];
}
}
{
for(int i = 0; i < len - 1; i ++) {
nums[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(nums[i]);
- nums[i] = (FX_UINT32)nums[i];
+ nums[i] = (uint32_t)nums[i];
}
}
}
-static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 mid1, FX_UINT32 lo1, FX_UINT32 hi2, FX_UINT32 mid2, FX_UINT32 lo2)
+static inline int8_t fxmath_decimal_helper_raw_compare(uint32_t hi1, uint32_t mid1, uint32_t lo1, uint32_t hi2, uint32_t mid2, uint32_t lo2)
{
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
if (!retVal) {
retVal += (hi1 > hi2 ? 1 : (hi1 < hi2 ? -1 : 0));
}
@@ -4419,11 +4419,11 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare(FX_UINT32 hi1, FX_UINT32 }
return retVal;
}
-static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl)
+static inline int8_t fxmath_decimal_helper_raw_compare_any(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl)
{
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
for(int i = FX_MAX(al - 1, bl - 1); i >= 0; i --) {
- FX_UINT64 l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]);
+ uint64_t l = (i >= al ? 0 : a[i]), r = (i >= bl ? 0 : b[i]);
retVal += (l > r ? 1 : (l < r ? -1 : 0));
if(retVal) {
return retVal;
@@ -4431,7 +4431,7 @@ static inline FX_INT8 fxmath_decimal_helper_raw_compare_any(FX_UINT64 a[], FX_UI }
return retVal;
}
-static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al)
+static inline void fxmath_decimal_helper_dec_any(uint64_t a[], uint8_t al)
{
for(int i = 0; i < al; i ++) {
if(a[i]--) {
@@ -4439,17 +4439,17 @@ static inline void fxmath_decimal_helper_dec_any(FX_UINT64 a[], FX_UINT8 al) }
}
}
-static inline void fxmath_decimal_helper_inc_any(FX_UINT64 a[], FX_UINT8 al)
+static inline void fxmath_decimal_helper_inc_any(uint64_t a[], uint8_t al)
{
for(int i = 0; i < al; i ++) {
a[i]++;
- if((FX_UINT32)a[i] == a[i]) {
+ if((uint32_t)a[i] == a[i]) {
return;
}
a[i] = 0;
}
}
-static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl)
+static inline void fxmath_decimal_helper_raw_mul(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl)
{
assert(al + bl <= cl);
{
@@ -4460,8 +4460,8 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ {
for(int i = 0; i < al; i++) {
for(int j = 0; j < bl; j++) {
- FX_UINT64 m = (FX_UINT64)a[i] * b[j];
- c[i + j] += (FX_UINT32)m;
+ uint64_t m = (uint64_t)a[i] * b[j];
+ c[i + j] += (uint32_t)m;
c[i + j + 1] += FXMATH_DECIMAL_RSHIFT32BIT(m);
}
}
@@ -4469,29 +4469,29 @@ static inline void fxmath_decimal_helper_raw_mul(FX_UINT64 a[], FX_UINT8 al, FX_ {
for(int i = 0; i < cl - 1; i++) {
c[i + 1] += FXMATH_DECIMAL_RSHIFT32BIT(c[i]);
- c[i] = (FX_UINT32)c[i];
+ c[i] = (uint32_t)c[i];
}
}
{
for(int i = 0; i < cl; i++) {
- c[i] = (FX_UINT32)c[i];
+ c[i] = (uint32_t)c[i];
}
}
}
-static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_UINT64 b[], FX_UINT8 bl, FX_UINT64 c[], FX_UINT8 cl)
+static inline void fxmath_decimal_helper_raw_div(uint64_t a[], uint8_t al, uint64_t b[], uint8_t bl, uint64_t c[], uint8_t cl)
{
int i;
for(i = 0; i < cl; i++) {
c[i] = 0;
}
- FX_UINT64 left[16] = {0}, right[16] = {0};
+ uint64_t left[16] = {0}, right[16] = {0};
left[0] = 0;
for(i = 0; i < al; i++) {
right[i] = a[i];
}
- FX_UINT64 tmp[16];
+ uint64_t tmp[16];
while(fxmath_decimal_helper_raw_compare_any(left, al, right, al) <= 0) {
- FX_UINT64 cur[16];
+ uint64_t cur[16];
for(i = 0; i < al; i++) {
cur[i] = left[i] + right[i];
}
@@ -4527,7 +4527,7 @@ static inline void fxmath_decimal_helper_raw_div(FX_UINT64 a[], FX_UINT8 al, FX_ c[i] = left[i];
}
}
-static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal)
+static inline FX_BOOL fxmath_decimal_helper_outofrange(uint64_t a[], uint8_t al, uint8_t goal)
{
for(int i = goal; i < al; i++) {
if(a[i]) {
@@ -4536,7 +4536,7 @@ static inline FX_BOOL fxmath_decimal_helper_outofrange(FX_UINT64 a[], FX_UINT8 a }
return FALSE;
}
-static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 al, FX_UINT8 goal, FX_UINT8& scale)
+static inline void fxmath_decimal_helper_shrinkintorange(uint64_t a[], uint8_t al, uint8_t goal, uint8_t& scale)
{
FX_BOOL bRoundUp = FALSE;
while(scale != 0 && (scale > FXMATH_DECIMAL_SCALELIMIT || fxmath_decimal_helper_outofrange(a, al, goal))) {
@@ -4548,10 +4548,10 @@ static inline void fxmath_decimal_helper_shrinkintorange(FX_UINT64 a[], FX_UINT8 fxmath_decimal_helper_inc_any(a, goal);
}
}
-static inline void fxmath_decimal_helper_truncate(FX_UINT64& phi, FX_UINT64& pmid, FX_UINT64& plo, FX_UINT8& scale, FX_UINT8 minscale = 0)
+static inline void fxmath_decimal_helper_truncate(uint64_t& phi, uint64_t& pmid, uint64_t& plo, uint8_t& scale, uint8_t minscale = 0)
{
while(scale > minscale) {
- FX_UINT64 thi = phi, tmid = pmid, tlo = plo;
+ uint64_t thi = phi, tmid = pmid, tlo = plo;
if(fxmath_decimal_helper_div10(thi, tmid, tlo) != 0) {
break;
}
@@ -4563,20 +4563,20 @@ CFX_Decimal::CFX_Decimal() {
m_uLo = m_uMid = m_uHi = m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT64 val)
+CFX_Decimal::CFX_Decimal(uint64_t val)
{
- m_uLo = (FX_UINT32)val;
- m_uMid = (FX_UINT32)FXMATH_DECIMAL_RSHIFT32BIT(val);
+ m_uLo = (uint32_t)val;
+ m_uMid = (uint32_t)FXMATH_DECIMAL_RSHIFT32BIT(val);
m_uHi = 0;
m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT32 val)
+CFX_Decimal::CFX_Decimal(uint32_t val)
{
- m_uLo = (FX_UINT32)val;
+ m_uLo = (uint32_t)val;
m_uMid = m_uHi = 0;
m_uFlags = 0;
}
-CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, FX_UINT8 scale)
+CFX_Decimal::CFX_Decimal(uint32_t lo, uint32_t mid, uint32_t hi, FX_BOOL neg, uint8_t scale)
{
scale = (scale > FXMATH_DECIMAL_SCALELIMIT ? 0 : scale);
m_uLo = lo;
@@ -4584,43 +4584,43 @@ CFX_Decimal::CFX_Decimal(FX_UINT32 lo, FX_UINT32 mid, FX_UINT32 hi, FX_BOOL neg, m_uHi = hi;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(neg && IsNotZero(), scale);
}
-CFX_Decimal::CFX_Decimal(FX_INT32 val)
+CFX_Decimal::CFX_Decimal(int32_t val)
{
if(val >= 0) {
- *this = CFX_Decimal((FX_UINT32)val);
+ *this = CFX_Decimal((uint32_t)val);
} else {
- *this = CFX_Decimal((FX_UINT32) - val);
+ *this = CFX_Decimal((uint32_t) - val);
SetNegate();
}
}
-CFX_Decimal::CFX_Decimal(FX_INT64 val)
+CFX_Decimal::CFX_Decimal(int64_t val)
{
if(val >= 0) {
- *this = CFX_Decimal((FX_UINT64)val);
+ *this = CFX_Decimal((uint64_t)val);
} else {
- *this = CFX_Decimal((FX_UINT64) - val);
+ *this = CFX_Decimal((uint64_t) - val);
SetNegate();
}
}
-CFX_Decimal::CFX_Decimal(FX_FLOAT val, FX_UINT8 scale )
+CFX_Decimal::CFX_Decimal(FX_FLOAT val, uint8_t scale )
{
FX_FLOAT newval = fabs(val);
- FX_UINT64 phi, pmid, plo;
- plo = (FX_UINT64)newval;
- pmid = (FX_UINT64)(newval / 1e32);
- phi = (FX_UINT64)(newval / 1e64);
+ uint64_t phi, pmid, plo;
+ plo = (uint64_t)newval;
+ pmid = (uint64_t)(newval / 1e32);
+ phi = (uint64_t)(newval / 1e64);
newval = FXSYS_fmod(newval, 1.0f);
- for(FX_UINT8 iter = 0; iter < scale; iter++) {
+ for(uint8_t iter = 0; iter < scale; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
newval *= 10;
- plo += (FX_UINT64)newval;
+ plo += (uint64_t)newval;
newval = FXSYS_fmod(newval, 1.0f);
}
plo += FXSYS_round(newval);
fxmath_decimal_helper_normalize(phi, pmid, plo);
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(val < 0 && IsNotZero(), scale);
}
CFX_Decimal::CFX_Decimal(FX_WSTR strObj)
@@ -4629,7 +4629,7 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) FX_LPCWSTR strBound = str + strObj.GetLength();
FX_BOOL pointmet = 0;
FX_BOOL negmet = 0;
- FX_UINT8 scale = 0;
+ uint8_t scale = 0;
m_uHi = m_uMid = m_uLo = 0;
while (str != strBound && *str == ' ') {
str++;
@@ -4647,8 +4647,8 @@ CFX_Decimal::CFX_Decimal(FX_WSTR strObj) }
pointmet = 1;
} else {
- m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uMid * 0xA);
- m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((FX_UINT64)m_uLo * 0xA);
+ m_uHi = m_uHi * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uMid * 0xA);
+ m_uMid = m_uMid * 0xA + FXMATH_DECIMAL_RSHIFT32BIT((uint64_t)m_uLo * 0xA);
m_uLo = m_uLo * 0xA + (*str - '0');
if(pointmet) {
scale++;
@@ -4669,12 +4669,12 @@ CFX_Decimal::operator CFX_WideString() const {
CFX_WideString retString;
CFX_WideString tmpbuf;
- FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo;
+ uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo;
while(phi || pmid || plo) {
tmpbuf += fxmath_decimal_helper_div10(phi, pmid, plo) + '0';
}
- FX_UINT8 outputlen = (FX_UINT8)tmpbuf.GetLength();
- FX_UINT8 scale = (FX_UINT8)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t outputlen = (uint8_t)tmpbuf.GetLength();
+ uint8_t scale = (uint8_t)FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
while (scale >= outputlen) {
tmpbuf += '0';
outputlen++;
@@ -4682,7 +4682,7 @@ CFX_Decimal::operator CFX_WideString() const if (FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero()) {
retString += '-';
}
- for (FX_UINT8 idx = 0; idx < outputlen; idx++) {
+ for (uint8_t idx = 0; idx < outputlen; idx++) {
if (idx == (outputlen - scale) && scale != 0) {
retString += '.';
}
@@ -4694,27 +4694,27 @@ CFX_Decimal::operator double() const {
double pow = (double)(1 << 16) * (1 << 16);
double base = ((double)m_uHi) * pow * pow + ((double)m_uMid) * pow + ((double)m_uLo);
- FX_INT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ int8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
FX_BOOL bNeg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags);
return (bNeg ? -1 : 1) * base * ::pow(10.0, -scale);
}
-void CFX_Decimal::SetScale(FX_UINT8 newscale)
+void CFX_Decimal::SetScale(uint8_t newscale)
{
- FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
if (newscale > oldscale) {
- FX_UINT64 phi = m_uHi, pmid = m_uMid, plo = m_uLo;
- for (FX_UINT8 iter = 0; iter < newscale - oldscale; iter++) {
+ uint64_t phi = m_uHi, pmid = m_uMid, plo = m_uLo;
+ for (uint8_t iter = 0; iter < newscale - oldscale; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
}
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale);
} else if (newscale < oldscale) {
- FX_UINT64 phi, pmid, plo;
+ uint64_t phi, pmid, plo;
phi = 0, pmid = 0, plo = 5;
{
- for(FX_UINT8 iter = 0; iter < oldscale - newscale - 1; iter++) {
+ for(uint8_t iter = 0; iter < oldscale - newscale - 1; iter++) {
fxmath_decimal_helper_mul10(phi, pmid, plo);
}
}
@@ -4723,19 +4723,19 @@ void CFX_Decimal::SetScale(FX_UINT8 newscale) plo += m_uLo;
fxmath_decimal_helper_normalize(phi, pmid, plo);
{
- for(FX_UINT8 iter = 0; iter < oldscale - newscale; iter++) {
+ for(uint8_t iter = 0; iter < oldscale - newscale; iter++) {
fxmath_decimal_helper_div10(phi, pmid, plo);
}
}
- m_uHi = (FX_UINT32)phi;
- m_uMid = (FX_UINT32)pmid;
- m_uLo = (FX_UINT32)plo;
+ m_uHi = (uint32_t)phi;
+ m_uMid = (uint32_t)pmid;
+ m_uLo = (uint32_t)plo;
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), newscale);
}
}
-FX_UINT8 CFX_Decimal::GetScale()
+uint8_t CFX_Decimal::GetScale()
{
- FX_UINT8 oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
+ uint8_t oldscale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags);
return oldscale;
}
void CFX_Decimal::SetAbs()
@@ -4750,7 +4750,7 @@ void CFX_Decimal::SetNegate() }
void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor)
{
- FX_UINT64 nums[3] = {m_uLo, m_uMid, m_uHi};
+ uint64_t nums[3] = {m_uLo, m_uMid, m_uHi};
FX_BOOL bDataLoss = FALSE;
for(int i = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i --) {
bDataLoss = fxmath_decimal_helper_div10_any(nums, 3) || bDataLoss;
@@ -4758,9 +4758,9 @@ void CFX_Decimal::FloorOrCeil(FX_BOOL bFloor) if(bDataLoss && (bFloor ? FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) : !FXMATH_DECIMAL_FLAGS2NEG(m_uFlags))) {
fxmath_decimal_helper_inc_any(nums, 3);
}
- m_uHi = (FX_UINT32)nums[2];
- m_uMid = (FX_UINT32)nums[1];
- m_uLo = (FX_UINT32)nums[0];
+ m_uHi = (uint32_t)nums[2];
+ m_uMid = (uint32_t)nums[1];
+ m_uLo = (uint32_t)nums[0];
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) && IsNotZero(), 0);
}
void CFX_Decimal::SetFloor()
@@ -4777,7 +4777,7 @@ void CFX_Decimal::SetTruncate() }
void CFX_Decimal::Swap(CFX_Decimal& val)
{
- FX_UINT32 tmp;
+ uint32_t tmp;
tmp = m_uHi;
m_uHi = val.m_uHi;
val.m_uHi = tmp;
@@ -4791,12 +4791,12 @@ void CFX_Decimal::Swap(CFX_Decimal& val) m_uFlags = val.m_uFlags;
val.m_uFlags = tmp;
}
-FX_INT8 CFX_Decimal::Compare (const CFX_Decimal& val) const
+int8_t CFX_Decimal::Compare (const CFX_Decimal& val) const
{
CFX_Decimal lhs = *this, rhs = val;
- FX_INT8 retVal = 0;
+ int8_t retVal = 0;
if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) {
- FX_UINT8 scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
+ uint8_t scale = FX_MIN(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
lhs.SetScale(scale);
rhs.SetScale(scale);
}
@@ -4811,7 +4811,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co {
CFX_Decimal lhs = *this, rhs = val;
if (FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) != FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags)) {
- FX_UINT8 scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
+ uint8_t scale = FX_MAX(FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(rhs.m_uFlags));
lhs.SetScale(scale);
rhs.SetScale(scale);
}
@@ -4820,7 +4820,7 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co }
FX_BOOL doRawAdd = (FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags) == FXMATH_DECIMAL_FLAGS2NEG(rhs.m_uFlags));
if (doRawAdd) {
- FX_UINT64 phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo;
+ uint64_t phi = lhs.m_uHi, pmid = lhs.m_uMid, plo = lhs.m_uLo;
phi += rhs.m_uHi;
pmid += rhs.m_uMid;
plo += rhs.m_uLo;
@@ -4829,9 +4829,9 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co fxmath_decimal_helper_div10(phi, pmid, plo);
lhs.m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(FXMATH_DECIMAL_FLAGS2NEG(lhs.m_uFlags), FXMATH_DECIMAL_FLAGS2SCALE(lhs.m_uFlags) - 1);
}
- lhs.m_uHi = (FX_UINT32)phi;
- lhs.m_uMid = (FX_UINT32)pmid;
- lhs.m_uLo = (FX_UINT32)plo;
+ lhs.m_uHi = (uint32_t)phi;
+ lhs.m_uMid = (uint32_t)pmid;
+ lhs.m_uLo = (uint32_t)plo;
return lhs;
} else {
if(fxmath_decimal_helper_raw_compare(lhs.m_uHi, lhs.m_uMid, lhs.m_uLo, rhs.m_uHi, rhs.m_uMid, rhs.m_uLo) < 0) {
@@ -4854,13 +4854,13 @@ CFX_Decimal CFX_Decimal::AddOrMinus(const CFX_Decimal& val, FX_BOOL isAdding) co }
CFX_Decimal CFX_Decimal::Multiply(const CFX_Decimal& val) const
{
- FX_UINT64 a[3] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi};
- FX_UINT64 c[6];
+ uint64_t a[3] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi};
+ uint64_t c[6];
fxmath_decimal_helper_raw_mul(a, 3, b, 3, c, 6);
FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
- FX_UINT8 scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) + FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
+ uint8_t scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) + FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale);
- return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale);
+ return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale);
}
CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const
{
@@ -4868,8 +4868,8 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const return CFX_Decimal();
}
FX_BOOL neg = FXMATH_DECIMAL_FLAGS2NEG(m_uFlags) ^ FXMATH_DECIMAL_FLAGS2NEG(val.m_uFlags);
- FX_UINT64 a[7] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0};
- FX_UINT8 scale = 0;
+ uint64_t a[7] = {m_uLo, m_uMid, m_uHi}, b[3] = {val.m_uLo, val.m_uMid, val.m_uHi}, c[7] = {0};
+ uint8_t scale = 0;
if(FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) < FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags)) {
for(int i = FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags); i > 0; i--) {
fxmath_decimal_helper_mul10_any(a, 7);
@@ -4877,7 +4877,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const } else {
scale = FXMATH_DECIMAL_FLAGS2SCALE(m_uFlags) - FXMATH_DECIMAL_FLAGS2SCALE(val.m_uFlags);
}
- FX_UINT8 minscale = scale;
+ uint8_t minscale = scale;
if(!IsNotZero()) {
return CFX_Decimal(0, 0, 0, 0, minscale);
}
@@ -4890,7 +4890,7 @@ CFX_Decimal CFX_Decimal::Divide(const CFX_Decimal& val) const fxmath_decimal_helper_raw_div(a, 6, b, 3, c, 7);
fxmath_decimal_helper_shrinkintorange(c, 6, 3, scale);
fxmath_decimal_helper_truncate(c[2], c[1], c[0], scale, minscale);
- return CFX_Decimal((FX_UINT32)c[0], (FX_UINT32)c[1], (FX_UINT32)c[2], neg, scale);
+ return CFX_Decimal((uint32_t)c[0], (uint32_t)c[1], (uint32_t)c[2], neg, scale);
}
CFX_Decimal CFX_Decimal::Modulus(const CFX_Decimal& val) const
{
diff --git a/xfa/src/fgas/src/localization/fx_localeimp.h b/xfa/src/fgas/src/localization/fx_localeimp.h index c7d534d106..8dfec2e862 100644 --- a/xfa/src/fgas/src/localization/fx_localeimp.h +++ b/xfa/src/fgas/src/localization/fx_localeimp.h @@ -20,8 +20,8 @@ public: virtual void GetNumbericSymbol(FX_LOCALENUMSYMBOL eType, CFX_WideString& wsNumSymbol) const;
virtual void GetDateTimeSymbols(CFX_WideString& wsDtSymbol) const;
- virtual void GetMonthName(FX_INT32 nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
- virtual void GetDayName(FX_INT32 nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetMonthName(int32_t nMonth, CFX_WideString& wsMonthName, FX_BOOL bAbbr = TRUE) const;
+ virtual void GetDayName(int32_t nWeek, CFX_WideString& wsDayName, FX_BOOL bAbbr = TRUE) const;
virtual void GetMeridiemName(CFX_WideString& wsMeridiemName, FX_BOOL bAM = TRUE) const;
virtual void GetTimeZone(FX_TIMEZONE& tz) const;
virtual void GetEraName(CFX_WideString& wsEraName, FX_BOOL bAD = TRUE) const;
@@ -63,7 +63,7 @@ public: protected:
virtual ~CFX_FormatString();
IFX_Locale* GetTextFormat(const CFX_WideString &wsPattern, FX_WSTR wsCategory, CFX_WideString& wsPurgePattern);
- IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, FX_INT32& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern);
+ IFX_Locale* GetNumericFormat(const CFX_WideString& wsPattern, int32_t& iDotIndex, FX_DWORD& dwStyle, CFX_WideString& wsPurgePattern);
FX_BOOL FormatStrNum(FX_WSTR wsInputNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
FX_BOOL FormatLCNumeric(CFX_LCNumeric& lcNum, const CFX_WideString& wsPattern, CFX_WideString& wsOutput);
FX_DATETIMETYPE GetDateTimeFormat(const CFX_WideString& wsPattern, IFX_Locale*& pLocale, CFX_WideString &wsDatePattern, CFX_WideString &wsTimePattern);
diff --git a/xfa/src/fgas/src/localization/fx_localemgr.cpp b/xfa/src/fgas/src/localization/fx_localemgr.cpp index 3b93f101a3..b3f0e80d7a 100644 --- a/xfa/src/fgas/src/localization/fx_localemgr.cpp +++ b/xfa/src/fgas/src/localization/fx_localemgr.cpp @@ -38,10 +38,10 @@ IFX_LocaleMgr* FX_LocaleMgr_Create(FX_LPCWSTR pszLocalPath, FX_WORD wDefaultLCID CFX_WideString wsLCID = pXmlLocale->GetAttrValue("", "lcid");
wchar_t* pEnd = NULL;
FX_DWORD dwLCID = wcstol(wsLCID, &pEnd, 16);
- if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)dwLCID)) {
+ if (pLocaleMgr->m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)dwLCID)) {
delete pXmlLocale;
} else {
- pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(FX_UINTPTR)dwLCID, pXmlLocale);
+ pLocaleMgr->m_lcid2xml.SetAt((FX_LPVOID)(uintptr_t)dwLCID, pXmlLocale);
}
} else {
delete pXmlLocale;
@@ -84,12 +84,12 @@ IFX_Locale* CFX_LocaleMgr::GetDefLocale() }
IFX_Locale* CFX_LocaleMgr::GetLocale(FX_WORD lcid)
{
- IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid);
+ IFX_Locale* pLocale = (IFX_Locale*)m_lcid2locale.GetValueAt((FX_LPVOID)(uintptr_t)lcid);
if (!pLocale) {
- CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(FX_UINTPTR)lcid);
+ CXML_Element* pxml = (CXML_Element*)m_lcid2xml.GetValueAt((FX_LPVOID)(uintptr_t)lcid);
if (pxml) {
pLocale = IFX_Locale::Create(pxml);
- m_lcid2locale.SetAt((FX_LPVOID)(FX_UINTPTR)lcid, pLocale);
+ m_lcid2locale.SetAt((FX_LPVOID)(uintptr_t)lcid, pLocale);
}
}
return pLocale;
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp index b41ee3fef4..fedf89f9f9 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp +++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp @@ -34,7 +34,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead *pFile, FX_DWORD dwStart, FX_DWORD d return FALSE;
}
m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE);
- m_pBuf = FX_Alloc(FX_BYTE, m_dwBufSize);
+ m_pBuf = FX_Alloc(uint8_t, m_dwBufSize);
if (!m_pBuf) {
return FALSE;
}
@@ -72,7 +72,7 @@ void CFX_SAXFile::Reset() }
#define FX_SAXCHARTYPE_Normal 0
#define FX_SAXCHARTYPE_Space 1
-static FX_BYTE g_SAX_CharType[256] = {
+static uint8_t g_SAX_CharType[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -102,8 +102,8 @@ CFX_SAXReader::CFX_SAXReader() , m_pCommentContext(NULL)
, m_dwParseMode(0)
{
- m_pszData = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iDataSize);
- m_pszName = (FX_LPBYTE)FX_Alloc(FX_BYTE, m_iNameSize);
+ m_pszData = (FX_LPBYTE)FX_Alloc(uint8_t, m_iDataSize);
+ m_pszName = (FX_LPBYTE)FX_Alloc(uint8_t, m_iNameSize);
}
CFX_SAXReader::~CFX_SAXReader()
{
@@ -159,12 +159,12 @@ inline void CFX_SAXReader::Pop() delete m_pCurItem;
m_pCurItem = pPrev;
}
-inline void CFX_SAXReader::AppendData(FX_BYTE ch)
+inline void CFX_SAXReader::AppendData(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos++] = ch;
}
-inline void CFX_SAXReader::AppendName(FX_BYTE ch)
+inline void CFX_SAXReader::AppendName(uint8_t ch)
{
ReallocNameBuffer();
m_pszName[m_iDataPos++] = ch;
@@ -179,7 +179,7 @@ void CFX_SAXReader::ReallocDataBuffer() } else {
m_iDataSize += 1024 * 1024;
}
- m_pszData = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszData, m_iDataSize);
+ m_pszData = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszData, m_iDataSize);
}
void CFX_SAXReader::ReallocNameBuffer()
{
@@ -191,13 +191,13 @@ void CFX_SAXReader::ReallocNameBuffer() } else {
m_iNameSize += 1024 * 1024;
}
- m_pszName = (FX_LPBYTE)FX_Realloc(FX_BYTE, m_pszName, m_iNameSize);
+ m_pszName = (FX_LPBYTE)FX_Realloc(uint8_t, m_pszName, m_iNameSize);
}
-inline FX_BOOL CFX_SAXReader::SkipSpace(FX_BYTE ch)
+inline FX_BOOL CFX_SAXReader::SkipSpace(uint8_t ch)
{
return (m_dwParseMode & FX_SAXPARSEMODE_NotSkipSpace) == 0 && ch < 0x21;
}
-FX_INT32 CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
+int32_t CFX_SAXReader::StartParse(IFX_FileRead *pFile, FX_DWORD dwStart , FX_DWORD dwLen , FX_DWORD dwParseMode )
{
m_iState = -1;
Reset();
@@ -231,7 +231,7 @@ static const FX_SAXReader_LPFParse g_FX_SAXReader_LPFParse[FX_SAXMODE_MAX] = { &CFX_SAXReader::ParseTagEnd,
&CFX_SAXReader::ParseTargetData,
};
-FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
+int32_t CFX_SAXReader::ContinueParse(IFX_Pause *pPause )
{
if (m_iState < 0 || m_iState > 99) {
return m_iState;
@@ -261,21 +261,21 @@ FX_INT32 CFX_SAXReader::ContinueParse(IFX_Pause *pPause ) }
return m_iState;
}
-void CFX_SAXReader::ParseChar(FX_BYTE ch)
+void CFX_SAXReader::ParseChar(uint8_t ch)
{
ReallocDataBuffer();
m_pszData[m_iDataPos] = ch;
if (m_iEntityStart > -1 && ch == ';') {
- FX_INT32 iSaveEntityStart = m_iEntityStart;
+ int32_t iSaveEntityStart = m_iEntityStart;
CFX_ByteString csEntity(m_pszData + m_iEntityStart + 1, m_iDataPos - m_iEntityStart - 1);
- FX_INT32 iLen = csEntity.GetLength();
+ int32_t iLen = csEntity.GetLength();
if (iLen > 0) {
if (csEntity[0] == '#') {
if ((m_dwParseMode & FX_SAXPARSEMODE_NotConvert_sharp) == 0) {
ch = 0;
- FX_BYTE w;
+ uint8_t w;
if (iLen > 1 && csEntity[1] == 'x') {
- for (FX_INT32 i = 2; i < iLen; i ++) {
+ for (int32_t i = 2; i < iLen; i ++) {
w = csEntity[i];
if (w >= '0' && w <= '9') {
ch = (ch << 4) + w - '0';
@@ -288,7 +288,7 @@ void CFX_SAXReader::ParseChar(FX_BYTE ch) }
}
} else {
- for (FX_INT32 i = 1; i < iLen; i ++) {
+ for (int32_t i = 1; i < iLen; i ++) {
w = csEntity[i];
if (w < '0' || w > '9') {
break;
@@ -592,7 +592,7 @@ void CFX_SAXReader::ParseTargetData() }
void CFX_SAXReader::SkipNode()
{
- FX_INT32 iLen = m_SkipStack.GetSize();
+ int32_t iLen = m_SkipStack.GetSize();
if (m_SkipChar == '\'' || m_SkipChar == '\"') {
if (m_CurByte != m_SkipChar) {
return;
@@ -633,12 +633,12 @@ void CFX_SAXReader::SkipNode() m_iDataLength = m_iDataPos;
m_iDataPos = 0;
if (m_iDataLength >= 9
- && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(FX_BYTE)) == 0
- && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(FX_BYTE)) == 0) {
+ && FXSYS_memcmp(m_pszData, "[CDATA[", 7 * sizeof(uint8_t)) == 0
+ && FXSYS_memcmp(m_pszData + m_iDataLength - 2, "]]", 2 * sizeof(uint8_t)) == 0) {
Pop();
m_iDataLength -= 9;
m_dwDataOffset += 7;
- FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(FX_BYTE));
+ FXSYS_memmove(m_pszData , m_pszData + 7, m_iDataLength * sizeof(uint8_t));
m_bCharData = TRUE;
if (m_pHandler) {
NotifyData();
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.h b/xfa/src/fgas/src/xml/fx_sax_imp.h index 444bcbdf8e..a2f7259235 100644 --- a/xfa/src/fgas/src/xml/fx_sax_imp.h +++ b/xfa/src/fgas/src/xml/fx_sax_imp.h @@ -63,8 +63,8 @@ public: , m_iTailCount(0)
{
}
- FX_INT32 m_iHeaderCount;
- FX_INT32 m_iTailCount;
+ int32_t m_iHeaderCount;
+ int32_t m_iTailCount;
};
class CFX_SAXReader : public IFX_SAXReader
{
@@ -75,12 +75,12 @@ public: {
delete this;
}
- virtual FX_INT32 StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
- virtual FX_INT32 ContinueParse(IFX_Pause *pPause = NULL);
+ virtual int32_t StartParse(IFX_FileRead *pFile, FX_DWORD dwStart = 0, FX_DWORD dwLen = -1, FX_DWORD dwParseMode = 0);
+ virtual int32_t ContinueParse(IFX_Pause *pPause = NULL);
virtual void SkipCurrentNode();
virtual void SetHandler(IFX_SAXReaderHandler *pHandler);
- void AppendData(FX_BYTE ch);
- void AppendName(FX_BYTE ch);
+ void AppendData(uint8_t ch);
+ void AppendName(uint8_t ch);
void ParseText();
void ParseNodeStart();
void ParseInstruction();
@@ -99,32 +99,32 @@ public: protected:
CFX_SAXFile m_File;
IFX_SAXReaderHandler* m_pHandler;
- FX_INT32 m_iState;
+ int32_t m_iState;
CFX_SAXItem* m_pRoot;
CFX_SAXItem* m_pCurItem;
FX_DWORD m_dwItemID;
FX_SAXMODE m_eMode;
FX_SAXMODE m_ePrevMode;
FX_BOOL m_bCharData;
- FX_BYTE m_CurByte;
+ uint8_t m_CurByte;
FX_DWORD m_dwDataOffset;
CFX_ByteArray m_SkipStack;
- FX_BYTE m_SkipChar;
+ uint8_t m_SkipChar;
FX_DWORD m_dwNodePos;
FX_LPBYTE m_pszData;
- FX_INT32 m_iDataSize;
- FX_INT32 m_iDataLength;
- FX_INT32 m_iEntityStart;
- FX_INT32 m_iDataPos;
+ int32_t m_iDataSize;
+ int32_t m_iDataLength;
+ int32_t m_iEntityStart;
+ int32_t m_iDataPos;
FX_LPBYTE m_pszName;
- FX_INT32 m_iNameSize;
- FX_INT32 m_iNameLength;
+ int32_t m_iNameSize;
+ int32_t m_iNameLength;
FX_DWORD m_dwParseMode;
CFX_SAXCommentContext *m_pCommentContext;
void Reset();
void Push();
void Pop();
- FX_BOOL SkipSpace(FX_BYTE ch);
+ FX_BOOL SkipSpace(uint8_t ch);
void SkipNode();
void NotifyData();
void NotifyEnter();
@@ -135,6 +135,6 @@ protected: void NotifyTargetData();
void ReallocDataBuffer();
void ReallocNameBuffer();
- void ParseChar(FX_BYTE ch);
+ void ParseChar(uint8_t ch);
};
#endif
|