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 /core/fpdfapi/fpdf_edit | |
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 'core/fpdfapi/fpdf_edit')
-rw-r--r-- | core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index 3b5012fdec..2c4dc32fde 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -193,7 +193,7 @@ int32_t PDF_CreatorWriteTrailer(CPDF_Document* pDocument, FX_BOOL bCompress) { FX_FILESIZE offset = 0; int32_t len = 0; - FXSYS_assert(pDocument && pFile); + ASSERT(pDocument && pFile); CPDF_Parser* pParser = (CPDF_Parser*)pDocument->GetParser(); if (pParser) { CPDF_Dictionary* p = pParser->GetTrailer(); @@ -283,7 +283,7 @@ int32_t PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict, if (!pEncryptDict) { return 0; } - FXSYS_assert(pFile); + ASSERT(pFile); FX_FILESIZE offset = 0; int32_t len = 0; if (pFile->AppendString("/Encrypt") < 0) { @@ -538,7 +538,7 @@ void CPDF_ObjectStream::CompressIndirectObject(uint32_t dwObjNum, } FX_FILESIZE CPDF_ObjectStream::End(CPDF_Creator* pCreator) { - FXSYS_assert(pCreator); + ASSERT(pCreator); if (m_Items.empty()) return 0; @@ -1467,7 +1467,7 @@ void CPDF_Creator::AppendNewObjNum(uint32_t objbum) { m_NewObjNumArray.InsertAt(iFind, objbum); } int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause* pPause) { - FXSYS_assert(m_iStage > -1 || m_iStage < 20); + ASSERT(m_iStage > -1 || m_iStage < 20); if (m_iStage == 0) { if (!m_pParser) { m_dwFlags &= ~FPDFCREATE_INCREMENTAL; @@ -1562,7 +1562,7 @@ int32_t CPDF_Creator::WriteDoc_Stage1(IFX_Pause* pPause) { return m_iStage; } int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause* pPause) { - FXSYS_assert(m_iStage >= 20 || m_iStage < 30); + ASSERT(m_iStage >= 20 || m_iStage < 30); if (m_iStage == 20) { if ((m_dwFlags & FPDFCREATE_INCREMENTAL) == 0 && m_pParser) { m_Pos = (void*)(uintptr_t)0; @@ -1609,7 +1609,7 @@ int32_t CPDF_Creator::WriteDoc_Stage2(IFX_Pause* pPause) { return m_iStage; } int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause* pPause) { - FXSYS_assert(m_iStage >= 80 || m_iStage < 90); + ASSERT(m_iStage >= 80 || m_iStage < 90); uint32_t dwLastObjNum = m_dwLastObjNum; if (m_iStage == 80) { m_XrefStart = m_Offset; @@ -1723,7 +1723,7 @@ int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause* pPause) { } int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause* pPause) { - FXSYS_assert(m_iStage >= 90); + ASSERT(m_iStage >= 90); if ((m_dwFlags & FPDFCREATE_OBJECTSTREAM) == 0) { FX_BOOL bXRefStream = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser->IsXRefStream(); |