summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_extension.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-27 12:26:00 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-27 12:26:01 -0700
commit43854a5073602a4613131aa6dbac5f7b9a095bcd (patch)
tree653ebf0cd690e13d1ca9e315ffeb34f8ac85cfbb /core/fxcrt/fx_extension.cpp
parentb2f6f9158f54cee1825830c7ed57fe9d89cff26e (diff)
downloadpdfium-43854a5073602a4613131aa6dbac5f7b9a095bcd.tar.xz
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
Diffstat (limited to 'core/fxcrt/fx_extension.cpp')
-rw-r--r--core/fxcrt/fx_extension.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 53fcf45ef5..0b55fc91dd 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -129,7 +129,7 @@ FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x) {
FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr,
int32_t iLength,
int32_t* pUsedLen) {
- FXSYS_assert(pcsStr);
+ ASSERT(pcsStr);
if (iLength < 0) {
iLength = (int32_t)FXSYS_strlen(pcsStr);
}
@@ -140,7 +140,7 @@ FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr,
FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr,
int32_t iLength,
int32_t* pUsedLen) {
- FXSYS_assert(pwsStr);
+ ASSERT(pwsStr);
if (iLength < 0) {
iLength = (int32_t)FXSYS_wcslen(pwsStr);
}
@@ -186,7 +186,7 @@ FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr,
FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr,
const FX_WCHAR* srcStr,
size_t count) {
- FXSYS_assert(dstStr && srcStr && count > 0);
+ ASSERT(dstStr && srcStr && count > 0);
for (size_t i = 0; i < count; ++i)
if ((dstStr[i] = srcStr[i]) == L'\0') {
break;
@@ -194,7 +194,7 @@ FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr,
return dstStr;
}
int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) {
- FXSYS_assert(s1 && s2 && count > 0);
+ ASSERT(s1 && s2 && count > 0);
FX_WCHAR wch1 = 0, wch2 = 0;
while (count-- > 0) {
wch1 = (FX_WCHAR)FXSYS_tolower(*s1++);
@@ -206,7 +206,7 @@ int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) {
return wch1 - wch2;
}
int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count) {
- FXSYS_assert(s1 && s2 && count > 0);
+ ASSERT(s1 && s2 && count > 0);
FX_CHAR ch1 = 0, ch2 = 0;
while (count-- > 0) {
ch1 = (FX_CHAR)FXSYS_tolower(*s1++);
@@ -262,7 +262,7 @@ void* FX_Random_MT_Start(uint32_t dwSeed) {
return pContext;
}
uint32_t FX_Random_MT_Generate(void* pContext) {
- FXSYS_assert(pContext);
+ ASSERT(pContext);
FX_MTRANDOMCONTEXT* pMTC = static_cast<FX_MTRANDOMCONTEXT*>(pContext);
uint32_t v;
static uint32_t mag[2] = {0, MT_Matrix_A};
@@ -293,7 +293,7 @@ uint32_t FX_Random_MT_Generate(void* pContext) {
return v;
}
void FX_Random_MT_Close(void* pContext) {
- FXSYS_assert(pContext);
+ ASSERT(pContext);
FX_Free(pContext);
}
void FX_Random_GenerateMT(uint32_t* pBuffer, int32_t iCount) {