summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/fgas_codepage.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-13 16:43:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 14:14:51 +0000
commit812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 (patch)
treef0b0607f6b757eb22237527215094bd87b5d03ba /xfa/fgas/crt/fgas_codepage.cpp
parent893822aa5b6254591f8e80fbffcbb4fa6ad849aa (diff)
downloadpdfium-812e96c2b4c5908a1979da5e27cdcecda0d1dfc9.tar.xz
Replace FX_CHAR and FX_WCHAR with underlying types.
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fgas/crt/fgas_codepage.cpp')
-rw-r--r--xfa/fgas/crt/fgas_codepage.cpp26
1 files changed, 13 insertions, 13 deletions
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;