From 812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 13 Mar 2017 16:43:37 -0400 Subject: Replace FX_CHAR and FX_WCHAR with underlying types. Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fgas/crt/fgas_codepage.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'xfa/fgas/crt/fgas_codepage.cpp') diff --git a/xfa/fgas/crt/fgas_codepage.cpp b/xfa/fgas/crt/fgas_codepage.cpp index 36f87a36f3..5f824667fb 100644 --- a/xfa/fgas/crt/fgas_codepage.cpp +++ b/xfa/fgas/crt/fgas_codepage.cpp @@ -261,7 +261,7 @@ const FX_STR2CPHASH g_FXCPHashTable[] = { {0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5}, }; -uint16_t GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { +uint16_t GetCodePageFromStringA(const char* pStr, int32_t iLength) { ASSERT(pStr); if (iLength < 0) { iLength = FXSYS_strlen(pStr); @@ -325,7 +325,7 @@ uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage) { return 0xFFFF; } -uint16_t FX_GetCodePageFromStringW(const FX_WCHAR* pStr, int32_t iLength) { +uint16_t FX_GetCodePageFromStringW(const wchar_t* pStr, int32_t iLength) { if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } @@ -333,21 +333,21 @@ uint16_t FX_GetCodePageFromStringW(const FX_WCHAR* pStr, int32_t iLength) { return 0xFFFF; } CFX_ByteString csStr; - FX_CHAR* pBuf = csStr.GetBuffer(iLength + 1); + char* pBuf = csStr.GetBuffer(iLength + 1); for (int32_t i = 0; i < iLength; ++i) { - *pBuf++ = (FX_CHAR)*pStr++; + *pBuf++ = (char)*pStr++; } csStr.ReleaseBuffer(iLength); return GetCodePageFromStringA(csStr.c_str(), iLength); } -void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { +void FX_SwapByteOrder(wchar_t* pStr, int32_t iLength) { ASSERT(pStr); if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } uint16_t wch; - if (sizeof(FX_WCHAR) > 2) { + if (sizeof(wchar_t) > 2) { while (iLength-- > 0) { wch = (uint16_t)*pStr; wch = (wch >> 8) | (wch << 8); @@ -365,20 +365,20 @@ void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) { ASSERT(pBuffer && iLength > 0); - if (sizeof(FX_WCHAR) == 2) { + if (sizeof(wchar_t) == 2) { return; } uint16_t* pSrc = (uint16_t*)pBuffer; - FX_WCHAR* pDst = (FX_WCHAR*)pBuffer; + wchar_t* pDst = (wchar_t*)pBuffer; while (--iLength >= 0) { - pDst[iLength] = (FX_WCHAR)pSrc[iLength]; + pDst[iLength] = (wchar_t)pSrc[iLength]; } } int32_t FX_DecodeString(uint16_t wCodePage, - const FX_CHAR* pSrc, + const char* pSrc, int32_t* pSrcLen, - FX_WCHAR* pDst, + wchar_t* pDst, int32_t* pDstLen, bool bErrBreak) { if (wCodePage == FX_CODEPAGE_UTF8) { @@ -386,9 +386,9 @@ int32_t FX_DecodeString(uint16_t wCodePage, } return -1; } -int32_t FX_UTF8Decode(const FX_CHAR* pSrc, +int32_t FX_UTF8Decode(const char* pSrc, int32_t* pSrcLen, - FX_WCHAR* pDst, + wchar_t* pDst, int32_t* pDstLen) { if (!pSrcLen || !pDstLen) { return -1; -- cgit v1.2.3