From 43854a5073602a4613131aa6dbac5f7b9a095bcd Mon Sep 17 00:00:00 2001 From: dsinclair Date: Wed, 27 Apr 2016 12:26:00 -0700 Subject: Standardize on ASSERT. There are currently three ways to assert in the code (ASSERT, FXSYS_assert and assert). This CL standardizes on ASSERT. The benefit of ASSERT is that it can be overridden if the platform requies and we can pickup the Chromium version if it has already been defined in the build. This does change behaviour. Currently FXSYS_assert is always defined but ASSERT is only defined in debug builds. So, the FXSYS_assert's would fire in Release builds. That will no longer happen. BUG=pdfium:219 Review-Url: https://codereview.chromium.org/1914303003 --- xfa/fgas/crt/fgas_codepage.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 36c40a6469..7362a89d30 100644 --- a/xfa/fgas/crt/fgas_codepage.cpp +++ b/xfa/fgas/crt/fgas_codepage.cpp @@ -19,7 +19,7 @@ static const FX_CHARSET_MAP g_FXCharset2CodePageTable[] = { }; uint16_t FX_GetCodePageFromCharset(uint8_t charset) { int32_t iEnd = sizeof(g_FXCharset2CodePageTable) / sizeof(FX_CHARSET_MAP) - 1; - FXSYS_assert(iEnd >= 0); + ASSERT(iEnd >= 0); int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; @@ -45,7 +45,7 @@ static const FX_CHARSET_MAP g_FXCodepage2CharsetTable[] = { }; uint16_t FX_GetCharsetFromCodePage(uint16_t codepage) { int32_t iEnd = sizeof(g_FXCodepage2CharsetTable) / sizeof(FX_CHARSET_MAP) - 1; - FXSYS_assert(iEnd >= 0); + ASSERT(iEnd >= 0); int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; @@ -199,7 +199,7 @@ const FX_LANG2CPMAP g_FXLang2CodepageTable[] = { }; uint16_t FX_GetDefCodePageByLanguage(uint16_t wLanguage) { int32_t iEnd = sizeof(g_FXLang2CodepageTable) / sizeof(FX_LANG2CPMAP) - 1; - FXSYS_assert(iEnd >= 0); + ASSERT(iEnd >= 0); int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; @@ -302,7 +302,7 @@ static const FX_STR2CPHASH g_FXCPHashTable[] = { {0xf637e157, 0x478}, {0xfc213f3a, 0x2717}, {0xff654d14, 0x3b5}, }; uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { - FXSYS_assert(pStr != NULL); + ASSERT(pStr != NULL); if (iLength < 0) { iLength = FXSYS_strlen(pStr); } @@ -312,7 +312,7 @@ uint16_t FX_GetCodePageFromStringA(const FX_CHAR* pStr, int32_t iLength) { uint32_t uHash = FX_HashCode_GetA(CFX_ByteStringC(pStr, iLength), true); int32_t iStart = 0; int32_t iEnd = sizeof(g_FXCPHashTable) / sizeof(FX_STR2CPHASH) - 1; - FXSYS_assert(iEnd >= 0); + ASSERT(iEnd >= 0); do { int32_t iMid = (iStart + iEnd) / 2; const FX_STR2CPHASH& cp = g_FXCPHashTable[iMid]; -- cgit v1.2.3