diff options
author | dsinclair <dsinclair@chromium.org> | 2016-04-27 12:26:00 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-27 12:26:01 -0700 |
commit | 43854a5073602a4613131aa6dbac5f7b9a095bcd (patch) | |
tree | 653ebf0cd690e13d1ca9e315ffeb34f8ac85cfbb /xfa/fde/css/fde_cssstylesheet.cpp | |
parent | b2f6f9158f54cee1825830c7ed57fe9d89cff26e (diff) | |
download | pdfium-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 'xfa/fde/css/fde_cssstylesheet.cpp')
-rw-r--r-- | xfa/fde/css/fde_cssstylesheet.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/xfa/fde/css/fde_cssstylesheet.cpp b/xfa/fde/css/fde_cssstylesheet.cpp index 15358c2942..4f2930dd0e 100644 --- a/xfa/fde/css/fde_cssstylesheet.cpp +++ b/xfa/fde/css/fde_cssstylesheet.cpp @@ -75,7 +75,7 @@ CFDE_CSSStyleSheet::CFDE_CSSStyleSheet(uint32_t dwMediaList) m_wRefCount(1), m_dwMediaList(dwMediaList), m_pAllocator(NULL) { - FXSYS_assert(m_dwMediaList > 0); + ASSERT(m_dwMediaList > 0); } CFDE_CSSStyleSheet::~CFDE_CSSStyleSheet() { Reset(); @@ -94,7 +94,7 @@ void CFDE_CSSStyleSheet::Reset() { ((CFDE_CSSFontFaceRule*)pRule)->~CFDE_CSSFontFaceRule(); break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } } @@ -125,7 +125,7 @@ IFDE_CSSRule* CFDE_CSSStyleSheet::GetRule(int32_t index) { FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl, IFX_Stream* pStream, uint16_t wCodePage) { - FXSYS_assert(pStream != NULL); + ASSERT(pStream != NULL); IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create(); if (pSyntax == NULL) { return FALSE; @@ -143,7 +143,7 @@ FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl, const FX_WCHAR* pBuffer, int32_t iBufSize, uint16_t wCodePage) { - FXSYS_assert(pBuffer != NULL && iBufSize > 0); + ASSERT(pBuffer != NULL && iBufSize > 0); IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create(); if (pSyntax == NULL) { return FALSE; @@ -365,7 +365,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSStyleSheet::SkipRuleSet( } void CFDE_CSSStyleRule::SetSelector(IFX_MEMAllocator* pStaticStore, const CFDE_CSSSelectorArray& list) { - FXSYS_assert(m_ppSelector == NULL); + ASSERT(m_ppSelector == NULL); m_iSelectors = list.GetSize(); m_ppSelector = (IFDE_CSSSelector**)pStaticStore->Alloc( m_iSelectors * sizeof(IFDE_CSSSelector*)); @@ -381,7 +381,7 @@ CFDE_CSSMediaRule::~CFDE_CSSMediaRule() { ((CFDE_CSSStyleRule*)pRule)->~CFDE_CSSStyleRule(); break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } } @@ -390,7 +390,7 @@ inline FX_BOOL FDE_IsCSSChar(FX_WCHAR wch) { return (wch >= 'a' && wch <= 'z') || (wch >= 'A' && wch <= 'Z'); } int32_t FDE_GetCSSPersudoLen(const FX_WCHAR* psz, const FX_WCHAR* pEnd) { - FXSYS_assert(*psz == ':'); + ASSERT(*psz == ':'); const FX_WCHAR* pStart = psz; while (psz < pEnd) { FX_WCHAR wch = *psz; @@ -418,7 +418,7 @@ int32_t FDE_GetCSSNameLen(const FX_WCHAR* psz, const FX_WCHAR* pEnd) { IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, const FX_WCHAR* psz, int32_t iLen) { - FXSYS_assert(pStaticStore != NULL && psz != NULL && iLen > 0); + ASSERT(pStaticStore != NULL && psz != NULL && iLen > 0); const FX_WCHAR* pStart = psz; const FX_WCHAR* pEnd = psz + iLen; for (; psz < pEnd; ++psz) { @@ -446,7 +446,7 @@ IFDE_CSSSelector* CFDE_CSSSelector::FromString(IFX_MEMAllocator* pStaticStore, } pFirst = pLast = p; } - FXSYS_assert(pLast != NULL); + ASSERT(pLast != NULL); int32_t iNameLen = FDE_GetCSSNameLen(++psz, pEnd); if (iNameLen == 0) { return NULL; |