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 --- core/fdrm/crypto/fx_crypt_sha.cpp | 4 +- core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 14 +-- core/fpdfapi/fpdf_page/cpdf_colorspace.cpp | 2 +- core/fpdfapi/fpdf_page/cpdf_countedobject.h | 2 +- core/fpdfapi/fpdf_parser/cpdf_document.cpp | 6 +- core/fpdfdoc/doc_ocg.cpp | 4 +- core/fxcodec/codec/fx_codec.cpp | 4 +- core/fxcodec/codec/fx_codec_jpeg.cpp | 2 +- core/fxcrt/cfx_string_data_template.h | 14 +-- core/fxcrt/fx_arabic.cpp | 94 +++++++++--------- core/fxcrt/fx_basic_bstring.cpp | 6 +- core/fxcrt/fx_basic_buffer.cpp | 2 +- core/fxcrt/fx_basic_utf.cpp | 2 +- core/fxcrt/fx_basic_wstring.cpp | 6 +- core/fxcrt/fx_extension.cpp | 14 +-- core/fxcrt/include/fx_basic.h | 12 +-- core/fxcrt/include/fx_ext.h | 2 +- core/fxcrt/include/fx_system.h | 3 +- core/fxcrt/xml_int.h | 2 +- fpdfsdk/fsdk_baseform.cpp | 6 +- testing/utils/path_service.cpp | 2 +- xfa/fde/css/fde_csscache.cpp | 6 +- xfa/fde/css/fde_cssdatatable.cpp | 22 ++--- xfa/fde/css/fde_cssdatatable.h | 24 ++--- xfa/fde/css/fde_cssdeclaration.cpp | 8 +- xfa/fde/css/fde_cssstyleselector.cpp | 30 +++--- xfa/fde/css/fde_cssstylesheet.cpp | 18 ++-- xfa/fde/css/fde_csssyntax.cpp | 12 +-- xfa/fde/fde_gedevice.cpp | 7 +- xfa/fde/fde_iterator.cpp | 8 +- xfa/fde/fde_render.cpp | 6 +- xfa/fde/tto/fde_textout.cpp | 16 +-- xfa/fde/xml/fde_xml_imp.cpp | 44 ++++----- xfa/fee/fde_txtedtbuf.cpp | 38 +++---- xfa/fee/fde_txtedtengine.cpp | 38 +++---- xfa/fee/fde_txtedtpage.cpp | 8 +- xfa/fee/fde_txtedtparag.cpp | 8 +- xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp | 8 +- xfa/fgas/crt/fgas_algorithm.cpp | 8 +- xfa/fgas/crt/fgas_algorithm.h | 2 +- xfa/fgas/crt/fgas_codepage.cpp | 10 +- xfa/fgas/crt/fgas_encode.cpp | 12 +-- xfa/fgas/crt/fgas_memory.cpp | 44 ++++----- xfa/fgas/crt/fgas_stream.cpp | 110 ++++++++++----------- xfa/fgas/crt/fgas_system.cpp | 8 +- xfa/fgas/crt/fgas_utils.cpp | 56 +++++------ xfa/fgas/crt/fgas_utils.h | 14 +-- xfa/fgas/font/fgas_fontutils.cpp | 2 +- xfa/fgas/font/fgas_gefont.cpp | 14 +-- xfa/fgas/font/fgas_stdfontmgr.cpp | 16 +-- xfa/fgas/layout/fgas_rtfbreak.cpp | 26 ++--- xfa/fgas/layout/fgas_rtfbreak.h | 18 ++-- xfa/fgas/layout/fgas_textbreak.cpp | 16 +-- xfa/fgas/layout/fgas_textbreak.h | 10 +- xfa/fgas/layout/fgas_unicode.cpp | 4 +- xfa/fgas/localization/fgas_datetime.cpp | 26 ++--- xfa/fgas/localization/fgas_locale.cpp | 6 +- xfa/fgas/xml/fgas_sax_imp.cpp | 20 ++-- xfa/fwl/basewidget/fwl_comboboximp.cpp | 2 +- xfa/fwl/basewidget/fwl_monthcalendarimp.cpp | 4 +- xfa/fwl/core/fwl_widgetimp.cpp | 2 +- xfa/fwl/core/fwl_widgetmgrimp.cpp | 2 +- xfa/fwl/lightwidget/cfwl_widget.cpp | 2 +- xfa/fxfa/app/xfa_checksum.cpp | 2 +- xfa/fxfa/app/xfa_ffdoc.cpp | 2 +- xfa/fxfa/app/xfa_ffdocview.cpp | 2 +- xfa/fxfa/app/xfa_fffield.cpp | 2 +- xfa/fxfa/app/xfa_ffpageview.cpp | 2 +- xfa/fxfa/app/xfa_ffpushbutton.cpp | 2 +- xfa/fxfa/app/xfa_ffsignature.cpp | 2 +- xfa/fxfa/app/xfa_ffwidget.cpp | 2 +- xfa/fxfa/app/xfa_ffwidgetacc.cpp | 6 +- xfa/fxfa/app/xfa_ffwidgetacc.h | 2 +- xfa/fxfa/app/xfa_fontmgr.cpp | 2 +- xfa/fxfa/app/xfa_fwltheme.cpp | 2 +- xfa/fxfa/app/xfa_textlayout.cpp | 10 +- xfa/fxfa/app/xfa_textlayout.h | 4 +- xfa/fxfa/fm2js/xfa_fm2jscontext.cpp | 36 +++---- xfa/fxfa/fm2js/xfa_simpleexpression.cpp | 8 +- xfa/fxfa/parser/cxfa_widgetdata.cpp | 4 +- .../parser/xfa_document_datadescription_imp.cpp | 6 +- xfa/fxfa/parser/xfa_document_datamerger_imp.cpp | 42 ++++---- xfa/fxfa/parser/xfa_document_serialize.cpp | 12 +-- xfa/fxfa/parser/xfa_layout_itemlayout.cpp | 4 +- xfa/fxfa/parser/xfa_localemgr.cpp | 2 +- xfa/fxfa/parser/xfa_localevalue.cpp | 10 +- xfa/fxfa/parser/xfa_object_imp.cpp | 50 +++++----- xfa/fxfa/parser/xfa_parser_imp.cpp | 8 +- xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp | 2 +- xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp | 2 +- xfa/fxfa/parser/xfa_script_resolveprocessor.cpp | 4 +- xfa/fxjse/class.cpp | 2 +- 92 files changed, 585 insertions(+), 587 deletions(-) diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp index ed5da2f504..222ab9eb80 100644 --- a/core/fdrm/crypto/fx_crypt_sha.cpp +++ b/core/fdrm/crypto/fx_crypt_sha.cpp @@ -369,7 +369,7 @@ typedef struct { uint8_t buffer[128]; } sha384_context; uint64_t FX_ato64i(const FX_CHAR* str) { - FXSYS_assert(str); + ASSERT(str); uint64_t ret = 0; int len = (int)FXSYS_strlen(str); len = len > 16 ? 16 : len; @@ -384,7 +384,7 @@ uint64_t FX_ato64i(const FX_CHAR* str) { } else if (str[i] >= 'A' && str[i] <= 'F') { ret |= (str[i] - 'A' + 10) & 0xFF; } else { - FXSYS_assert(FALSE); + ASSERT(FALSE); } } return ret; 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(); diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp index 32e2945818..48fdc1c914 100644 --- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp +++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp @@ -676,7 +676,7 @@ void CPDF_LabCS::GetDefaultValue(int iComponent, FX_FLOAT& value, FX_FLOAT& min, FX_FLOAT& max) const { - assert(iComponent < 3); + ASSERT(iComponent < 3); value = 0; if (iComponent == 0) { min = 0; diff --git a/core/fpdfapi/fpdf_page/cpdf_countedobject.h b/core/fpdfapi/fpdf_page/cpdf_countedobject.h index da840bec60..e7f4ab6af0 100644 --- a/core/fpdfapi/fpdf_page/cpdf_countedobject.h +++ b/core/fpdfapi/fpdf_page/cpdf_countedobject.h @@ -25,7 +25,7 @@ class CPDF_CountedObject { } T* get() const { return m_pObj; } T* AddRef() { - FXSYS_assert(m_pObj); + ASSERT(m_pObj); ++m_nCount; return m_pObj; } diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp index ead1ac0455..39694c1c1a 100644 --- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp +++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp @@ -238,7 +238,7 @@ const FX_LANG2CS gs_FXLang2CharsetTable[] = { }; uint32_t FX_GetLangHashCode(const FX_CHAR* pStr) { - FXSYS_assert(pStr); + ASSERT(pStr); int32_t iLength = FXSYS_strlen(pStr); const FX_CHAR* pStrEnd = pStr + iLength; uint32_t uHashCode = 0; @@ -265,7 +265,7 @@ uint8_t FX_GetCsFromLangCode(uint32_t uCode) { } uint8_t FX_GetCharsetFromLang(const FX_CHAR* pLang, int32_t iLength) { - FXSYS_assert(pLang); + ASSERT(pLang); if (iLength < 0) iLength = FXSYS_strlen(pLang); @@ -765,7 +765,7 @@ CPDF_Image* CPDF_Document::LoadImageF(CPDF_Object* pObj) { if (!pObj) return nullptr; - FXSYS_assert(pObj->GetObjNum()); + ASSERT(pObj->GetObjNum()); return m_pDocPage->GetImage(pObj); } diff --git a/core/fpdfdoc/doc_ocg.cpp b/core/fpdfdoc/doc_ocg.cpp index bc5c00b540..2249574b7f 100644 --- a/core/fpdfdoc/doc_ocg.cpp +++ b/core/fpdfdoc/doc_ocg.cpp @@ -46,7 +46,7 @@ static FX_BOOL FPDFDOC_OCG_HasIntent(const CPDF_Dictionary* pDict, static CPDF_Dictionary* FPDFDOC_OCG_GetConfig(CPDF_Document* pDoc, const CPDF_Dictionary* pOCGDict, const CFX_ByteStringC& bsState) { - FXSYS_assert(pDoc && pOCGDict); + ASSERT(pDoc && pOCGDict); CPDF_Dictionary* pOCProperties = pDoc->GetRoot()->GetDictBy("OCProperties"); if (!pOCProperties) { return NULL; @@ -89,7 +89,7 @@ static CFX_ByteString FPDFDOC_OCG_GetUsageTypeString( return csState; } CPDF_OCContext::CPDF_OCContext(CPDF_Document* pDoc, UsageType eUsageType) { - FXSYS_assert(pDoc); + ASSERT(pDoc); m_pDocument = pDoc; m_eUsageType = eUsageType; } diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp index a0356929a5..f0f03ab0e9 100644 --- a/core/fxcodec/codec/fx_codec.cpp +++ b/core/fxcodec/codec/fx_codec.cpp @@ -375,7 +375,7 @@ void CCodec_RLScanlineDecoder::UpdateOperator(uint8_t used_bytes) { return; } if (m_Operator < 128) { - FXSYS_assert((uint32_t)m_Operator + 1 >= used_bytes); + ASSERT((uint32_t)m_Operator + 1 >= used_bytes); if (used_bytes == m_Operator + 1) { m_SrcOffset += used_bytes; GetNextOperator(); @@ -389,7 +389,7 @@ void CCodec_RLScanlineDecoder::UpdateOperator(uint8_t used_bytes) { return; } uint8_t count = 257 - m_Operator; - FXSYS_assert((uint32_t)count >= used_bytes); + ASSERT((uint32_t)count >= used_bytes); if (used_bytes == count) { m_SrcOffset++; GetNextOperator(); diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index 608bf52969..ebe6106945 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -457,7 +457,7 @@ FX_BOOL CCodec_JpegDecoder::v_Rewind() { return FALSE; } if ((int)cinfo.output_width > m_OrigWidth) { - FXSYS_assert(FALSE); + ASSERT(FALSE); return FALSE; } m_bStarted = TRUE; diff --git a/core/fxcrt/cfx_string_data_template.h b/core/fxcrt/cfx_string_data_template.h index b53b2511c2..225020a7dd 100644 --- a/core/fxcrt/cfx_string_data_template.h +++ b/core/fxcrt/cfx_string_data_template.h @@ -15,7 +15,7 @@ template class CFX_StringDataTemplate { public: static CFX_StringDataTemplate* Create(FX_STRSIZE nLen) { - FXSYS_assert(nLen > 0); + ASSERT(nLen > 0); // Calculate space needed for the fixed portion of the struct plus the // NUL char that is not included in |m_nAllocLength|. @@ -32,7 +32,7 @@ class CFX_StringDataTemplate { nSize += 7; int totalSize = nSize.ValueOrDie() & ~7; int usableLen = (totalSize - overhead) / sizeof(CharType); - FXSYS_assert(usableLen >= nLen); + ASSERT(usableLen >= nLen); void* pData = FX_Alloc(uint8_t, totalSize); return new (pData) CFX_StringDataTemplate(nLen, usableLen); @@ -61,13 +61,13 @@ class CFX_StringDataTemplate { } void CopyContents(const CFX_StringDataTemplate& other) { - FXSYS_assert(other.m_nDataLength <= m_nAllocLength); + ASSERT(other.m_nDataLength <= m_nAllocLength); FXSYS_memcpy(m_String, other.m_String, (other.m_nDataLength + 1) * sizeof(CharType)); } void CopyContents(const CharType* pStr, FX_STRSIZE nLen) { - FXSYS_assert(nLen >= 0 && nLen <= m_nAllocLength); + ASSERT(nLen >= 0 && nLen <= m_nAllocLength); FXSYS_memcpy(m_String, pStr, nLen * sizeof(CharType)); m_String[nLen] = 0; } @@ -75,7 +75,7 @@ class CFX_StringDataTemplate { void CopyContentsAt(FX_STRSIZE offset, const CharType* pStr, FX_STRSIZE nLen) { - FXSYS_assert(offset >= 0 && nLen >= 0 && offset + nLen <= m_nAllocLength); + ASSERT(offset >= 0 && nLen >= 0 && offset + nLen <= m_nAllocLength); FXSYS_memcpy(m_String + offset, pStr, nLen * sizeof(CharType)); m_String[offset + nLen] = 0; } @@ -101,8 +101,8 @@ class CFX_StringDataTemplate { private: CFX_StringDataTemplate(FX_STRSIZE dataLen, FX_STRSIZE allocLen) : m_nRefs(0), m_nDataLength(dataLen), m_nAllocLength(allocLen) { - FXSYS_assert(dataLen >= 0); - FXSYS_assert(dataLen <= allocLen); + ASSERT(dataLen >= 0); + ASSERT(dataLen <= allocLen); m_String[dataLen] = 0; } diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp index 8c5230731f..191350e24d 100644 --- a/core/fxcrt/fx_arabic.cpp +++ b/core/fxcrt/fx_arabic.cpp @@ -218,8 +218,8 @@ const FX_ARBFORMTABLE* CFX_ArabicChar::ParseChar(const CFX_Char* pTC, void FX_BidiReverseString(CFX_WideString& wsText, int32_t iStart, int32_t iCount) { - FXSYS_assert(iStart > -1 && iStart < wsText.GetLength()); - FXSYS_assert(iCount >= 0 && iStart + iCount <= wsText.GetLength()); + ASSERT(iStart > -1 && iStart < wsText.GetLength()); + ASSERT(iCount >= 0 && iStart + iCount <= wsText.GetLength()); FX_WCHAR wch; FX_WCHAR* pStart = const_cast(wsText.c_str()); pStart += iStart; @@ -234,8 +234,8 @@ void FX_BidiSetDeferredRun(CFX_Int32Array& values, int32_t iStart, int32_t iCount, int32_t iValue) { - FXSYS_assert(iStart > -1 && iStart <= values.GetSize()); - FXSYS_assert(iStart - iCount > -1); + ASSERT(iStart > -1 && iStart <= values.GetSize()); + ASSERT(iStart - iCount > -1); for (int32_t i = iStart - 1; i >= iStart - iCount; i--) { values.SetAt(i, iValue); } @@ -250,7 +250,7 @@ const int32_t gc_FX_BidiNTypes[] = { void FX_BidiClassify(const CFX_WideString& wsText, CFX_Int32Array& classes, FX_BOOL bWS) { - FXSYS_assert(wsText.GetLength() == classes.GetSize()); + ASSERT(wsText.GetLength() == classes.GetSize()); int32_t iCount = wsText.GetLength(); const FX_WCHAR* pwsStart = wsText.c_str(); FX_WCHAR wch; @@ -280,10 +280,10 @@ int32_t FX_BidiResolveExplicit(int32_t iBaseLevel, int32_t iStart, int32_t iCount, int32_t iNest) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL && iNest >= 0); - FXSYS_assert(classes.GetSize() == levels.GetSize()); - FXSYS_assert(iStart >= 0 && iStart < classes.GetSize()); - FXSYS_assert(iCount >= 0 && iStart + iCount <= classes.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL && iNest >= 0); + ASSERT(classes.GetSize() == levels.GetSize()); + ASSERT(iStart >= 0 && iStart < classes.GetSize()); + ASSERT(iCount >= 0 && iStart + iCount <= classes.GetSize()); if (iCount < 1) { return 0; } @@ -390,8 +390,8 @@ const int32_t gc_FX_BidiWeakActions[][10] = { void FX_BidiResolveWeak(int32_t iBaseLevel, CFX_Int32Array& classes, CFX_Int32Array& levels) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(classes.GetSize() == levels.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(classes.GetSize() == levels.GetSize()); int32_t iSize = classes.GetSize(); if (iSize < 1) { return; @@ -403,7 +403,7 @@ void FX_BidiResolveWeak(int32_t iBaseLevel, for (; i <= iSize; i++) { iClsCur = classes.GetAt(i); - FXSYS_assert(iClsCur <= FX_BIDICLASS_BN); + ASSERT(iClsCur <= FX_BIDICLASS_BN); iAction = gc_FX_BidiWeakActions[iState][iClsCur]; iClsRun = FX_BidiGetDeferredType(iAction); if (iClsRun != FX_BIDIWEAKACTION_XX && iCount > 0) { @@ -460,8 +460,8 @@ int32_t FX_BidiGetResolvedNeutrals(int32_t iAction) { void FX_BidiResolveNeutrals(int32_t iBaseLevel, CFX_Int32Array& classes, const CFX_Int32Array& levels) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(classes.GetSize() == levels.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(classes.GetSize() == levels.GetSize()); int32_t iSize = classes.GetSize(); if (iSize < 1) { return; @@ -478,7 +478,7 @@ void FX_BidiResolveNeutrals(int32_t iBaseLevel, } continue; } - FXSYS_assert(iClsCur < FX_BIDICLASS_AL); + ASSERT(iClsCur < FX_BIDICLASS_AL); iAction = gc_FX_BidiNeutralActions[iState][iClsCur]; iClsRun = FX_BidiGetDeferredNeutrals(iAction, iLevel); if (iClsRun != FX_BIDICLASS_N && iCount > 0) { @@ -508,7 +508,7 @@ const int32_t gc_FX_BidiAddLevel[][4] = { }; void FX_BidiResolveImplicit(const CFX_Int32Array& classes, CFX_Int32Array& levels) { - FXSYS_assert(classes.GetSize() == levels.GetSize()); + ASSERT(classes.GetSize() == levels.GetSize()); int32_t iSize = classes.GetSize(); if (iSize < 1) { return; @@ -520,7 +520,7 @@ void FX_BidiResolveImplicit(const CFX_Int32Array& classes, if (iCls == FX_BIDICLASS_BN) { continue; } - FXSYS_assert(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL); + ASSERT(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL); iLevel = levels.GetAt(i); iLevel += gc_FX_BidiAddLevel[FX_IsOdd(iLevel)][iCls - 1]; levels.SetAt(i, iLevel); @@ -529,8 +529,8 @@ void FX_BidiResolveImplicit(const CFX_Int32Array& classes, void FX_BidiResolveWhitespace(int32_t iBaseLevel, const CFX_Int32Array& classes, CFX_Int32Array& levels) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(classes.GetSize() == levels.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(classes.GetSize() == levels.GetSize()); int32_t iSize = classes.GetSize(); if (iSize < 1) { return; @@ -575,9 +575,9 @@ int32_t FX_BidiReorderLevel(int32_t iBaseLevel, const CFX_Int32Array& levels, int32_t iStart, FX_BOOL bReverse) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(wsText.GetLength() == levels.GetSize()); - FXSYS_assert(iStart >= 0 && iStart < wsText.GetLength()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(wsText.GetLength() == levels.GetSize()); + ASSERT(iStart >= 0 && iStart < wsText.GetLength()); int32_t iSize = wsText.GetLength(); if (iSize < 1) { return 0; @@ -602,8 +602,8 @@ int32_t FX_BidiReorderLevel(int32_t iBaseLevel, void FX_BidiReorder(int32_t iBaseLevel, CFX_WideString& wsText, const CFX_Int32Array& levels) { - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(wsText.GetLength() == levels.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(wsText.GetLength() == levels.GetSize()); int32_t iSize = wsText.GetLength(); if (iSize < 1) { return; @@ -639,8 +639,8 @@ class CFX_BidiLineTemplate { void FX_BidiReverseString(CFX_ArrayTemplate& chars, int32_t iStart, int32_t iCount) { - FXSYS_assert(iStart > -1 && iStart < chars.GetSize()); - FXSYS_assert(iCount >= 0 && iStart + iCount <= chars.GetSize()); + ASSERT(iStart > -1 && iStart < chars.GetSize()); + ASSERT(iCount >= 0 && iStart + iCount <= chars.GetSize()); baseType *pStart, *pEnd; int32_t iEnd = iStart + iCount - 1, iTemp; while (iStart < iEnd) { @@ -656,8 +656,8 @@ class CFX_BidiLineTemplate { int32_t iStart, int32_t iCount, int32_t iValue) { - FXSYS_assert(iStart > -1 && iStart <= chars.GetSize()); - FXSYS_assert(iStart - iCount > -1); + ASSERT(iStart > -1 && iStart <= chars.GetSize()); + ASSERT(iStart - iCount > -1); baseType* pTC; int32_t iLast = iStart - iCount; if (bClass) { @@ -675,7 +675,7 @@ class CFX_BidiLineTemplate { void FX_BidiClassify(CFX_ArrayTemplate& chars, int32_t iCount, FX_BOOL bWS) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); baseType* pTC; if (bWS) { for (int32_t i = 0; i < iCount; i++) { @@ -696,8 +696,8 @@ class CFX_BidiLineTemplate { void FX_BidiResolveExplicit(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); if (iCount < 1) { return; } @@ -710,7 +710,7 @@ class CFX_BidiLineTemplate { void FX_BidiResolveWeak(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); iCount--; if (iCount < 1) { return; @@ -754,7 +754,7 @@ class CFX_BidiLineTemplate { continue; } } - FXSYS_assert(iClsCur <= FX_BIDICLASS_BN); + ASSERT(iClsCur <= FX_BIDICLASS_BN); iAction = gc_FX_BidiWeakActions[iState][iClsCur]; iClsRun = FX_BidiGetDeferredType(iAction); if (iClsRun != FX_BIDIWEAKACTION_XX && iNum > 0) { @@ -781,8 +781,8 @@ class CFX_BidiLineTemplate { void FX_BidiResolveNeutrals(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); iCount--; if (iCount < 1) { return; @@ -800,7 +800,7 @@ class CFX_BidiLineTemplate { } continue; } - FXSYS_assert(iClsCur < FX_BIDICLASS_AL); + ASSERT(iClsCur < FX_BIDICLASS_AL); iAction = gc_FX_BidiNeutralActions[iState][iClsCur]; iClsRun = FX_BidiGetDeferredNeutrals(iAction, iLevel); if (iClsRun != FX_BIDICLASS_N && iNum > 0) { @@ -828,7 +828,7 @@ class CFX_BidiLineTemplate { } void FX_BidiResolveImplicit(CFX_ArrayTemplate& chars, int32_t iCount) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); baseType* pTC; int32_t iCls, iLevel; for (int32_t i = 0; i < iCount; i++) { @@ -837,7 +837,7 @@ class CFX_BidiLineTemplate { if (iCls == FX_BIDICLASS_BN) { continue; } - FXSYS_assert(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL); + ASSERT(iCls > FX_BIDICLASS_ON && iCls < FX_BIDICLASS_AL); iLevel = pTC->m_iBidiLevel; iLevel += gc_FX_BidiAddLevel[FX_IsOdd(iLevel)][iCls - 1]; pTC->m_iBidiLevel = (int16_t)iLevel; @@ -846,8 +846,8 @@ class CFX_BidiLineTemplate { void FX_BidiResolveWhitespace(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); if (iCount < 1) { return; } @@ -893,9 +893,9 @@ class CFX_BidiLineTemplate { int32_t iBaseLevel, int32_t iStart, FX_BOOL bReverse) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); - FXSYS_assert(iStart >= 0 && iStart < iCount); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(iStart >= 0 && iStart < iCount); if (iCount < 1) { return 0; } @@ -921,15 +921,15 @@ class CFX_BidiLineTemplate { void FX_BidiReorder(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); - FXSYS_assert(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iBaseLevel >= 0 && iBaseLevel <= FX_BIDIMAXLEVEL); int32_t i = 0; while (i < iCount) { i += FX_BidiReorderLevel(chars, iCount, iBaseLevel, i, FALSE); } } void FX_BidiPosition(CFX_ArrayTemplate& chars, int32_t iCount) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); baseType* pTC; int32_t i = 0; while (i < iCount) { @@ -942,7 +942,7 @@ class CFX_BidiLineTemplate { void FX_BidiLine(CFX_ArrayTemplate& chars, int32_t iCount, int32_t iBaseLevel) { - FXSYS_assert(iCount > -1 && iCount <= chars.GetSize()); + ASSERT(iCount > -1 && iCount <= chars.GetSize()); if (iCount < 2) { return; } diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp index e098d8fe50..cd7b616fbe 100644 --- a/core/fxcrt/fx_basic_bstring.cpp +++ b/core/fxcrt/fx_basic_bstring.cpp @@ -282,7 +282,7 @@ void CFX_ByteString::ReleaseBuffer(FX_STRSIZE nNewLength) { return; } - FXSYS_assert(m_pData->m_nRefs == 1); + ASSERT(m_pData->m_nRefs == 1); m_pData->m_nDataLength = nNewLength; m_pData->m_String[nNewLength] = 0; if (m_pData->m_nAllocLength - nNewLength >= 32) { @@ -808,8 +808,8 @@ void CFX_ByteString::SetAt(FX_STRSIZE nIndex, FX_CHAR ch) { if (!m_pData) { return; } - FXSYS_assert(nIndex >= 0); - FXSYS_assert(nIndex < m_pData->m_nDataLength); + ASSERT(nIndex >= 0); + ASSERT(nIndex < m_pData->m_nDataLength); ReallocBeforeWrite(m_pData->m_nDataLength); m_pData->m_String[nIndex] = ch; } diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp index 338edc16c9..5a75f8b487 100644 --- a/core/fxcrt/fx_basic_buffer.cpp +++ b/core/fxcrt/fx_basic_buffer.cpp @@ -423,6 +423,6 @@ int32_t CFX_FileBufferArchive::AppendString(const CFX_ByteStringC& lpsz) { } void CFX_FileBufferArchive::AttachFile(IFX_StreamWrite* pFile) { - FXSYS_assert(pFile); + ASSERT(pFile); m_pFile = pFile; } diff --git a/core/fxcrt/fx_basic_utf.cpp b/core/fxcrt/fx_basic_utf.cpp index e1996999f8..61b200fab4 100644 --- a/core/fxcrt/fx_basic_utf.cpp +++ b/core/fxcrt/fx_basic_utf.cpp @@ -74,7 +74,7 @@ void CFX_UTF8Encoder::Input(FX_WCHAR unicode) { } } CFX_ByteString FX_UTF8Encode(const FX_WCHAR* pwsStr, FX_STRSIZE len) { - FXSYS_assert(pwsStr); + ASSERT(pwsStr); if (len < 0) { len = FXSYS_wcslen(pwsStr); } diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp index 38fd15e13f..354bb5014a 100644 --- a/core/fxcrt/fx_basic_wstring.cpp +++ b/core/fxcrt/fx_basic_wstring.cpp @@ -230,7 +230,7 @@ void CFX_WideString::ReleaseBuffer(FX_STRSIZE nNewLength) { return; } - FXSYS_assert(m_pData->m_nRefs == 1); + ASSERT(m_pData->m_nRefs == 1); m_pData->m_nDataLength = nNewLength; m_pData->m_String[nNewLength] = 0; if (m_pData->m_nAllocLength - nNewLength >= 32) { @@ -968,7 +968,7 @@ FX_FLOAT CFX_WideString::GetFloat() const { // static CFX_ByteString CFX_CharMap::GetByteString(uint16_t codepage, const CFX_WideStringC& wstr) { - FXSYS_assert(IsValidCodePage(codepage)); + ASSERT(IsValidCodePage(codepage)); int src_len = wstr.GetLength(); int dest_len = FXSYS_WideCharToMultiByte(codepage, 0, wstr.c_str(), src_len, nullptr, 0, nullptr, nullptr); @@ -985,7 +985,7 @@ CFX_ByteString CFX_CharMap::GetByteString(uint16_t codepage, // static CFX_WideString CFX_CharMap::GetWideString(uint16_t codepage, const CFX_ByteStringC& bstr) { - FXSYS_assert(IsValidCodePage(codepage)); + ASSERT(IsValidCodePage(codepage)); int src_len = bstr.GetLength(); int dest_len = FXSYS_MultiByteToWideChar(codepage, 0, bstr.c_str(), src_len, nullptr, 0); 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(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) { diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h index 676996c5d5..5ec55062aa 100644 --- a/core/fxcrt/include/fx_basic.h +++ b/core/fxcrt/include/fx_basic.h @@ -407,7 +407,7 @@ class CFX_ObjectArray : public CFX_BasicArray { if (!nSize) { return 0; } - FXSYS_assert(nStart > -1 && nStart < nSize); + ASSERT(nStart > -1 && nStart < nSize); if (nCount < 0) { nCount = nSize; } @@ -437,7 +437,7 @@ class CFX_ObjectArray : public CFX_BasicArray { if (!nSize) { return 0; } - FXSYS_assert(nStart > -1 && nStart < nSize); + ASSERT(nStart > -1 && nStart < nSize); if (nCount < 0) { nCount = nSize; } @@ -460,7 +460,7 @@ class CFX_ObjectArray : public CFX_BasicArray { int GetSize() const { return m_nSize; } ObjectClass& operator[](int index) const { - FXSYS_assert(index < m_nSize); + ASSERT(index < m_nSize); return *(ObjectClass*)CFX_BasicArray::GetDataPtr(index); } @@ -469,7 +469,7 @@ class CFX_ObjectArray : public CFX_BasicArray { } void RemoveAt(int index) { - FXSYS_assert(index < m_nSize); + ASSERT(index < m_nSize); ((ObjectClass*)GetDataPtr(index))->~ObjectClass(); CFX_BasicArray::RemoveAt(index, 1); } @@ -806,7 +806,7 @@ class CFX_CountRef { } void operator=(void* p) { - FXSYS_assert(p == 0); + ASSERT(p == 0); if (!m_pObject) { return; } @@ -982,7 +982,7 @@ class CFX_ListArrayTemplate { T2& operator[](int32_t nIndex) { uint8_t* data = m_Data.GetAt(nIndex); - FXSYS_assert(data); + ASSERT(data); return (T2&)(*(volatile T2*)data); } diff --git a/core/fxcrt/include/fx_ext.h b/core/fxcrt/include/fx_ext.h index e956d3cb43..b6c05ae9bc 100644 --- a/core/fxcrt/include/fx_ext.h +++ b/core/fxcrt/include/fx_ext.h @@ -110,7 +110,7 @@ template class CFX_SSortTemplate { public: void ShellSort(baseType* pArray, int32_t iCount) { - FXSYS_assert(pArray && iCount > 0); + ASSERT(pArray && iCount > 0); int32_t i, j, gap; baseType v1, v2; gap = iCount >> 1; diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h index 4900634aa5..795a0c2794 100644 --- a/core/fxcrt/include/fx_system.h +++ b/core/fxcrt/include/fx_system.h @@ -95,10 +95,9 @@ static_assert(FALSE == false, "false_needs_to_be_false"); #define NULL 0 #endif -#define FXSYS_assert assert #ifndef ASSERT #ifndef NDEBUG -#define ASSERT FXSYS_assert +#define ASSERT assert #else #define ASSERT(a) #endif diff --git a/core/fxcrt/xml_int.h b/core/fxcrt/xml_int.h index 2dae7b5231..864b4e8789 100644 --- a/core/fxcrt/xml_int.h +++ b/core/fxcrt/xml_int.h @@ -49,7 +49,7 @@ class CXML_DataStmAcc : public IFX_BufferRead { public: explicit CXML_DataStmAcc(IFX_FileRead* pFileRead) : m_pFileRead(pFileRead), m_pBuffer(NULL), m_nStart(0), m_dwSize(0) { - FXSYS_assert(m_pFileRead); + ASSERT(m_pFileRead); } ~CXML_DataStmAcc() override { FX_Free(m_pBuffer); } diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp index 6693de1250..a5cb562a3b 100644 --- a/fpdfsdk/fsdk_baseform.cpp +++ b/fpdfsdk/fsdk_baseform.cpp @@ -2115,17 +2115,17 @@ FX_BOOL CPDFSDK_InterForm::IsCalculateEnabled() const { #ifdef PDF_ENABLE_XFA void CPDFSDK_InterForm::AddXFAMap(CXFA_FFWidget* hWidget, CPDFSDK_XFAWidget* pWidget) { - FXSYS_assert(hWidget); + ASSERT(hWidget); m_XFAMap[hWidget] = pWidget; } void CPDFSDK_InterForm::RemoveXFAMap(CXFA_FFWidget* hWidget) { - FXSYS_assert(hWidget); + ASSERT(hWidget); m_XFAMap.erase(hWidget); } CPDFSDK_XFAWidget* CPDFSDK_InterForm::GetXFAWidget(CXFA_FFWidget* hWidget) { - FXSYS_assert(hWidget); + ASSERT(hWidget); auto it = m_XFAMap.find(hWidget); return it != m_XFAMap.end() ? it->second : nullptr; } diff --git a/testing/utils/path_service.cpp b/testing/utils/path_service.cpp index 9b2657406d..c3b8f40d18 100644 --- a/testing/utils/path_service.cpp +++ b/testing/utils/path_service.cpp @@ -33,7 +33,7 @@ bool PathService::GetExecutableDir(std::string* path) { return false; *path = std::string(path_buffer); #elif defined(__APPLE__) - FXSYS_assert(path); + ASSERT(path); unsigned int path_length = 0; _NSGetExecutablePath(NULL, &path_length); if (path_length == 0) diff --git a/xfa/fde/css/fde_csscache.cpp b/xfa/fde/css/fde_csscache.cpp index 9a259e1844..0b21dcdea3 100644 --- a/xfa/fde/css/fde_csscache.cpp +++ b/xfa/fde/css/fde_csscache.cpp @@ -13,7 +13,7 @@ FDE_CSSCacheItem::FDE_CSSCacheItem(IFDE_CSSStyleSheet* p) : pStylesheet(p), dwActivity(0) { - FXSYS_assert(pStylesheet); + ASSERT(pStylesheet); pStylesheet->AddRef(); } @@ -64,7 +64,7 @@ void CFDE_CSSAccelerator::OnEnterTag(CXFA_CSSTagProvider* pTag) { } void CFDE_CSSAccelerator::OnLeaveTag(CXFA_CSSTagProvider* pTag) { - FXSYS_assert(m_Stack.GetTopElement()); - FXSYS_assert(m_Stack.GetTopElement()->GetTag() == pTag); + ASSERT(m_Stack.GetTopElement()); + ASSERT(m_Stack.GetTopElement()->GetTag() == pTag); m_Stack.Pop(); } diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp index f37f77b86c..853666f4ed 100644 --- a/xfa/fde/css/fde_cssdatatable.cpp +++ b/xfa/fde/css/fde_cssdatatable.cpp @@ -30,7 +30,7 @@ CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle, FX_BOOL bPadding, FX_BOOL bBorder, FX_BOOL bMargin) { - FXSYS_assert(pBoundStyle != NULL); + ASSERT(pBoundStyle != NULL); FX_FLOAT fResult; const FDE_CSSRECT* pRect; CFX_FloatRect rect(0, 0, 0, 0); @@ -88,7 +88,7 @@ CFX_FloatRect FDE_CSSBoundaryToRect(IFDE_CSSBoundaryStyle* pBoundStyle, return rect; } uint32_t FDE_CSSFontStyleToFDE(IFDE_CSSFontStyle* pFontStyle) { - FXSYS_assert(pFontStyle != NULL); + ASSERT(pFontStyle != NULL); uint32_t dwFontStyle = FX_FONTSTYLE_Normal; if (pFontStyle->GetFontStyle() == FDE_CSSFONTSTYLE_Italic) { dwFontStyle |= FX_FONTSTYLE_Italic; @@ -559,7 +559,7 @@ FDE_LPCCSSPERSUDOTABLE FDE_GetCSSPersudoByEnum(FDE_CSSPERSUDO ePersudo) { } FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByName( const CFX_WideStringC& wsName) { - FXSYS_assert(!wsName.IsEmpty()); + ASSERT(!wsName.IsEmpty()); uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = FDE_CSSPROPERTY_MAX - 1; int32_t iMid, iStart = 0; @@ -582,7 +582,7 @@ FDE_LPCCSSPROPERTYTABLE FDE_GetCSSPropertyByEnum(FDE_CSSPROPERTY eName) { } FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByName( const CFX_WideStringC& wsName) { - FXSYS_assert(!wsName.IsEmpty()); + ASSERT(!wsName.IsEmpty()); uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = FDE_CSSPROPERTYVALUE_MAX - 1; int32_t iMid, iStart = 0; @@ -607,7 +607,7 @@ FDE_LPCCSSPROPERTYVALUETABLE FDE_GetCSSPropertyValueByEnum( } FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( const CFX_WideStringC& wsName) { - FXSYS_assert(!wsName.IsEmpty()); + ASSERT(!wsName.IsEmpty()); uint16_t wHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSMediaTypes) / sizeof(FDE_CSSMEDIATYPETABLE) - 1; @@ -628,7 +628,7 @@ FDE_LPCCSSMEDIATYPETABLE FDE_GetCSSMediaTypeByName( } FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( const CFX_WideStringC& wsName) { - FXSYS_assert(!wsName.IsEmpty()); + ASSERT(!wsName.IsEmpty()); uint16_t wHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSLengthUnits) / sizeof(FDE_CSSLENGTHUNITTABLE) - 1; @@ -648,7 +648,7 @@ FDE_LPCCSSLENGTHUNITTABLE FDE_GetCSSLengthUnitByName( return NULL; } FDE_LPCCSSCOLORTABLE FDE_GetCSSColorByName(const CFX_WideStringC& wsName) { - FXSYS_assert(!wsName.IsEmpty()); + ASSERT(!wsName.IsEmpty()); uint32_t dwHash = FX_HashCode_GetW(wsName, true); int32_t iEnd = sizeof(g_FDE_CSSColors) / sizeof(FDE_CSSCOLORTABLE) - 1; int32_t iMid, iStart = 0; @@ -670,7 +670,7 @@ FX_BOOL FDE_ParseCSSNumber(const FX_WCHAR* pszValue, int32_t iValueLen, FX_FLOAT& fValue, FDE_CSSPRIMITIVETYPE& eUnit) { - FXSYS_assert(pszValue != NULL && iValueLen > 0); + ASSERT(pszValue != NULL && iValueLen > 0); int32_t iUsedLen = 0; fValue = FX_wcstof(pszValue, iValueLen, &iUsedLen); if (iUsedLen <= 0) { @@ -695,7 +695,7 @@ FX_BOOL FDE_ParseCSSString(const FX_WCHAR* pszValue, int32_t iValueLen, int32_t& iOffset, int32_t& iLength) { - FXSYS_assert(pszValue != NULL && iValueLen > 0); + ASSERT(pszValue != NULL && iValueLen > 0); iOffset = 0; iLength = iValueLen; if (iValueLen >= 2) { @@ -711,7 +711,7 @@ FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue, int32_t iValueLen, int32_t& iOffset, int32_t& iLength) { - FXSYS_assert(pszValue != NULL && iValueLen > 0); + ASSERT(pszValue != NULL && iValueLen > 0); if (iValueLen < 6 || pszValue[iValueLen - 1] != ')' || FX_wcsnicmp(L"url(", pszValue, 4)) { return FALSE; @@ -726,7 +726,7 @@ FX_BOOL FDE_ParseCSSURI(const FX_WCHAR* pszValue, FX_BOOL FDE_ParseCSSColor(const FX_WCHAR* pszValue, int32_t iValueLen, FX_ARGB& dwColor) { - FXSYS_assert(pszValue != NULL && iValueLen > 0); + ASSERT(pszValue != NULL && iValueLen > 0); if (*pszValue == '#') { switch (iValueLen) { case 4: { diff --git a/xfa/fde/css/fde_cssdatatable.h b/xfa/fde/css/fde_cssdatatable.h index a066c29f94..dda04c4691 100644 --- a/xfa/fde/css/fde_cssdatatable.h +++ b/xfa/fde/css/fde_cssdatatable.h @@ -15,7 +15,7 @@ class CFDE_CSSFunction : public CFX_Target { public: CFDE_CSSFunction(const FX_WCHAR* pszFuncName, IFDE_CSSValueList* pArgList) : m_pArgList(pArgList), m_pszFuncName(pszFuncName) { - FXSYS_assert(pArgList != NULL); + ASSERT(pArgList != NULL); } int32_t CountArgs() const { return m_pArgList->CountValues(); } IFDE_CSSValue* GetArgs(int32_t index) const { @@ -39,7 +39,7 @@ class CFDE_CSSPrimitiveValue : public IFDE_CSSPrimitiveValue, : m_eType(eType), m_fNumber(fValue) {} CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType, const FX_WCHAR* pValue) : m_eType(eType), m_pString(pValue) { - FXSYS_assert(m_pString != NULL); + ASSERT(m_pString != NULL); } CFDE_CSSPrimitiveValue(CFDE_CSSFunction* pFunction) : m_eType(FDE_CSSPRIMITIVETYPE_Function), m_pFunction(pFunction) {} @@ -47,34 +47,34 @@ class CFDE_CSSPrimitiveValue : public IFDE_CSSPrimitiveValue, virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const { return m_eType; } virtual FX_ARGB GetRGBColor() const { - FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_RGB); + ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_RGB); return m_dwColor; } virtual FX_FLOAT GetFloat() const { - FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_Number && - m_eType <= FDE_CSSPRIMITIVETYPE_PC); + ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_Number && + m_eType <= FDE_CSSPRIMITIVETYPE_PC); return m_fNumber; } virtual const FX_WCHAR* GetString(int32_t& iLength) const { - FXSYS_assert(m_eType >= FDE_CSSPRIMITIVETYPE_String && - m_eType <= FDE_CSSPRIMITIVETYPE_URI); + ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_String && + m_eType <= FDE_CSSPRIMITIVETYPE_URI); iLength = FXSYS_wcslen(m_pString); return m_pString; } virtual FDE_CSSPROPERTYVALUE GetEnum() const { - FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Enum); + ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Enum); return m_eEnum; } virtual const FX_WCHAR* GetFuncName() const { - FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); + ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->GetFuncName(); } virtual int32_t CountArgs() const { - FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); + ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->CountArgs(); } virtual IFDE_CSSValue* GetArgs(int32_t index) const { - FXSYS_assert(m_eType == FDE_CSSPRIMITIVETYPE_Function); + ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function); return m_pFunction->GetArgs(index); } @@ -106,7 +106,7 @@ class CFDE_CSSValueListParser : public CFX_Target { public: CFDE_CSSValueListParser(const FX_WCHAR* psz, int32_t iLen, FX_WCHAR separator) : m_Separator(separator), m_pCur(psz), m_pEnd(psz + iLen) { - FXSYS_assert(psz != NULL && iLen > 0); + ASSERT(psz != NULL && iLen > 0); } FX_BOOL NextValue(FDE_CSSPRIMITIVETYPE& eType, const FX_WCHAR*& pStart, diff --git a/xfa/fde/css/fde_cssdeclaration.cpp b/xfa/fde/css/fde_cssdeclaration.cpp index e48372c2ed..80945245cf 100644 --- a/xfa/fde/css/fde_cssdeclaration.cpp +++ b/xfa/fde/css/fde_cssdeclaration.cpp @@ -28,7 +28,7 @@ void CFDE_CSSDeclaration::GetNextProperty(FX_POSITION& pos, IFDE_CSSValue*& pValue, FX_BOOL& bImportant) const { const FDE_CSSPropertyHolder* pHolder = (const FDE_CSSPropertyHolder*)pos; - FXSYS_assert(pHolder != NULL); + ASSERT(pHolder != NULL); bImportant = pHolder->bImportant; eProperty = (FDE_CSSPROPERTY)pHolder->eProperty; pValue = pHolder->pValue; @@ -52,7 +52,7 @@ const FX_WCHAR* CFDE_CSSDeclaration::CopyToLocal( const FDE_CSSPROPERTYARGS* pArgs, const FX_WCHAR* pszValue, int32_t iValueLen) { - FXSYS_assert(iValueLen > 0); + ASSERT(iValueLen > 0); CFX_MapPtrToPtr* pCache = pArgs->pStringCache; void* pKey = NULL; if (pCache) { @@ -110,7 +110,7 @@ void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MEMAllocator* pStaticStore, FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs, const FX_WCHAR* pszValue, int32_t iValueLen) { - FXSYS_assert(iValueLen > 0); + ASSERT(iValueLen > 0); FX_BOOL bImportant = FALSE; if (iValueLen >= 10 && pszValue[iValueLen - 10] == '!' && FX_wcsnicmp(L"important", pszValue + iValueLen - 9, 9) == 0) { @@ -260,7 +260,7 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs, return ParseValueListProperty(pArgs, pszValue, iValueLen, bImportant); } default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } return FALSE; diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index 4f88c0d5d7..b172d71ebf 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -154,7 +154,7 @@ void CFDE_CSSRuleCollection::AddRulesFrom(IFDE_CSSStyleSheet* pStyleSheet, AddRuleTo(m_pUniversalRules, NewRuleData(pSelector, pDeclaration)); break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } } @@ -237,13 +237,13 @@ void CFDE_CSSStyleSelector::SetFontMgr(IFX_FontMgr* pFontMgr) { m_pFontMgr = pFontMgr; } void CFDE_CSSStyleSelector::SetDefFontSize(FX_FLOAT fFontSize) { - FXSYS_assert(fFontSize > 0); + ASSERT(fFontSize > 0); m_fDefFontSize = fFontSize; } CFDE_CSSAccelerator* CFDE_CSSStyleSelector::InitAccelerator() { if (m_pAccelerator == NULL) { m_pAccelerator = new CFDE_CSSAccelerator; - FXSYS_assert(m_pAccelerator != NULL); + ASSERT(m_pAccelerator != NULL); } m_pAccelerator->Clear(); return m_pAccelerator; @@ -253,7 +253,7 @@ IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle( if (m_pFixedStyleStore == NULL) { m_pFixedStyleStore = FX_CreateAllocator(FX_ALLOCTYPE_Fixed, 16, sizeof(CFDE_CSSComputedStyle)); - FXSYS_assert(m_pFixedStyleStore != NULL); + ASSERT(m_pFixedStyleStore != NULL); } CFDE_CSSComputedStyle* pStyle = FXTARGET_NewWith(m_pFixedStyleStore) CFDE_CSSComputedStyle(m_pFixedStyleStore); @@ -268,7 +268,7 @@ IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle( } FX_BOOL CFDE_CSSStyleSelector::SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, IFDE_CSSStyleSheet* pSheet) { - FXSYS_assert(eType < FDE_CSSSTYLESHEETGROUP_MAX); + ASSERT(eType < FDE_CSSSTYLESHEETGROUP_MAX); CFDE_CSSStyleSheetArray& dest = m_SheetGroups[eType]; dest.RemoveAt(0, dest.GetSize()); if (pSheet != NULL) { @@ -279,7 +279,7 @@ FX_BOOL CFDE_CSSStyleSelector::SetStyleSheet(FDE_CSSSTYLESHEETGROUP eType, FX_BOOL CFDE_CSSStyleSelector::SetStyleSheets( FDE_CSSSTYLESHEETGROUP eType, const CFDE_CSSStyleSheetArray* pArray) { - FXSYS_assert(eType < FDE_CSSSTYLESHEETGROUP_MAX); + ASSERT(eType < FDE_CSSSTYLESHEETGROUP_MAX); CFDE_CSSStyleSheetArray& dest = m_SheetGroups[eType]; if (pArray == NULL) { dest.RemoveAt(0, dest.GetSize()); @@ -296,7 +296,7 @@ void CFDE_CSSStyleSelector::SetStylePriority( void CFDE_CSSStyleSelector::UpdateStyleIndex(uint32_t dwMediaList) { Reset(); m_pRuleDataStore = FX_CreateAllocator(FX_ALLOCTYPE_Static, 1024, 0); - FXSYS_assert(m_pRuleDataStore != NULL); + ASSERT(m_pRuleDataStore != NULL); for (int32_t iGroup = 0; iGroup < FDE_CSSSTYLESHEETGROUP_MAX; ++iGroup) { CFDE_CSSRuleCollection& rules = m_RuleCollection[iGroup]; rules.m_pStaticStore = m_pRuleDataStore; @@ -316,10 +316,10 @@ int32_t CFDE_CSSStyleSelector::MatchDeclarations( CXFA_CSSTagProvider* pTag, CFDE_CSSDeclarationArray& matchedDecls, FDE_CSSPERSUDO ePersudoType) { - FXSYS_assert(m_pAccelerator && pTag); + ASSERT(m_pAccelerator && pTag); FDE_CSSTagCache* pCache = m_pAccelerator->GetTopElement(); - FXSYS_assert(pCache && pCache->GetTag() == pTag); + ASSERT(pCache && pCache->GetTag() == pTag); matchedDecls.RemoveAt(0, matchedDecls.GetSize()); for (int32_t ePriority = FDE_CSSSTYLESHEETPRIORITY_MAX - 1; ePriority >= 0; @@ -408,7 +408,7 @@ FX_BOOL CFDE_CSSStyleSelector::MatchSelector(FDE_CSSTagCache* pCache, } break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } pSel = pSel->GetNextSelector(); @@ -421,8 +421,8 @@ void CFDE_CSSStyleSelector::ComputeStyle( const IFDE_CSSDeclaration** ppDeclArray, int32_t iDeclCount, IFDE_CSSComputedStyle* pDestStyle) { - FXSYS_assert(iDeclCount >= 0); - FXSYS_assert(pDestStyle); + ASSERT(iDeclCount >= 0); + ASSERT(pDestStyle); static const uint32_t s_dwStyleHash = FX_HashCode_GetW(L"style", true); static const uint32_t s_dwAlignHash = FX_HashCode_GetW(L"align", true); @@ -469,7 +469,7 @@ void CFDE_CSSStyleSelector::ComputeStyle( } if (iDeclCount > 0) { - FXSYS_assert(ppDeclArray); + ASSERT(ppDeclArray); ApplyDeclarations(TRUE, ppDeclArray, iDeclCount, pDestStyle); ApplyDeclarations(FALSE, ppDeclArray, iDeclCount, pDestStyle); @@ -544,7 +544,7 @@ void CFDE_CSSStyleSelector::ApplyDeclarations( void CFDE_CSSStyleSelector::AppendInlineStyle(CFDE_CSSDeclaration* pDecl, const FX_WCHAR* psz, int32_t iLen) { - FXSYS_assert(pDecl != NULL && psz != NULL && iLen > 0); + ASSERT(pDecl != NULL && psz != NULL && iLen > 0); IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create(); if (pSyntax == NULL) { return; @@ -1128,7 +1128,7 @@ void CFDE_CSSStyleSelector::ApplyProperty( } } } else { - FXSYS_assert(FALSE); + ASSERT(FALSE); } } FX_FLOAT CFDE_CSSStyleSelector::ApplyNumber(FDE_CSSPRIMITIVETYPE eUnit, 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; diff --git a/xfa/fde/css/fde_csssyntax.cpp b/xfa/fde/css/fde_csssyntax.cpp index 8a905f69b4..4cc890c96b 100644 --- a/xfa/fde/css/fde_csssyntax.cpp +++ b/xfa/fde/css/fde_csssyntax.cpp @@ -41,7 +41,7 @@ FX_BOOL CFDE_CSSSyntaxParser::Init(IFX_Stream* pStream, int32_t iCSSPlaneSize, int32_t iTextDataSize, FX_BOOL bOnlyDeclaration) { - FXSYS_assert(pStream != NULL && iCSSPlaneSize > 0 && iTextDataSize > 0); + ASSERT(pStream != NULL && iCSSPlaneSize > 0 && iTextDataSize > 0); Reset(bOnlyDeclaration); if (!m_TextData.EstimateSize(iTextDataSize)) { return FALSE; @@ -56,7 +56,7 @@ FX_BOOL CFDE_CSSSyntaxParser::Init(const FX_WCHAR* pBuffer, int32_t iBufferSize, int32_t iTextDatSize, FX_BOOL bOnlyDeclaration) { - FXSYS_assert(pBuffer != NULL && iBufferSize > 0 && iTextDatSize > 0); + ASSERT(pBuffer != NULL && iBufferSize > 0 && iTextDatSize > 0); Reset(bOnlyDeclaration); if (!m_TextData.EstimateSize(iTextDatSize)) { return FALSE; @@ -358,7 +358,7 @@ FDE_CSSSYNTAXSTATUS CFDE_CSSSyntaxParser::DoSyntaxParse() { m_TextPlane.MoveNext(); break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } } @@ -434,7 +434,7 @@ FX_BOOL CFDE_CSSTextBuf::AttachBuffer(const FX_WCHAR* pBuffer, return m_bExtBuf = TRUE; } FX_BOOL CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) { - FXSYS_assert(iAllocSize > 0); + ASSERT(iAllocSize > 0); Clear(); m_bExtBuf = FALSE; return ExpandBuf(iAllocSize); @@ -443,7 +443,7 @@ int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream* pTxtStream, int32_t iStreamOffset, int32_t iMaxChars, FX_BOOL& bEOS) { - FXSYS_assert(iStreamOffset >= 0 && iMaxChars > 0); + ASSERT(iStreamOffset >= 0 && iMaxChars > 0); Clear(); m_bExtBuf = FALSE; if (!ExpandBuf(iMaxChars)) { @@ -474,7 +474,7 @@ FX_BOOL CFDE_CSSTextBuf::ExpandBuf(int32_t iDesiredSize) { return TRUE; } void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) { - FXSYS_assert(iStart >= 0 && iLength > 0); + ASSERT(iStart >= 0 && iLength > 0); if (iLength > m_iDatLen - iStart) { iLength = m_iDatLen - iStart; } diff --git a/xfa/fde/fde_gedevice.cpp b/xfa/fde/fde_gedevice.cpp index 49345ffeaa..f99dc6c201 100644 --- a/xfa/fde/fde_gedevice.cpp +++ b/xfa/fde/fde_gedevice.cpp @@ -18,7 +18,7 @@ CFDE_RenderDevice::CFDE_RenderDevice(CFX_RenderDevice* pDevice, m_bOwnerDevice(bOwnerDevice), m_pCharPos(nullptr), m_iCharCount(0) { - FXSYS_assert(pDevice); + ASSERT(pDevice); FX_RECT rt = m_pDevice->GetClipBox(); m_rtClip.Set((FX_FLOAT)rt.left, (FX_FLOAT)rt.top, (FX_FLOAT)rt.Width(), @@ -73,7 +73,7 @@ FX_BOOL CFDE_RenderDevice::DrawImage(CFX_DIBSource* pDib, const CFX_RectF& dstRect, const CFX_Matrix* pImgMatrix, const CFX_Matrix* pDevMatrix) { - FXSYS_assert(pDib != NULL); + ASSERT(pDib != NULL); CFX_RectF srcRect; if (pSrcRect) { srcRect = *pSrcRect; @@ -110,8 +110,7 @@ FX_BOOL CFDE_RenderDevice::DrawString(CFDE_Brush* pBrush, int32_t iCount, FX_FLOAT fFontSize, const CFX_Matrix* pMatrix) { - FXSYS_assert(pBrush != NULL && pFont != NULL && pCharPos != NULL && - iCount > 0); + ASSERT(pBrush != NULL && pFont != NULL && pCharPos != NULL && iCount > 0); CFX_FontCache* pCache = CFX_GEModule::Get()->GetFontCache(); CFX_Font* pFxFont = (CFX_Font*)pFont->GetDevFont(); diff --git a/xfa/fde/fde_iterator.cpp b/xfa/fde/fde_iterator.cpp index 755bff543f..53d86e8520 100644 --- a/xfa/fde/fde_iterator.cpp +++ b/xfa/fde/fde_iterator.cpp @@ -15,7 +15,7 @@ CFDE_VisualSetIterator::~CFDE_VisualSetIterator() { } FX_BOOL CFDE_VisualSetIterator::AttachCanvas(IFDE_CanvasSet* pCanvas) { - FXSYS_assert(pCanvas); + ASSERT(pCanvas); m_CanvasStack.RemoveAll(); FDE_CANVASITEM canvas; @@ -38,7 +38,7 @@ FX_BOOL CFDE_VisualSetIterator::FilterObjects(uint32_t dwObjects) { m_dwFilter = dwObjects; FDE_CANVASITEM* pCanvas = m_CanvasStack.GetTopElement(); - FXSYS_assert(pCanvas && pCanvas->pCanvas); + ASSERT(pCanvas && pCanvas->pCanvas); pCanvas->hPos = pCanvas->pCanvas->GetFirstPosition(nullptr); return !!pCanvas->hPos; @@ -53,7 +53,7 @@ FDE_HVISUALOBJ CFDE_VisualSetIterator::GetNext(IFDE_VisualSet*& pVisualSet, IFDE_CanvasSet** ppCanvasSet) { while (m_CanvasStack.GetSize() > 0) { FDE_CANVASITEM* pCanvas = m_CanvasStack.GetTopElement(); - FXSYS_assert(pCanvas && pCanvas->pCanvas); + ASSERT(pCanvas && pCanvas->pCanvas); if (!pCanvas->hPos) { if (m_CanvasStack.GetSize() == 1) @@ -65,7 +65,7 @@ FDE_HVISUALOBJ CFDE_VisualSetIterator::GetNext(IFDE_VisualSet*& pVisualSet, do { FDE_HVISUALOBJ hObj = pCanvas->pCanvas->GetNext( pCanvas->hCanvas, pCanvas->hPos, pVisualSet); - FXSYS_assert(hObj); + ASSERT(hObj); FDE_VISUALOBJTYPE eType = pVisualSet->GetType(); if (eType == FDE_VISUALOBJ_Canvas) { diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp index 74c19f60cf..81e5b1b259 100644 --- a/xfa/fde/fde_render.cpp +++ b/xfa/fde/fde_render.cpp @@ -84,7 +84,7 @@ FDE_RENDERSTATUS CFDE_RenderContext::DoRender(IFX_Pause* pPause) { iCount += 5; break; case FDE_VISUALOBJ_Canvas: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; default: break; @@ -116,8 +116,8 @@ void CFDE_RenderContext::StopRender() { void CFDE_RenderContext::RenderText(IFDE_TextSet* pTextSet, FDE_HVISUALOBJ hText) { - FXSYS_assert(m_pRenderDevice); - FXSYS_assert(pTextSet && hText); + ASSERT(m_pRenderDevice); + ASSERT(pTextSet && hText); IFX_Font* pFont = pTextSet->GetFont(hText); if (!pFont) diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index a18fbbd0ae..fc97d99125 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -60,12 +60,12 @@ CFDE_TextOut::~CFDE_TextOut() { m_ttoLines.RemoveAll(); } void CFDE_TextOut::SetFont(IFX_Font* pFont) { - FXSYS_assert(pFont); + ASSERT(pFont); m_pFont = pFont; m_pTxtBreak->SetFont(pFont); } void CFDE_TextOut::SetFontSize(FX_FLOAT fFontSize) { - FXSYS_assert(fFontSize > 0); + ASSERT(fFontSize > 0); m_fFontSize = fFontSize; m_pTxtBreak->SetFontSize(fFontSize); } @@ -97,7 +97,7 @@ void CFDE_TextOut::SetStyles(uint32_t dwStyles) { m_pTxtBreak->SetLayoutStyles(m_dwTxtBkStyles); } void CFDE_TextOut::SetTabWidth(FX_FLOAT fTabWidth) { - FXSYS_assert(fTabWidth > 1.0f); + ASSERT(fTabWidth > 1.0f); m_pTxtBreak->SetTabWidth(fTabWidth, FALSE); } void CFDE_TextOut::SetEllipsisString(const CFX_WideString& wsEllipsis) { @@ -128,11 +128,11 @@ void CFDE_TextOut::SetAlignment(int32_t iAlignment) { m_pTxtBreak->SetAlignment(m_iTxtBkAlignment); } void CFDE_TextOut::SetLineSpace(FX_FLOAT fLineSpace) { - FXSYS_assert(fLineSpace > 1.0f); + ASSERT(fLineSpace > 1.0f); m_fLineSpace = fLineSpace; } void CFDE_TextOut::SetDIBitmap(CFX_DIBitmap* pDIB) { - FXSYS_assert(pDIB); + ASSERT(pDIB); if (m_pRenderDevice) m_pRenderDevice->Release(); @@ -143,7 +143,7 @@ void CFDE_TextOut::SetDIBitmap(CFX_DIBitmap* pDIB) { } void CFDE_TextOut::SetRenderDevice(CFX_RenderDevice* pDevice) { - FXSYS_assert(pDevice); + ASSERT(pDevice); if (m_pRenderDevice) m_pRenderDevice->Release(); @@ -235,7 +235,7 @@ void CFDE_TextOut::CalcLogicSize(const FX_WCHAR* pwsStr, void CFDE_TextOut::CalcTextSize(const FX_WCHAR* pwsStr, int32_t iLength, CFX_RectF& rect) { - FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f); + ASSERT(m_pFont != NULL && m_fFontSize >= 1.0f); SetLineWidth(rect); m_iTotalLines = 0; const FX_WCHAR* pStr = pwsStr; @@ -397,7 +397,7 @@ void CFDE_TextOut::DrawText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect, const CFX_RectF& rtClip) { - FXSYS_assert(m_pFont != NULL && m_fFontSize >= 1.0f); + ASSERT(m_pFont != NULL && m_fFontSize >= 1.0f); if (pwsStr == NULL || iLength < 1) { return; } diff --git a/xfa/fde/xml/fde_xml_imp.cpp b/xfa/fde/xml/fde_xml_imp.cpp index 0badeb41dc..f4295600c7 100644 --- a/xfa/fde/xml/fde_xml_imp.cpp +++ b/xfa/fde/xml/fde_xml_imp.cpp @@ -121,7 +121,7 @@ int32_t CFDE_XMLNode::GetChildNodeIndex(CFDE_XMLNode* pNode) const { CFDE_XMLNode* CFDE_XMLNode::GetPath(const FX_WCHAR* pPath, int32_t iLength, FX_BOOL bQualifiedName) const { - FXSYS_assert(pPath != NULL); + ASSERT(pPath != NULL); if (iLength < 0) { iLength = FXSYS_wcslen(pPath); } @@ -178,7 +178,7 @@ CFDE_XMLNode* CFDE_XMLNode::GetPath(const FX_WCHAR* pPath, return pFind->GetPath(pStart, iLength, bQualifiedName); } int32_t CFDE_XMLNode::InsertChildNode(CFDE_XMLNode* pNode, int32_t index) { - FXSYS_assert(pNode != NULL); + ASSERT(pNode != NULL); pNode->m_pParent = this; if (m_pChild == NULL) { m_pChild = pNode; @@ -206,7 +206,7 @@ int32_t CFDE_XMLNode::InsertChildNode(CFDE_XMLNode* pNode, int32_t index) { return iCount; } void CFDE_XMLNode::RemoveChildNode(CFDE_XMLNode* pNode) { - FXSYS_assert(m_pChild != NULL && pNode != NULL); + ASSERT(m_pChild != NULL && pNode != NULL); if (m_pChild == pNode) { m_pChild = pNode->m_pNext; } else { @@ -327,7 +327,7 @@ int32_t CFDE_XMLNode::GetNodeLevel() const { } FX_BOOL CFDE_XMLNode::InsertNodeItem(CFDE_XMLNode::NodeItem eItem, CFDE_XMLNode* pNode) { - FXSYS_assert(pNode != NULL); + ASSERT(pNode != NULL); switch (eItem) { case CFDE_XMLNode::NextSibling: { pNode->m_pParent = m_pParent; @@ -381,7 +381,7 @@ CFDE_XMLNode* CFDE_XMLNode::Clone(FX_BOOL bRecursive) { } void CFDE_XMLNode::SaveXMLNode(IFX_Stream* pXMLStream) { CFDE_XMLNode* pNode = (CFDE_XMLNode*)this; - FXSYS_assert(pXMLStream != NULL && pNode != NULL); + ASSERT(pXMLStream != NULL && pNode != NULL); switch (pNode->GetType()) { case FDE_XMLNODE_Instruction: { CFX_WideString ws; @@ -508,7 +508,7 @@ void CFDE_XMLNode::CloneChildren(CFDE_XMLNode* pClone) { CFDE_XMLInstruction::CFDE_XMLInstruction(const CFX_WideString& wsTarget) : m_wsTarget(wsTarget) { - FXSYS_assert(m_wsTarget.GetLength() > 0); + ASSERT(m_wsTarget.GetLength() > 0); } CFDE_XMLNode* CFDE_XMLInstruction::Clone(FX_BOOL bRecursive) { CFDE_XMLInstruction* pClone = new CFDE_XMLInstruction(m_wsTarget); @@ -529,7 +529,7 @@ FX_BOOL CFDE_XMLInstruction::GetAttribute(int32_t index, CFX_WideString& wsAttriName, CFX_WideString& wsAttriValue) const { int32_t iCount = m_Attributes.GetSize(); - FXSYS_assert(index > -1 && index < iCount / 2); + ASSERT(index > -1 && index < iCount / 2); for (int32_t i = 0; i < iCount; i += 2) { if (index == 0) { wsAttriName = m_Attributes[i]; @@ -563,7 +563,7 @@ void CFDE_XMLInstruction::GetString(const FX_WCHAR* pwsAttriName, } void CFDE_XMLInstruction::SetString(const CFX_WideString& wsAttriName, const CFX_WideString& wsAttriValue) { - FXSYS_assert(wsAttriName.GetLength() > 0); + ASSERT(wsAttriName.GetLength() > 0); int32_t iCount = m_Attributes.GetSize(); for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(wsAttriName) == 0) { @@ -637,7 +637,7 @@ void CFDE_XMLInstruction::RemoveData(int32_t index) { CFDE_XMLElement::CFDE_XMLElement(const CFX_WideString& wsTag) : CFDE_XMLNode(), m_wsTag(wsTag), m_Attributes() { - FXSYS_assert(m_wsTag.GetLength() > 0); + ASSERT(m_wsTag.GetLength() > 0); } CFDE_XMLElement::~CFDE_XMLElement() { m_Attributes.RemoveAll(); @@ -715,7 +715,7 @@ FX_BOOL CFDE_XMLElement::GetAttribute(int32_t index, CFX_WideString& wsAttriName, CFX_WideString& wsAttriValue) const { int32_t iCount = m_Attributes.GetSize(); - FXSYS_assert(index > -1 && index < iCount / 2); + ASSERT(index > -1 && index < iCount / 2); for (int32_t i = 0; i < iCount; i += 2) { if (index == 0) { wsAttriName = m_Attributes[i]; @@ -749,7 +749,7 @@ void CFDE_XMLElement::GetString(const FX_WCHAR* pwsAttriName, } void CFDE_XMLElement::SetString(const CFX_WideString& wsAttriName, const CFX_WideString& wsAttriValue) { - FXSYS_assert(wsAttriName.GetLength() > 0); + ASSERT(wsAttriName.GetLength() > 0); int32_t iCount = m_Attributes.GetSize(); for (int32_t i = 0; i < iCount; i += 2) { if (m_Attributes[i].Compare(wsAttriName) == 0) { @@ -931,7 +931,7 @@ int32_t CFDE_XMLDoc::DoLoad(IFX_Pause* pPause) { if (m_iStatus >= 100) { return m_iStatus; } - FXSYS_assert(m_pXMLParser != NULL); + ASSERT(m_pXMLParser != NULL); return m_iStatus = m_pXMLParser->DoParser(pPause); } void CFDE_XMLDoc::CloseXML() { @@ -939,7 +939,7 @@ void CFDE_XMLDoc::CloseXML() { } void CFDE_XMLDoc::SaveXMLNode(IFX_Stream* pXMLStream, CFDE_XMLNode* pINode) { CFDE_XMLNode* pNode = (CFDE_XMLNode*)pINode; - FXSYS_assert(pXMLStream != NULL && pNode != NULL); + ASSERT(pXMLStream != NULL && pNode != NULL); switch (pNode->GetType()) { case FDE_XMLNODE_Instruction: { CFX_WideString ws; @@ -1053,8 +1053,8 @@ void CFDE_XMLDoc::SaveXML(IFX_Stream* pXMLStream, FX_BOOL bSaveBOM) { m_pStream->Seek(FX_STREAMSEEK_Begin, 0); pXMLStream = m_pStream; } - FXSYS_assert((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Text) != 0); - FXSYS_assert((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Write) != 0); + ASSERT((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Text) != 0); + ASSERT((pXMLStream->GetAccessModes() & FX_STREAMACCESS_Write) != 0); uint16_t wCodePage = pXMLStream->GetCodePage(); if (wCodePage != FX_CODEPAGE_UTF16LE && wCodePage != FX_CODEPAGE_UTF16BE && wCodePage != FX_CODEPAGE_UTF8) { @@ -1422,7 +1422,7 @@ void CFDE_BlockBuffer::GetTextData(CFX_WideString& wsTextData, void CFDE_BlockBuffer::TextDataIndex2BufIndex(const int32_t iIndex, int32_t& iBlockIndex, int32_t& iInnerIndex) const { - FXSYS_assert(iIndex >= 0); + ASSERT(iIndex >= 0); int32_t iRealIndex = m_iStartPosition + iIndex; iBlockIndex = iRealIndex / m_iAllocStep; iInnerIndex = iRealIndex % m_iAllocStep; @@ -1467,18 +1467,18 @@ CFDE_XMLSyntaxParser::CFDE_XMLSyntaxParser() void CFDE_XMLSyntaxParser::Init(IFX_Stream* pStream, int32_t iXMLPlaneSize, int32_t iTextDataSize) { - FXSYS_assert(m_pStream == NULL && m_pBuffer == NULL); - FXSYS_assert(pStream != NULL && iXMLPlaneSize > 0); + ASSERT(m_pStream == NULL && m_pBuffer == NULL); + ASSERT(pStream != NULL && iXMLPlaneSize > 0); int32_t iStreamLength = pStream->GetLength(); - FXSYS_assert(iStreamLength > 0); + ASSERT(iStreamLength > 0); m_pStream = pStream; m_iXMLPlaneSize = std::min(iXMLPlaneSize, iStreamLength); uint8_t bom[4]; m_iCurrentPos = m_pStream->GetBOM(bom); - FXSYS_assert(m_pBuffer == NULL); + ASSERT(m_pBuffer == NULL); m_pBuffer = FX_Alloc(FX_WCHAR, m_iXMLPlaneSize); m_pStart = m_pEnd = m_pBuffer; - FXSYS_assert(!m_BlockBuffer.IsInitialized()); + ASSERT(!m_BlockBuffer.IsInitialized()); m_BlockBuffer.InitBuffer(); m_pCurrentBlock = m_BlockBuffer.GetAvailableBlock(m_iIndexInBlock); m_iParsedBytes = m_iParsedChars = 0; @@ -1490,7 +1490,7 @@ FDE_XmlSyntaxResult CFDE_XMLSyntaxParser::DoSyntaxParse() { m_syntaxParserResult == FDE_XmlSyntaxResult::EndOfString) { return m_syntaxParserResult; } - FXSYS_assert(m_pStream && m_pBuffer && m_BlockBuffer.IsInitialized()); + ASSERT(m_pStream && m_pBuffer && m_BlockBuffer.IsInitialized()); int32_t iStreamLength = m_pStream->GetLength(); int32_t iPos; diff --git a/xfa/fee/fde_txtedtbuf.cpp b/xfa/fee/fde_txtedtbuf.cpp index 6f638dde09..9029806d3b 100644 --- a/xfa/fee/fde_txtedtbuf.cpp +++ b/xfa/fee/fde_txtedtbuf.cpp @@ -22,7 +22,7 @@ CFDE_TxtEdtBufIter::CFDE_TxtEdtBufIter(CFDE_TxtEdtBuf* pBuf, FX_WCHAR wcAlias) m_nCurIndex(0), m_nIndex(0), m_Alias(wcAlias) { - FXSYS_assert(m_pBuf); + ASSERT(m_pBuf); } CFDE_TxtEdtBufIter::~CFDE_TxtEdtBufIter() {} void CFDE_TxtEdtBufIter::Release() { @@ -33,7 +33,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) { if (m_nIndex == 0) { return FALSE; } - FXSYS_assert(m_nCurChunk < m_pBuf->m_Chunks.GetSize()); + ASSERT(m_nCurChunk < m_pBuf->m_Chunks.GetSize()); CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER lpChunk = NULL; if (m_nCurIndex > 0) { m_nCurIndex--; @@ -48,14 +48,14 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) { } } } - FXSYS_assert(m_nCurChunk >= 0); + ASSERT(m_nCurChunk >= 0); m_nIndex--; return TRUE; } else { if (m_nIndex >= (m_pBuf->m_nTotal - 1)) { return FALSE; } - FXSYS_assert(m_nCurChunk < m_pBuf->m_Chunks.GetSize()); + ASSERT(m_nCurChunk < m_pBuf->m_Chunks.GetSize()); CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER lpChunk = (CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER)m_pBuf->m_Chunks[m_nCurChunk]; if (lpChunk->nUsed != (m_nCurIndex + 1)) { @@ -77,7 +77,7 @@ FX_BOOL CFDE_TxtEdtBufIter::Next(FX_BOOL bPrev) { } } void CFDE_TxtEdtBufIter::SetAt(int32_t nIndex) { - FXSYS_assert(nIndex >= 0 && nIndex < m_pBuf->m_nTotal); + ASSERT(nIndex >= 0 && nIndex < m_pBuf->m_nTotal); CFDE_TxtEdtBuf::FDE_CHUNKPLACE cp; m_pBuf->Index2CP(nIndex, cp); m_nIndex = nIndex; @@ -88,7 +88,7 @@ int32_t CFDE_TxtEdtBufIter::GetAt() const { return m_nIndex; } FX_WCHAR CFDE_TxtEdtBufIter::GetChar() { - FXSYS_assert(m_nIndex >= 0 && m_nIndex < m_pBuf->m_nTotal); + ASSERT(m_nIndex >= 0 && m_nIndex < m_pBuf->m_nTotal); if (m_Alias == 0 || m_nIndex == (m_pBuf->m_nTotal - 1)) { return ((CFDE_TxtEdtBuf::FDE_LPCHUNKHEADER)m_pBuf->m_Chunks[m_nCurChunk]) ->wChars[m_nCurIndex]; @@ -111,7 +111,7 @@ CFDE_TxtEdtBuf::CFDE_TxtEdtBuf(int32_t nDefChunkSize) m_nTotal(0), m_bChanged(FALSE), m_pAllocator(NULL) { - FXSYS_assert(m_nChunkSize); + ASSERT(m_nChunkSize); ResetChunkBuffer(FDE_DEFCHUNKCOUNT, m_nChunkSize); } void CFDE_TxtEdtBuf::Release() { @@ -123,7 +123,7 @@ CFDE_TxtEdtBuf::~CFDE_TxtEdtBuf() { m_Chunks.RemoveAll(); } FX_BOOL CFDE_TxtEdtBuf::SetChunkSize(int32_t nChunkSize) { - FXSYS_assert(nChunkSize); + ASSERT(nChunkSize); ResetChunkBuffer(FDE_DEFCHUNKCOUNT, nChunkSize); return TRUE; } @@ -134,7 +134,7 @@ int32_t CFDE_TxtEdtBuf::GetTextLength() const { return m_nTotal; } void CFDE_TxtEdtBuf::SetText(const CFX_WideString& wsText) { - FXSYS_assert(!wsText.IsEmpty()); + ASSERT(!wsText.IsEmpty()); Clear(FALSE); int32_t nTextLength = wsText.GetLength(); int32_t nNeedCount = @@ -167,7 +167,7 @@ void CFDE_TxtEdtBuf::GetText(CFX_WideString& wsText) const { GetRange(wsText, 0, m_nTotal); } FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(int32_t nIndex) const { - FXSYS_assert(nIndex >= 0 && nIndex < GetTextLength()); + ASSERT(nIndex >= 0 && nIndex < GetTextLength()); FDE_LPCHUNKHEADER pChunkHeader = NULL; int32_t nTotal = 0; int32_t nCount = m_Chunks.GetSize(); @@ -179,7 +179,7 @@ FX_WCHAR CFDE_TxtEdtBuf::GetCharByIndex(int32_t nIndex) const { break; } } - FXSYS_assert(pChunkHeader); + ASSERT(pChunkHeader); return pChunkHeader->wChars[pChunkHeader->nUsed - (nTotal - nIndex)]; } void CFDE_TxtEdtBuf::GetRange(CFX_WideString& wsText, @@ -214,7 +214,7 @@ void CFDE_TxtEdtBuf::GetRange(CFX_WideString& wsText, void CFDE_TxtEdtBuf::Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength) { - FXSYS_assert(nPos >= 0 && nPos <= m_nTotal); + ASSERT(nPos >= 0 && nPos <= m_nTotal); FDE_CHUNKPLACE cp; Index2CP(nPos, cp); int32_t nLengthTemp = nLength; @@ -248,7 +248,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos, while (nLengthTemp > 0) { FDE_LPCHUNKHEADER lpChunk = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc( sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR)); - FXSYS_assert(lpChunk); + ASSERT(lpChunk); int32_t nCopy = std::min(nLengthTemp, m_nChunkSize); FXSYS_memcpy(lpChunk->wChars, lpText, nCopy * sizeof(FX_WCHAR)); lpText += nCopy; @@ -261,7 +261,7 @@ void CFDE_TxtEdtBuf::Insert(int32_t nPos, m_bChanged = TRUE; } void CFDE_TxtEdtBuf::Delete(int32_t nIndex, int32_t nLength) { - FXSYS_assert(nLength > 0 && nIndex >= 0 && nIndex + nLength <= m_nTotal); + ASSERT(nLength > 0 && nIndex >= 0 && nIndex + nLength <= m_nTotal); FDE_CHUNKPLACE cpEnd; Index2CP(nIndex + nLength - 1, cpEnd); m_nTotal -= nLength; @@ -354,8 +354,8 @@ FX_BOOL CFDE_TxtEdtBuf::Optimize(IFX_Pause* pPause) { } void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize) { - FXSYS_assert(nChunkSize); - FXSYS_assert(nDefChunkCount); + ASSERT(nChunkSize); + ASSERT(nDefChunkCount); if (m_pAllocator) { m_pAllocator->Release(); m_pAllocator = NULL; @@ -366,10 +366,10 @@ void CFDE_TxtEdtBuf::ResetChunkBuffer(int32_t nDefChunkCount, sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR); m_pAllocator = FX_CreateAllocator(FX_ALLOCTYPE_Fixed, nDefChunkCount, nChunkLength); - FXSYS_assert(m_pAllocator); + ASSERT(m_pAllocator); FDE_LPCHUNKHEADER lpChunkHeader = (FDE_LPCHUNKHEADER)m_pAllocator->Alloc(nChunkLength); - FXSYS_assert(lpChunkHeader); + ASSERT(lpChunkHeader); lpChunkHeader->nUsed = 0; m_Chunks.Add(lpChunkHeader); m_nTotal = 0; @@ -383,7 +383,7 @@ int32_t CFDE_TxtEdtBuf::CP2Index(const FDE_CHUNKPLACE& cp) const { return nTotal; } void CFDE_TxtEdtBuf::Index2CP(int32_t nIndex, FDE_CHUNKPLACE& cp) const { - FXSYS_assert(nIndex <= GetTextLength()); + ASSERT(nIndex <= GetTextLength()); if (nIndex == m_nTotal) { cp.nChunkIndex = m_Chunks.GetSize() - 1; cp.nCharIndex = ((FDE_LPCHUNKHEADER)m_Chunks[cp.nChunkIndex])->nUsed; diff --git a/xfa/fee/fde_txtedtengine.cpp b/xfa/fee/fde_txtedtengine.cpp index adb28ea081..98d7841b40 100644 --- a/xfa/fee/fde_txtedtengine.cpp +++ b/xfa/fee/fde_txtedtengine.cpp @@ -167,7 +167,7 @@ int32_t CFDE_TxtEdtEngine::SetCaretPos(int32_t nIndex, FX_BOOL bBefore) { if (IsLocked()) { return 0; } - FXSYS_assert(nIndex >= 0 && nIndex <= GetTextBufLength()); + ASSERT(nIndex >= 0 && nIndex <= GetTextBufLength()); if (m_PagePtrArray.GetSize() <= m_nCaretPage) { return 0; } @@ -651,7 +651,7 @@ FX_BOOL CFDE_TxtEdtEngine::Redo(const CFX_ByteStringC& bsRedo) { return FALSE; } IFDE_TxtEdtDoRecord* pDoRecord = IFDE_TxtEdtDoRecord::Create(bsRedo); - FXSYS_assert(pDoRecord); + ASSERT(pDoRecord); if (pDoRecord == NULL) { return FALSE; } @@ -667,7 +667,7 @@ FX_BOOL CFDE_TxtEdtEngine::Undo(const CFX_ByteStringC& bsUndo) { return FALSE; } IFDE_TxtEdtDoRecord* pDoRecord = IFDE_TxtEdtDoRecord::Create(bsUndo); - FXSYS_assert(pDoRecord); + ASSERT(pDoRecord); if (pDoRecord == NULL) { return FALSE; } @@ -812,7 +812,7 @@ void CFDE_TxtEdtEngine::GetPreReplaceText(CFX_WideString& wsText, void CFDE_TxtEdtEngine::Inner_Insert(int32_t nStart, const FX_WCHAR* lpText, int32_t nLength) { - FXSYS_assert(nLength > 0); + ASSERT(nLength > 0); FDE_TXTEDTPARAGPOS ParagPos; TextPos2ParagPos(nStart, ParagPos); m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); @@ -878,7 +878,7 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) { nCount = m_pTxtBuf->GetTextLength() - nStart; } int32_t nEnd = nStart + nCount - 1; - FXSYS_assert(nStart >= 0 && nEnd < m_pTxtBuf->GetTextLength()); + ASSERT(nStart >= 0 && nEnd < m_pTxtBuf->GetTextLength()); m_Param.pEventSink->On_PageUnload(this, m_nCaretPage, 0); FDE_TXTEDTPARAGPOS ParagPosBgn, ParagPosEnd; TextPos2ParagPos(nStart, ParagPosBgn); @@ -931,11 +931,11 @@ void CFDE_TxtEdtEngine::Inner_DeleteRange(int32_t nStart, int32_t nCount) { void CFDE_TxtEdtEngine::DeleteRange_DoRecord(int32_t nStart, int32_t nCount, FX_BOOL bSel) { - FXSYS_assert(nStart >= 0); + ASSERT(nStart >= 0); if (nCount == -1) { nCount = GetTextLength() - nStart; } - FXSYS_assert((nStart + nCount) <= m_pTxtBuf->GetTextLength()); + ASSERT((nStart + nCount) <= m_pTxtBuf->GetTextLength()); if (!(m_Param.dwMode & FDE_TEXTEDITMODE_NoRedoUndo)) { CFX_WideString wsRange; @@ -1235,8 +1235,8 @@ void CFDE_TxtEdtEngine::RecoverParagEnd(CFX_WideString& wsText) { } } int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex) { - FXSYS_assert(nIndex >= 0); - FXSYS_assert(nIndex <= m_pTxtBuf->GetTextLength()); + ASSERT(nIndex >= 0); + ASSERT(nIndex <= m_pTxtBuf->GetTextLength()); if (m_nCaretPage >= 0) { IFDE_TxtEdtPage* pPage = m_PagePtrArray[m_nCaretPage]; m_Param.pEventSink->On_PageLoad(this, m_nCaretPage, 0); @@ -1269,7 +1269,7 @@ int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex) { break; } } - FXSYS_assert(i < pParag->m_nLineCount); + ASSERT(i < pParag->m_nLineCount); nLineCount += (i + 1); m_nCaretPage = (nLineCount - 1) / m_nPageLineCount + 1 - 1; m_Param.pEventSink->On_PageChange(this, m_nCaretPage); @@ -1278,7 +1278,7 @@ int32_t CFDE_TxtEdtEngine::MovePage2Char(int32_t nIndex) { } void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, FDE_TXTEDTPARAGPOS& ParagPos) const { - FXSYS_assert(nIndex >= 0 && nIndex < m_pTxtBuf->GetTextLength()); + ASSERT(nIndex >= 0 && nIndex < m_pTxtBuf->GetTextLength()); int32_t nCount = m_ParagPtrArray.GetSize(); int32_t nBgn = 0; int32_t nMid = 0; @@ -1297,9 +1297,9 @@ void CFDE_TxtEdtEngine::TextPos2ParagPos(int32_t nIndex, if (nBgn == nEnd) { nMid = nBgn; } - FXSYS_assert(nIndex >= m_ParagPtrArray[nMid]->m_nCharStart && - (nIndex < m_ParagPtrArray[nMid]->m_nCharStart + - m_ParagPtrArray[nMid]->m_nCharCount)); + ASSERT(nIndex >= m_ParagPtrArray[nMid]->m_nCharStart && + (nIndex < m_ParagPtrArray[nMid]->m_nCharStart + + m_ParagPtrArray[nMid]->m_nCharCount)); ParagPos.nParagIndex = nMid; ParagPos.nCharIndex = nIndex - m_ParagPtrArray[nMid]->m_nCharStart; } @@ -1455,7 +1455,7 @@ FX_BOOL CFDE_TxtEdtEngine::MoveLineEnd() { } } nIndex = nStart + nCount - 1; - FXSYS_assert(nIndex <= GetTextBufLength()); + ASSERT(nIndex <= GetTextBufLength()); FX_WCHAR wChar = m_pTxtBuf->GetCharByIndex(nIndex); FX_BOOL bBefore = FALSE; if (nIndex <= GetTextBufLength()) { @@ -1646,7 +1646,7 @@ CFDE_TxtEdtDoRecord_Insert::CFDE_TxtEdtDoRecord_Insert( const FX_WCHAR* lpText, int32_t nLength) : m_pEngine(pEngine), m_nCaret(nCaret) { - FXSYS_assert(pEngine); + ASSERT(pEngine); FX_WCHAR* lpBuffer = m_wsInsert.GetBuffer(nLength); FXSYS_memcpy(lpBuffer, lpText, nLength * sizeof(FX_WCHAR)); m_wsInsert.ReleaseBuffer(); @@ -1695,7 +1695,7 @@ void CFDE_TxtEdtDoRecord_Insert::Deserialize( bsDoRecord.GetLength()); int32_t nType = 0; ArchiveLoader >> nType; - FXSYS_assert(nType == FDE_TXTEDT_DORECORD_INS); + ASSERT(nType == FDE_TXTEDT_DORECORD_INS); int32_t nEngine = 0; ArchiveLoader >> nEngine; m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; @@ -1717,7 +1717,7 @@ CFDE_TxtEdtDoRecord_DeleteRange::CFDE_TxtEdtDoRecord_DeleteRange( m_nIndex(nIndex), m_nCaret(nCaret), m_wsRange(wsRange) { - FXSYS_assert(pEngine); + ASSERT(pEngine); } CFDE_TxtEdtDoRecord_DeleteRange::~CFDE_TxtEdtDoRecord_DeleteRange() {} void CFDE_TxtEdtDoRecord_DeleteRange::Release() { @@ -1772,7 +1772,7 @@ void CFDE_TxtEdtDoRecord_DeleteRange::Deserialize( bsDoRecord.GetLength()); int32_t nType = 0; ArchiveLoader >> nType; - FXSYS_assert(nType == FDE_TXTEDT_DORECORD_DEL); + ASSERT(nType == FDE_TXTEDT_DORECORD_DEL); int32_t nEngine = 0; ArchiveLoader >> nEngine; m_pEngine = (CFDE_TxtEdtEngine*)(uintptr_t)nEngine; diff --git a/xfa/fee/fde_txtedtpage.cpp b/xfa/fee/fde_txtedtpage.cpp index 4aadb397da..5faafebd55 100644 --- a/xfa/fee/fde_txtedtpage.cpp +++ b/xfa/fee/fde_txtedtpage.cpp @@ -179,8 +179,8 @@ FX_BOOL CFDE_TxtEdtPage::GetClip(FDE_HVISUALOBJ hVisualObj, CFX_RectF& rt) { int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex, CFX_RectF& rect, FX_BOOL bBBox) const { - FXSYS_assert(m_nRefCount > 0); - FXSYS_assert(nIndex >= 0 && nIndex < m_nCharCount); + ASSERT(m_nRefCount > 0); + ASSERT(nIndex >= 0 && nIndex < m_nCharCount); if (m_nRefCount < 1) { return 0; } @@ -199,7 +199,7 @@ int32_t CFDE_TxtEdtPage::GetCharRect(int32_t nIndex, return pPiece->nBidiLevel; } } - FXSYS_assert(0); + ASSERT(0); return 0; } int32_t CFDE_TxtEdtPage::GetCharIndex(const CFX_PointF& fPoint, @@ -556,7 +556,7 @@ int32_t CFDE_TxtEdtPage::LoadPage(const CFX_RectF* pClipBox, return 0; } void CFDE_TxtEdtPage::UnloadPage(const CFX_RectF* pClipBox) { - FXSYS_assert(m_nRefCount > 0); + ASSERT(m_nRefCount > 0); m_nRefCount--; if (m_nRefCount == 0) { m_PieceMassArr.RemoveAll(); diff --git a/xfa/fee/fde_txtedtparag.cpp b/xfa/fee/fde_txtedtparag.cpp index 00899a140f..0aae327b16 100644 --- a/xfa/fee/fde_txtedtparag.cpp +++ b/xfa/fee/fde_txtedtparag.cpp @@ -19,7 +19,7 @@ CFDE_TxtEdtParag::CFDE_TxtEdtParag(CFDE_TxtEdtEngine* pEngine) m_nLineCount(0), m_lpData(NULL), m_pEngine(pEngine) { - FXSYS_assert(m_pEngine); + ASSERT(m_pEngine); } CFDE_TxtEdtParag::~CFDE_TxtEdtParag() { if (m_lpData != NULL) { @@ -92,9 +92,9 @@ void CFDE_TxtEdtParag::LoadParag() { LineBaseArr.RemoveAll(); } void CFDE_TxtEdtParag::UnloadParag() { - FXSYS_assert(m_lpData != NULL); + ASSERT(m_lpData != NULL); ((int32_t*)m_lpData)[0]--; - FXSYS_assert(((int32_t*)m_lpData)[0] >= 0); + ASSERT(((int32_t*)m_lpData)[0] >= 0); if (((int32_t*)m_lpData)[0] == 0) { FX_Free(m_lpData); m_lpData = NULL; @@ -139,7 +139,7 @@ void CFDE_TxtEdtParag::GetLineRange(int32_t nLineIndex, int32_t& nStart, int32_t& nCount) const { int32_t* pLineBaseArr = (int32_t*)m_lpData; - FXSYS_assert(nLineIndex < m_nLineCount); + ASSERT(nLineIndex < m_nLineCount); nStart = m_nCharStart; pLineBaseArr++; for (int32_t i = 0; i < nLineIndex; i++) { diff --git a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp index e77c5f14bf..408558a9ca 100644 --- a/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp +++ b/xfa/fee/fx_wordbreak/fx_wordbreak_impl.cpp @@ -14,7 +14,7 @@ FX_WordBreakProp FX_GetWordBreakProperty(FX_WCHAR wcCodePoint) { } CFX_CharIter::CFX_CharIter(const CFX_WideString& wsText) : m_wsText(wsText), m_nIndex(0) { - FXSYS_assert(!wsText.IsEmpty()); + ASSERT(!wsText.IsEmpty()); } CFX_CharIter::~CFX_CharIter() {} void CFX_CharIter::Release() { @@ -69,7 +69,7 @@ void CFX_WordBreak::Release() { delete this; } void CFX_WordBreak::Attach(IFX_CharIter* pIter) { - FXSYS_assert(pIter); + ASSERT(pIter); m_pCurIter = pIter; } void CFX_WordBreak::Attach(const CFX_WideString& wsText) { @@ -183,7 +183,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter, } } if (nFlags > 0) { - FXSYS_assert(nFlags <= 2); + ASSERT(nFlags <= 2); if (!((nFlags == 1 && ePreType == FX_WordBreakProp_ALetter) || (nFlags == 2 && ePreType == FX_WordBreakProp_Numberic))) { pIter->Next(!bPrev); @@ -215,7 +215,7 @@ FX_BOOL CFX_WordBreak::FindNextBreakPos(IFX_CharIter* pIter, pIter->Next(!bPrev); return TRUE; } - FXSYS_assert(nFlags <= 2); + ASSERT(nFlags <= 2); pIter->Next(bPrev); wcTemp = pIter->GetChar(); eNextType = (FX_WordBreakProp)FX_GetWordBreakProperty(wcTemp); diff --git a/xfa/fgas/crt/fgas_algorithm.cpp b/xfa/fgas/crt/fgas_algorithm.cpp index ce8dda646a..ee557b10d9 100644 --- a/xfa/fgas/crt/fgas_algorithm.cpp +++ b/xfa/fgas/crt/fgas_algorithm.cpp @@ -55,7 +55,7 @@ static void FX_Base64EncodePiece(const FX_BASE64DATA& src, } } int32_t FX_Base64EncodeA(const uint8_t* pSrc, int32_t iSrcLen, FX_CHAR* pDst) { - FXSYS_assert(pSrc != NULL); + ASSERT(pSrc != NULL); if (iSrcLen < 1) { return 0; } @@ -118,7 +118,7 @@ static void FX_Base64DecodePiece(const FX_CHAR src[4], int32_t iChars, FX_BASE64DATA& dst, int32_t& iBytes) { - FXSYS_assert(iChars > 0 && iChars < 5); + ASSERT(iChars > 0 && iChars < 5); iBytes = 1; dst.data2 = g_FXBase64DecoderMap[(uint8_t)src[0]]; if (iChars > 1) { @@ -144,7 +144,7 @@ static void FX_Base64DecodePiece(const FX_CHAR src[4], } } int32_t FX_Base64DecodeA(const FX_CHAR* pSrc, int32_t iSrcLen, uint8_t* pDst) { - FXSYS_assert(pSrc != NULL); + ASSERT(pSrc != NULL); if (iSrcLen < 1) { return 0; } @@ -200,7 +200,7 @@ int32_t FX_Base64DecodeA(const FX_CHAR* pSrc, int32_t iSrcLen, uint8_t* pDst) { return pDstEnd - pDst; } int32_t FX_Base64DecodeW(const FX_WCHAR* pSrc, int32_t iSrcLen, uint8_t* pDst) { - FXSYS_assert(pSrc != NULL); + ASSERT(pSrc != NULL); if (iSrcLen < 1) { return 0; } diff --git a/xfa/fgas/crt/fgas_algorithm.h b/xfa/fgas/crt/fgas_algorithm.h index 94a0d06f9e..9fefb2bc40 100644 --- a/xfa/fgas/crt/fgas_algorithm.h +++ b/xfa/fgas/crt/fgas_algorithm.h @@ -31,7 +31,7 @@ template class CFX_DSPATemplate { public: int32_t Lookup(const baseType& find, const baseType* pArray, int32_t iCount) { - FXSYS_assert(pArray != NULL); + ASSERT(pArray != NULL); if (iCount < 1) { return -1; } 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]; diff --git a/xfa/fgas/crt/fgas_encode.cpp b/xfa/fgas/crt/fgas_encode.cpp index 84a1ef40ed..b84406f642 100644 --- a/xfa/fgas/crt/fgas_encode.cpp +++ b/xfa/fgas/crt/fgas_encode.cpp @@ -7,7 +7,7 @@ #include "xfa/fgas/crt/fgas_codepage.h" void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { - FXSYS_assert(pStr != NULL); + ASSERT(pStr != NULL); if (iLength < 0) { iLength = FXSYS_wcslen(pStr); } @@ -30,7 +30,7 @@ void FX_SwapByteOrder(FX_WCHAR* pStr, int32_t iLength) { void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, FX_WCHAR* pDst, int32_t iLength) { - FXSYS_assert(pSrc != NULL && pDst != NULL); + ASSERT(pSrc != NULL && pDst != NULL); if (iLength < 0) { iLength = FXSYS_wcslen(pSrc); } @@ -51,7 +51,7 @@ void FX_SwapByteOrderCopy(const FX_WCHAR* pSrc, } } void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) { - FXSYS_assert(pBuffer != NULL && iLength > 0); + ASSERT(pBuffer != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { return; } @@ -64,7 +64,7 @@ void FX_UTF16ToWChar(void* pBuffer, int32_t iLength) { void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, FX_WCHAR* pWChar, int32_t iLength) { - FXSYS_assert(pUTF16 != NULL && pWChar != NULL && iLength > 0); + ASSERT(pUTF16 != NULL && pWChar != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { FXSYS_memcpy(pWChar, pUTF16, iLength * sizeof(FX_WCHAR)); } else { @@ -74,7 +74,7 @@ void FX_UTF16ToWCharCopy(const uint16_t* pUTF16, } } void FX_WCharToUTF16(void* pBuffer, int32_t iLength) { - FXSYS_assert(pBuffer != NULL && iLength > 0); + ASSERT(pBuffer != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { return; } @@ -87,7 +87,7 @@ void FX_WCharToUTF16(void* pBuffer, int32_t iLength) { void FX_WCharToUTF16Copy(const FX_WCHAR* pWChar, uint16_t* pUTF16, int32_t iLength) { - FXSYS_assert(pWChar != NULL && pUTF16 != NULL && iLength > 0); + ASSERT(pWChar != NULL && pUTF16 != NULL && iLength > 0); if (sizeof(FX_WCHAR) == 2) { FXSYS_memcpy(pUTF16, pWChar, iLength * sizeof(FX_WCHAR)); } else { diff --git a/xfa/fgas/crt/fgas_memory.cpp b/xfa/fgas/crt/fgas_memory.cpp index 7eda5b9ba6..4334789cb7 100644 --- a/xfa/fgas/crt/fgas_memory.cpp +++ b/xfa/fgas/crt/fgas_memory.cpp @@ -159,7 +159,7 @@ CFX_StaticStore::CFX_StaticStore(size_t iDefChunkSize) m_iDefChunkSize(iDefChunkSize), m_pChunk(NULL), m_pLastChunk(NULL) { - FXSYS_assert(m_iDefChunkSize != 0); + ASSERT(m_iDefChunkSize != 0); } CFX_StaticStore::~CFX_StaticStore() { FX_STATICSTORECHUNK* pChunk = m_pChunk; @@ -170,7 +170,7 @@ CFX_StaticStore::~CFX_StaticStore() { } } FX_STATICSTORECHUNK* CFX_StaticStore::AllocChunk(size_t size) { - FXSYS_assert(size != 0); + ASSERT(size != 0); FX_STATICSTORECHUNK* pChunk = (FX_STATICSTORECHUNK*)FX_Alloc( uint8_t, sizeof(FX_STATICSTORECHUNK) + size); pChunk->iChunkSize = size; @@ -185,7 +185,7 @@ FX_STATICSTORECHUNK* CFX_StaticStore::AllocChunk(size_t size) { return pChunk; } FX_STATICSTORECHUNK* CFX_StaticStore::FindChunk(size_t size) { - FXSYS_assert(size != 0); + ASSERT(size != 0); if (m_pLastChunk == NULL || m_pLastChunk->iFreeSize < size) { return AllocChunk(std::max(m_iDefChunkSize, size)); } @@ -193,9 +193,9 @@ FX_STATICSTORECHUNK* CFX_StaticStore::FindChunk(size_t size) { } void* CFX_StaticStore::Alloc(size_t size) { size = FX_4BYTEALIGN(size); - FXSYS_assert(size != 0); + ASSERT(size != 0); FX_STATICSTORECHUNK* pChunk = FindChunk(size); - FXSYS_assert(pChunk->iFreeSize >= size); + ASSERT(pChunk->iFreeSize >= size); uint8_t* p = (uint8_t*)pChunk; p += sizeof(FX_STATICSTORECHUNK) + pChunk->iChunkSize - pChunk->iFreeSize; pChunk->iFreeSize -= size; @@ -203,7 +203,7 @@ void* CFX_StaticStore::Alloc(size_t size) { return p; } size_t CFX_StaticStore::SetDefChunkSize(size_t size) { - FXSYS_assert(size != 0); + ASSERT(size != 0); size_t v = m_iDefChunkSize; m_iDefChunkSize = size; return v; @@ -212,7 +212,7 @@ CFX_FixedStore::CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk) : m_iBlockSize(FX_4BYTEALIGN(iBlockSize)), m_iDefChunkSize(FX_4BYTEALIGN(iBlockNumsInChunk)), m_pChunk(NULL) { - FXSYS_assert(m_iBlockSize != 0 && m_iDefChunkSize != 0); + ASSERT(m_iBlockSize != 0 && m_iDefChunkSize != 0); } CFX_FixedStore::~CFX_FixedStore() { FX_FIXEDSTORECHUNK* pChunk = m_pChunk; @@ -251,20 +251,20 @@ void* CFX_FixedStore::Alloc(size_t size) { if (pChunk == NULL) { pChunk = AllocChunk(); } - FXSYS_assert(pChunk != NULL); + ASSERT(pChunk != NULL); uint8_t* pFlags = pChunk->FirstFlag(); size_t i = 0; for (; i < pChunk->iChunkSize; i++) if (pFlags[i] == 0) { break; } - FXSYS_assert(i < pChunk->iChunkSize); + ASSERT(i < pChunk->iChunkSize); pFlags[i] = 1; pChunk->iFreeNum--; return pChunk->FirstBlock() + i * m_iBlockSize; } void CFX_FixedStore::Free(void* pBlock) { - FXSYS_assert(pBlock != NULL); + ASSERT(pBlock != NULL); FX_FIXEDSTORECHUNK* pPrior = NULL; FX_FIXEDSTORECHUNK* pChunk = m_pChunk; uint8_t* pStart = NULL; @@ -279,9 +279,9 @@ void CFX_FixedStore::Free(void* pBlock) { } pPrior = pChunk, pChunk = pChunk->pNextChunk; } - FXSYS_assert(pChunk != NULL); + ASSERT(pChunk != NULL); size_t iPos = ((uint8_t*)pBlock - pStart) / m_iBlockSize; - FXSYS_assert(iPos < pChunk->iChunkSize); + ASSERT(iPos < pChunk->iChunkSize); uint8_t* pFlags = pChunk->FirstFlag(); if (pFlags[iPos] == 0) { return; @@ -298,14 +298,14 @@ void CFX_FixedStore::Free(void* pBlock) { } } size_t CFX_FixedStore::SetDefChunkSize(size_t iChunkSize) { - FXSYS_assert(iChunkSize != 0); + ASSERT(iChunkSize != 0); size_t v = m_iDefChunkSize; m_iDefChunkSize = FX_4BYTEALIGN(iChunkSize); return v; } CFX_DynamicStore::CFX_DynamicStore(size_t iDefChunkSize) : m_iDefChunkSize(iDefChunkSize), m_pChunk(NULL) { - FXSYS_assert(m_iDefChunkSize != 0); + ASSERT(m_iDefChunkSize != 0); } CFX_DynamicStore::~CFX_DynamicStore() { FX_DYNAMICSTORECHUNK* pChunk = m_pChunk; @@ -316,7 +316,7 @@ CFX_DynamicStore::~CFX_DynamicStore() { } } FX_DYNAMICSTORECHUNK* CFX_DynamicStore::AllocChunk(size_t size) { - FXSYS_assert(size != 0); + ASSERT(size != 0); FX_DYNAMICSTORECHUNK* pChunk = (FX_DYNAMICSTORECHUNK*)FX_Alloc( uint8_t, sizeof(FX_DYNAMICSTORECHUNK) + sizeof(FX_DYNAMICSTOREBLOCK) * 2 + size); @@ -346,7 +346,7 @@ FX_DYNAMICSTORECHUNK* CFX_DynamicStore::AllocChunk(size_t size) { } void* CFX_DynamicStore::Alloc(size_t size) { size = FX_4BYTEALIGN(size); - FXSYS_assert(size != 0); + ASSERT(size != 0); FX_DYNAMICSTORECHUNK* pChunk = m_pChunk; FX_DYNAMICSTOREBLOCK* pBlock = NULL; while (pChunk != NULL) { @@ -370,7 +370,7 @@ void* CFX_DynamicStore::Alloc(size_t size) { pChunk = AllocChunk(std::max(m_iDefChunkSize, size)); pBlock = pChunk->FirstBlock(); } - FXSYS_assert(pChunk != NULL && pBlock != NULL); + ASSERT(pChunk != NULL && pBlock != NULL); size_t m = size + sizeof(FX_DYNAMICSTOREBLOCK); pBlock->bUsed = TRUE; if (pBlock->iBlockSize > m) { @@ -386,7 +386,7 @@ void* CFX_DynamicStore::Alloc(size_t size) { return pBlock->Data(); } void CFX_DynamicStore::Free(void* pBlock) { - FXSYS_assert(pBlock != NULL); + ASSERT(pBlock != NULL); FX_DYNAMICSTORECHUNK* pPriorChunk = NULL; FX_DYNAMICSTORECHUNK* pChunk = m_pChunk; while (pChunk != NULL) { @@ -397,7 +397,7 @@ void CFX_DynamicStore::Free(void* pBlock) { } pPriorChunk = pChunk, pChunk = pChunk->pNextChunk; } - FXSYS_assert(pChunk != NULL); + ASSERT(pChunk != NULL); FX_DYNAMICSTOREBLOCK* pPriorBlock = NULL; FX_DYNAMICSTOREBLOCK* pFindBlock = pChunk->FirstBlock(); while (pFindBlock->iBlockSize != 0) { @@ -407,8 +407,8 @@ void CFX_DynamicStore::Free(void* pBlock) { pPriorBlock = pFindBlock; pFindBlock = pFindBlock->NextBlock(); } - FXSYS_assert(pFindBlock->iBlockSize != 0 && pFindBlock->bUsed && - pBlock == (void*)pFindBlock->Data()); + ASSERT(pFindBlock->iBlockSize != 0 && pFindBlock->bUsed && + pBlock == (void*)pFindBlock->Data()); pFindBlock->bUsed = FALSE; pChunk->iFreeSize += pFindBlock->iBlockSize; if (pPriorBlock == NULL) { @@ -439,7 +439,7 @@ void CFX_DynamicStore::Free(void* pBlock) { } } size_t CFX_DynamicStore::SetDefChunkSize(size_t size) { - FXSYS_assert(size != 0); + ASSERT(size != 0); size_t v = m_iDefChunkSize; m_iDefChunkSize = size; return v; diff --git a/xfa/fgas/crt/fgas_stream.cpp b/xfa/fgas/crt/fgas_stream.cpp index 7ee76fa4b4..c05e81ade3 100644 --- a/xfa/fgas/crt/fgas_stream.cpp +++ b/xfa/fgas/crt/fgas_stream.cpp @@ -384,8 +384,8 @@ CFX_FileStreamImp::~CFX_FileStreamImp() { } FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, uint32_t dwAccess) { - FXSYS_assert(m_hFile == NULL); - FXSYS_assert(pszSrcFileName != NULL && FXSYS_wcslen(pszSrcFileName) > 0); + ASSERT(m_hFile == NULL); + ASSERT(pszSrcFileName != NULL && FXSYS_wcslen(pszSrcFileName) > 0); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN32_MOBILE_ || \ _FX_OS_ == _FX_WIN64_ const FX_WCHAR* wsMode; @@ -461,32 +461,32 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName, return TRUE; } int32_t CFX_FileStreamImp::GetLength() const { - FXSYS_assert(m_hFile != NULL); + ASSERT(m_hFile != NULL); return m_iLength; } int32_t CFX_FileStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { - FXSYS_assert(m_hFile != NULL); + ASSERT(m_hFile != NULL); FXSYS_fseek(m_hFile, iOffset, eSeek); return FXSYS_ftell(m_hFile); } int32_t CFX_FileStreamImp::GetPosition() { - FXSYS_assert(m_hFile != NULL); + ASSERT(m_hFile != NULL); return FXSYS_ftell(m_hFile); } FX_BOOL CFX_FileStreamImp::IsEOF() const { - FXSYS_assert(m_hFile != NULL); + ASSERT(m_hFile != NULL); return FXSYS_ftell(m_hFile) >= m_iLength; } int32_t CFX_FileStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_hFile != NULL); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_hFile != NULL); + ASSERT(pBuffer != NULL && iBufferSize > 0); return FXSYS_fread(pBuffer, 1, iBufferSize, m_hFile); } int32_t CFX_FileStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS) { - FXSYS_assert(m_hFile != NULL); - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(m_hFile != NULL); + ASSERT(pStr != NULL && iMaxLength > 0); if (m_iLength <= 0) { return 0; } @@ -509,8 +509,8 @@ int32_t CFX_FileStreamImp::ReadString(FX_WCHAR* pStr, } int32_t CFX_FileStreamImp::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(pBuffer != NULL && iBufferSize > 0); int32_t iRet = FXSYS_fwrite(pBuffer, 1, iBufferSize, m_hFile); if (iRet != 0) { int32_t iPos = FXSYS_ftell(m_hFile); @@ -521,8 +521,8 @@ int32_t CFX_FileStreamImp::WriteData(const uint8_t* pBuffer, return iRet; } int32_t CFX_FileStreamImp::WriteString(const FX_WCHAR* pStr, int32_t iLength) { - FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); - FXSYS_assert(pStr != NULL && iLength > 0); + ASSERT(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(pStr != NULL && iLength > 0); int32_t iRet = FXSYS_fwrite(pStr, 2, iLength, m_hFile); if (iRet != 0) { int32_t iPos = FXSYS_ftell(m_hFile); @@ -533,11 +533,11 @@ int32_t CFX_FileStreamImp::WriteString(const FX_WCHAR* pStr, int32_t iLength) { return iRet; } void CFX_FileStreamImp::Flush() { - FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FXSYS_fflush(m_hFile); } FX_BOOL CFX_FileStreamImp::SetLength(int32_t iLength) { - FXSYS_assert(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(m_hFile != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); FX_BOOL bRet = FX_fsetsize(m_hFile, iLength); m_iLength = FX_filelength(m_hFile); return bRet; @@ -546,7 +546,7 @@ CFX_FileReadStreamImp::CFX_FileReadStreamImp() : m_pFileRead(NULL), m_iPosition(0), m_iLength(0) {} FX_BOOL CFX_FileReadStreamImp::LoadFileRead(IFX_FileRead* pFileRead, uint32_t dwAccess) { - FXSYS_assert(m_pFileRead == NULL && pFileRead != NULL); + ASSERT(m_pFileRead == NULL && pFileRead != NULL); if (dwAccess & FX_STREAMACCESS_Write) { return FALSE; } @@ -580,8 +580,8 @@ FX_BOOL CFX_FileReadStreamImp::IsEOF() const { return m_iPosition >= m_iLength; } int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_pFileRead != NULL); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_pFileRead != NULL); + ASSERT(pBuffer != NULL && iBufferSize > 0); if (iBufferSize > m_iLength - m_iPosition) { iBufferSize = m_iLength - m_iPosition; } @@ -594,8 +594,8 @@ int32_t CFX_FileReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { int32_t CFX_FileReadStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS) { - FXSYS_assert(m_pFileRead != NULL); - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(m_pFileRead != NULL); + ASSERT(pStr != NULL && iMaxLength > 0); iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2; if (iMaxLength <= 0) { return 0; @@ -621,7 +621,7 @@ FX_BOOL CFX_BufferReadStreamImp::LoadBufferRead(IFX_BufferRead* pBufferRead, int32_t iFileSize, uint32_t dwAccess, FX_BOOL bReleaseBufferRead) { - FXSYS_assert(m_pBufferRead == NULL && pBufferRead != NULL); + ASSERT(m_pBufferRead == NULL && pBufferRead != NULL); if (dwAccess & FX_STREAMACCESS_Write) { return FALSE; } @@ -669,8 +669,8 @@ FX_BOOL CFX_BufferReadStreamImp::IsEOF() const { } int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_pBufferRead != NULL); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_pBufferRead != NULL); + ASSERT(pBuffer != NULL && iBufferSize > 0); int32_t iLength = GetLength(); if (m_iPosition >= iLength) { return 0; @@ -724,8 +724,8 @@ int32_t CFX_BufferReadStreamImp::ReadData(uint8_t* pBuffer, int32_t CFX_BufferReadStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS) { - FXSYS_assert(m_pBufferRead != NULL); - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(m_pBufferRead != NULL); + ASSERT(pStr != NULL && iMaxLength > 0); iMaxLength = ReadData((uint8_t*)pStr, iMaxLength * 2) / 2; if (iMaxLength <= 0) { return 0; @@ -741,7 +741,7 @@ CFX_FileWriteStreamImp::CFX_FileWriteStreamImp() : m_pFileWrite(NULL), m_iPosition(0) {} FX_BOOL CFX_FileWriteStreamImp::LoadFileWrite(IFX_FileWrite* pFileWrite, uint32_t dwAccess) { - FXSYS_assert(m_pFileWrite == NULL && pFileWrite != NULL); + ASSERT(m_pFileWrite == NULL && pFileWrite != NULL); if (dwAccess & FX_STREAMACCESS_Read) { return FALSE; } @@ -808,8 +808,8 @@ CFX_BufferStreamImp::CFX_BufferStreamImp() FX_BOOL CFX_BufferStreamImp::LoadBuffer(uint8_t* pData, int32_t iTotalSize, uint32_t dwAccess) { - FXSYS_assert(m_pData == NULL); - FXSYS_assert(pData != NULL && iTotalSize > 0); + ASSERT(m_pData == NULL); + ASSERT(pData != NULL && iTotalSize > 0); m_dwAccess = dwAccess; m_pData = pData; m_iTotalSize = iTotalSize; @@ -818,11 +818,11 @@ FX_BOOL CFX_BufferStreamImp::LoadBuffer(uint8_t* pData, return TRUE; } int32_t CFX_BufferStreamImp::GetLength() const { - FXSYS_assert(m_pData != NULL); + ASSERT(m_pData != NULL); return m_iLength; } int32_t CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { - FXSYS_assert(m_pData != NULL); + ASSERT(m_pData != NULL); if (eSeek == FX_STREAMSEEK_Begin) { m_iPosition = iOffset; } else if (eSeek == FX_STREAMSEEK_Current) { @@ -839,16 +839,16 @@ int32_t CFX_BufferStreamImp::Seek(FX_STREAMSEEK eSeek, int32_t iOffset) { return m_iPosition; } int32_t CFX_BufferStreamImp::GetPosition() { - FXSYS_assert(m_pData != NULL); + ASSERT(m_pData != NULL); return m_iPosition; } FX_BOOL CFX_BufferStreamImp::IsEOF() const { - FXSYS_assert(m_pData != NULL); + ASSERT(m_pData != NULL); return m_iPosition >= m_iLength; } int32_t CFX_BufferStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_pData != NULL); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_pData != NULL); + ASSERT(pBuffer != NULL && iBufferSize > 0); int32_t iLen = std::min(m_iLength - m_iPosition, iBufferSize); if (iLen <= 0) { return 0; @@ -860,8 +860,8 @@ int32_t CFX_BufferStreamImp::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { int32_t CFX_BufferStreamImp::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS) { - FXSYS_assert(m_pData != NULL); - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(m_pData != NULL); + ASSERT(pStr != NULL && iMaxLength > 0); int32_t iLen = std::min((m_iLength - m_iPosition) / 2, iMaxLength); if (iLen <= 0) { return 0; @@ -878,8 +878,8 @@ int32_t CFX_BufferStreamImp::ReadString(FX_WCHAR* pStr, } int32_t CFX_BufferStreamImp::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(pBuffer != NULL && iBufferSize > 0); int32_t iLen = std::min(m_iTotalSize - m_iPosition, iBufferSize); if (iLen <= 0) { return 0; @@ -893,8 +893,8 @@ int32_t CFX_BufferStreamImp::WriteData(const uint8_t* pBuffer, } int32_t CFX_BufferStreamImp::WriteString(const FX_WCHAR* pStr, int32_t iLength) { - FXSYS_assert(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); - FXSYS_assert(pStr != NULL && iLength > 0); + ASSERT(m_pData != NULL && (m_dwAccess & FX_STREAMACCESS_Write) != 0); + ASSERT(pStr != NULL && iLength > 0); int32_t iLen = std::min((m_iTotalSize - m_iPosition) / 2, iLength); if (iLen <= 0) { return 0; @@ -908,7 +908,7 @@ int32_t CFX_BufferStreamImp::WriteString(const FX_WCHAR* pStr, } IFX_Stream* IFX_Stream::CreateTextStream(IFX_Stream* pBaseStream, FX_BOOL bDeleteOnRelease) { - FXSYS_assert(pBaseStream != NULL); + ASSERT(pBaseStream != NULL); return new CFX_TextStream(pBaseStream, bDeleteOnRelease); } CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream) @@ -920,7 +920,7 @@ CFX_TextStream::CFX_TextStream(IFX_Stream* pStream, FX_BOOL bDelStream) m_bDelStream(bDelStream), m_pStreamImp(pStream), m_iRefCount(1) { - FXSYS_assert(m_pStreamImp != NULL); + ASSERT(m_pStreamImp != NULL); m_pStreamImp->Retain(); InitStream(); } @@ -1049,7 +1049,7 @@ int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS, int32_t const* pByteSize) { - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(pStr != NULL && iMaxLength > 0); if (m_pStreamImp == NULL) { return -1; } @@ -1099,7 +1099,7 @@ int32_t CFX_TextStream::ReadString(FX_WCHAR* pStr, return iMaxLength; } int32_t CFX_TextStream::WriteString(const FX_WCHAR* pStr, int32_t iLength) { - FXSYS_assert(pStr != NULL && iLength > 0); + ASSERT(pStr != NULL && iLength > 0); if ((m_pStreamImp->GetAccessModes() & FX_STREAMACCESS_Write) == 0) { return -1; } @@ -1302,7 +1302,7 @@ FX_BOOL CFX_Stream::IsEOF() const { return m_iPosition >= m_iStart + m_iLength; } int32_t CFX_Stream::ReadData(uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(pBuffer != NULL && iBufferSize > 0); if (m_pStreamImp == NULL) { return -1; } @@ -1321,7 +1321,7 @@ int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, int32_t iMaxLength, FX_BOOL& bEOS, int32_t const* pByteSize) { - FXSYS_assert(pStr != NULL && iMaxLength > 0); + ASSERT(pStr != NULL && iMaxLength > 0); if (m_pStreamImp == NULL) { return -1; } @@ -1346,7 +1346,7 @@ int32_t CFX_Stream::ReadString(FX_WCHAR* pStr, } int32_t CFX_Stream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) { - FXSYS_assert(pBuffer != NULL && iBufferSize > 0); + ASSERT(pBuffer != NULL && iBufferSize > 0); if (m_pStreamImp == NULL) { return -1; } @@ -1372,7 +1372,7 @@ int32_t CFX_Stream::WriteData(const uint8_t* pBuffer, int32_t iBufferSize) { return iLen; } int32_t CFX_Stream::WriteString(const FX_WCHAR* pStr, int32_t iLength) { - FXSYS_assert(pStr != NULL && iLength > 0); + ASSERT(pStr != NULL && iLength > 0); if (m_pStreamImp == NULL) { return -1; } @@ -1438,7 +1438,7 @@ uint16_t CFX_Stream::SetCodePage(uint16_t wCodePage) { IFX_Stream* CFX_Stream::CreateSharedStream(uint32_t dwAccess, int32_t iOffset, int32_t iLength) { - FXSYS_assert(iLength > 0); + ASSERT(iLength > 0); if (m_pStreamImp == NULL) { return NULL; } @@ -1474,12 +1474,12 @@ IFX_Stream* CFX_Stream::CreateSharedStream(uint32_t dwAccess, } IFX_FileRead* FX_CreateFileRead(IFX_Stream* pBaseStream, FX_BOOL bReleaseStream) { - FXSYS_assert(pBaseStream != NULL); + ASSERT(pBaseStream != NULL); return new CFGAS_FileRead(pBaseStream, bReleaseStream); } CFGAS_FileRead::CFGAS_FileRead(IFX_Stream* pStream, FX_BOOL bReleaseStream) : m_bReleaseStream(bReleaseStream), m_pStream(pStream) { - FXSYS_assert(m_pStream != NULL); + ASSERT(m_pStream != NULL); } CFGAS_FileRead::~CFGAS_FileRead() { if (m_bReleaseStream) { @@ -1511,7 +1511,7 @@ CFX_BufferAccImp::CFX_BufferAccImp(IFX_BufferRead* pBufferRead, : m_pBufferRead(pBufferRead), m_bReleaseStream(bReleaseStream), m_iBufSize(iFileSize) { - FXSYS_assert(m_pBufferRead); + ASSERT(m_pBufferRead); } CFX_BufferAccImp::~CFX_BufferAccImp() { if (m_bReleaseStream && m_pBufferRead) { @@ -1593,13 +1593,13 @@ FX_BOOL CFX_BufferAccImp::ReadBlock(void* buffer, IFX_FileWrite* FX_CreateFileWrite(IFX_Stream* pBaseStream, FX_BOOL bReleaseStream) { - FXSYS_assert(pBaseStream != NULL); + ASSERT(pBaseStream != NULL); return new CFGAS_FileWrite(pBaseStream, bReleaseStream); } CFGAS_FileWrite::CFGAS_FileWrite(IFX_Stream* pStream, FX_BOOL bReleaseStream) : m_pStream(pStream), m_bReleaseStream(bReleaseStream) { - FXSYS_assert(m_pStream != NULL); + ASSERT(m_pStream != NULL); } CFGAS_FileWrite::~CFGAS_FileWrite() { if (m_bReleaseStream) { diff --git a/xfa/fgas/crt/fgas_system.cpp b/xfa/fgas/crt/fgas_system.cpp index 7ba2d924ca..3ab39268ef 100644 --- a/xfa/fgas/crt/fgas_system.cpp +++ b/xfa/fgas/crt/fgas_system.cpp @@ -30,7 +30,7 @@ inline int32_t FX_tolower(int32_t ch) { } // namespace int32_t FX_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) { - FXSYS_assert(s1 != NULL && s2 != NULL && count > 0); + ASSERT(s1 != NULL && s2 != NULL && count > 0); FX_WCHAR wch1 = 0; FX_WCHAR wch2 = 0; while (count-- > 0) { @@ -44,7 +44,7 @@ int32_t FX_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count) { } int32_t FX_filelength(FXSYS_FILE* file) { - FXSYS_assert(file != NULL); + ASSERT(file != NULL); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ return _filelength(_fileno(file)); #else @@ -57,7 +57,7 @@ int32_t FX_filelength(FXSYS_FILE* file) { } FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size) { - FXSYS_assert(file != NULL); + ASSERT(file != NULL); #if _FX_OS_ == _FX_WIN32_DESKTOP_ || _FX_OS_ == _FX_WIN64_ return _chsize(_fileno(file), size) == 0; #elif _FX_OS_ == _FX_WIN32_MOBILE_ @@ -73,7 +73,7 @@ FX_BOOL FX_fsetsize(FXSYS_FILE* file, int32_t size) { } FX_FLOAT FX_wcstof(const FX_WCHAR* pwsStr, int32_t iLength, int32_t* pUsedLen) { - FXSYS_assert(pwsStr != NULL); + ASSERT(pwsStr != NULL); if (iLength < 0) { iLength = FXSYS_wcslen(pwsStr); } diff --git a/xfa/fgas/crt/fgas_utils.cpp b/xfa/fgas/crt/fgas_utils.cpp index 0d020ec38f..01792b833a 100644 --- a/xfa/fgas/crt/fgas_utils.cpp +++ b/xfa/fgas/crt/fgas_utils.cpp @@ -28,7 +28,7 @@ class FX_BASEARRAYDATA : public CFX_Target { uint8_t* pBuffer; }; CFX_BaseArray::CFX_BaseArray(int32_t iGrowSize, int32_t iBlockSize) { - FXSYS_assert(iGrowSize > 0 && iBlockSize > 0); + ASSERT(iGrowSize > 0 && iBlockSize > 0); m_pData = new FX_BASEARRAYDATA(iGrowSize, iBlockSize); } CFX_BaseArray::~CFX_BaseArray() { @@ -42,7 +42,7 @@ int32_t CFX_BaseArray::GetBlockSize() const { return m_pData->iBlockSize; } uint8_t* CFX_BaseArray::AddSpaceTo(int32_t index) { - FXSYS_assert(index > -1); + ASSERT(index > -1); uint8_t*& pBuffer = m_pData->pBuffer; int32_t& iTotalCount = m_pData->iTotalCount; int32_t iBlockSize = m_pData->iBlockSize; @@ -63,7 +63,7 @@ uint8_t* CFX_BaseArray::AddSpaceTo(int32_t index) { return pBuffer + index * iBlockSize; } uint8_t* CFX_BaseArray::GetAt(int32_t index) const { - FXSYS_assert(index > -1 && index < m_pData->iBlockCount); + ASSERT(index > -1 && index < m_pData->iBlockCount); return m_pData->pBuffer + index * m_pData->iBlockSize; } uint8_t* CFX_BaseArray::GetBuffer() const { @@ -73,10 +73,10 @@ int32_t CFX_BaseArray::Append(const CFX_BaseArray& src, int32_t iStart, int32_t iCount) { int32_t iBlockSize = m_pData->iBlockSize; - FXSYS_assert(iBlockSize == src.m_pData->iBlockSize); + ASSERT(iBlockSize == src.m_pData->iBlockSize); int32_t& iBlockCount = m_pData->iBlockCount; int32_t iAdded = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iAdded); + ASSERT(iStart > -1 && iStart < iAdded); if (iCount < 0) { iCount = iAdded; } @@ -96,9 +96,9 @@ int32_t CFX_BaseArray::Copy(const CFX_BaseArray& src, int32_t iStart, int32_t iCount) { int32_t iBlockSize = m_pData->iBlockSize; - FXSYS_assert(iBlockSize == src.m_pData->iBlockSize); + ASSERT(iBlockSize == src.m_pData->iBlockSize); int32_t iCopied = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iCopied); + ASSERT(iStart > -1 && iStart < iCopied); if (iCount < 0) { iCount = iCopied; } @@ -142,7 +142,7 @@ CFX_BaseMassArrayImp::CFX_BaseMassArrayImp(int32_t iChunkSize, m_iBlockSize(iBlockSize), m_iChunkCount(0), m_iBlockCount(0) { - FXSYS_assert(m_iChunkSize > 0 && m_iBlockSize > 0); + ASSERT(m_iChunkSize > 0 && m_iBlockSize > 0); m_pData = new CFX_PtrArray; m_pData->SetSize(16); } @@ -151,7 +151,7 @@ CFX_BaseMassArrayImp::~CFX_BaseMassArrayImp() { delete m_pData; } uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) { - FXSYS_assert(index > -1); + ASSERT(index > -1); uint8_t* pChunk; if (index < m_iBlockCount) { pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize); @@ -172,22 +172,22 @@ uint8_t* CFX_BaseMassArrayImp::AddSpaceTo(int32_t index) { } } } - FXSYS_assert(pChunk != NULL); + ASSERT(pChunk != NULL); m_iBlockCount = index + 1; return pChunk + (index % m_iChunkSize) * m_iBlockSize; } uint8_t* CFX_BaseMassArrayImp::GetAt(int32_t index) const { - FXSYS_assert(index > -1 && index < m_iBlockCount); + ASSERT(index > -1 && index < m_iBlockCount); uint8_t* pChunk = (uint8_t*)m_pData->GetAt(index / m_iChunkSize); - FXSYS_assert(pChunk != NULL); + ASSERT(pChunk != NULL); return pChunk + (index % m_iChunkSize) * m_iBlockSize; } int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp& src, int32_t iStart, int32_t iCount) { - FXSYS_assert(m_iBlockSize == src.m_iBlockSize); + ASSERT(m_iBlockSize == src.m_iBlockSize); int32_t iAdded = src.m_iBlockCount; - FXSYS_assert(iStart > -1 && iStart < iAdded); + ASSERT(iStart > -1 && iStart < iAdded); if (iCount < 0) { iCount = iAdded; } @@ -206,9 +206,9 @@ int32_t CFX_BaseMassArrayImp::Append(const CFX_BaseMassArrayImp& src, int32_t CFX_BaseMassArrayImp::Copy(const CFX_BaseMassArrayImp& src, int32_t iStart, int32_t iCount) { - FXSYS_assert(m_iBlockSize == src.m_iBlockSize); + ASSERT(m_iBlockSize == src.m_iBlockSize); int32_t iCopied = src.m_iBlockCount; - FXSYS_assert(iStart > -1); + ASSERT(iStart > -1); if (iStart >= iCopied) { return 0; } @@ -233,14 +233,14 @@ void CFX_BaseMassArrayImp::Append(int32_t iDstStart, const CFX_BaseMassArrayImp& src, int32_t iSrcStart, int32_t iSrcCount) { - FXSYS_assert(iDstStart > -1); - FXSYS_assert(m_iBlockSize == src.m_iBlockSize); - FXSYS_assert(src.m_iBlockCount > 0); - FXSYS_assert(m_iBlockCount >= iDstStart + iSrcCount); - FXSYS_assert(iSrcStart > -1); - FXSYS_assert(iSrcStart < src.m_iBlockCount); - FXSYS_assert(iSrcCount > 0); - FXSYS_assert(iSrcStart + iSrcCount <= src.m_iBlockCount); + ASSERT(iDstStart > -1); + ASSERT(m_iBlockSize == src.m_iBlockSize); + ASSERT(src.m_iBlockCount > 0); + ASSERT(m_iBlockCount >= iDstStart + iSrcCount); + ASSERT(iSrcStart > -1); + ASSERT(iSrcStart < src.m_iBlockCount); + ASSERT(iSrcCount > 0); + ASSERT(iSrcStart + iSrcCount <= src.m_iBlockCount); int32_t iDstChunkIndex = iDstStart / m_iChunkSize; int32_t iSrcChunkIndex = iSrcStart / src.m_iChunkSize; @@ -252,7 +252,7 @@ void CFX_BaseMassArrayImp::Append(int32_t iDstStart, std::min(iSrcCount, std::min(iSrcChunkSize, iDstChunkSize)); int32_t iCopyBytes = iCopySize * m_iBlockSize; while (iSrcCount > 0) { - FXSYS_assert(pDstChunk != NULL && pSrcChunk != NULL); + ASSERT(pDstChunk != NULL && pSrcChunk != NULL); FXSYS_memcpy(pDstChunk, pSrcChunk, iCopyBytes); iSrcCount -= iCopySize; iSrcChunkSize -= iCopySize; @@ -340,7 +340,7 @@ struct FX_BASEDISCRETEARRAYDATA { CFX_BaseDiscreteArray::CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize) { - FXSYS_assert(iChunkSize > 0 && iBlockSize > 0); + ASSERT(iChunkSize > 0 && iBlockSize > 0); FX_BASEDISCRETEARRAYDATA* pData = new FX_BASEDISCRETEARRAYDATA; m_pData = pData; pData->ChunkBuffer.SetSize(16); @@ -353,7 +353,7 @@ CFX_BaseDiscreteArray::~CFX_BaseDiscreteArray() { delete static_cast(m_pData); } uint8_t* CFX_BaseDiscreteArray::AddSpaceTo(int32_t index) { - FXSYS_assert(index > -1); + ASSERT(index > -1); FX_BASEDISCRETEARRAYDATA* pData = (FX_BASEDISCRETEARRAYDATA*)m_pData; int32_t& iChunkCount = pData->iChunkCount; int32_t iChunkSize = pData->iChunkSize; @@ -373,7 +373,7 @@ uint8_t* CFX_BaseDiscreteArray::AddSpaceTo(int32_t index) { return pChunk + (index % iChunkSize) * pData->iBlockSize; } uint8_t* CFX_BaseDiscreteArray::GetAt(int32_t index) const { - FXSYS_assert(index > -1); + ASSERT(index > -1); FX_BASEDISCRETEARRAYDATA* pData = (FX_BASEDISCRETEARRAYDATA*)m_pData; int32_t iChunkSize = pData->iChunkSize; int32_t iChunk = index / iChunkSize; diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h index 5ebb32ff37..ebbcf4bd97 100644 --- a/xfa/fgas/crt/fgas_utils.h +++ b/xfa/fgas/crt/fgas_utils.h @@ -110,12 +110,12 @@ class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { int32_t Append(const CFX_ObjectBaseArrayTemplate& src, int32_t iStart = 0, int32_t iCount = -1) { - FXSYS_assert(GetBlockSize() == src.GetBlockSize()); + ASSERT(GetBlockSize() == src.GetBlockSize()); if (iCount == 0) { return 0; } int32_t iSize = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iSize); + ASSERT(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } @@ -139,12 +139,12 @@ class CFX_ObjectBaseArrayTemplate : public CFX_BaseArray { int32_t Copy(const CFX_ObjectBaseArrayTemplate& src, int32_t iStart = 0, int32_t iCount = -1) { - FXSYS_assert(GetBlockSize() == src.GetBlockSize()); + ASSERT(GetBlockSize() == src.GetBlockSize()); if (iCount == 0) { return 0; } int32_t iSize = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iSize); + ASSERT(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } @@ -312,7 +312,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { return CFX_BaseMassArray::GetSize(); } int32_t iSize = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iSize); + ASSERT(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } @@ -332,7 +332,7 @@ class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray { return CFX_BaseMassArray::GetSize(); } int32_t iSize = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iSize); + ASSERT(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } @@ -479,7 +479,7 @@ class CFX_ObjectStackTemplate : public CFX_BaseStack { return CFX_BaseStack::GetSize(); } int32_t iSize = src.GetSize(); - FXSYS_assert(iStart > -1 && iStart < iSize); + ASSERT(iStart > -1 && iStart < iSize); if (iCount < 0) { iCount = iSize; } diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp index 21d5d0b5a5..bccaf2cdb6 100644 --- a/xfa/fgas/font/fgas_fontutils.cpp +++ b/xfa/fgas/font/fgas_fontutils.cpp @@ -136,7 +136,7 @@ static const FGAS_FONTUSB g_FXGdiFontUSBTable[] = { const FGAS_FONTUSB* FGAS_GetUnicodeBitField(FX_WCHAR wUnicode) { int32_t iEnd = sizeof(g_FXGdiFontUSBTable) / sizeof(FGAS_FONTUSB) - 1; - FXSYS_assert(iEnd >= 0); + ASSERT(iEnd >= 0); int32_t iStart = 0, iMid; do { iMid = (iStart + iEnd) / 2; diff --git a/xfa/fgas/font/fgas_gefont.cpp b/xfa/fgas/font/fgas_gefont.cpp index ed41076535..7bf877f8c2 100644 --- a/xfa/fgas/font/fgas_gefont.cpp +++ b/xfa/fgas/font/fgas_gefont.cpp @@ -130,8 +130,8 @@ CFX_GEFont::CFX_GEFont(const CFX_GEFont& src, uint32_t dwFontStyles) m_SubstFonts(), m_FontMapper(16) { m_pFont = new CFX_Font; - FXSYS_assert(m_pFont != NULL); - FXSYS_assert(src.m_pFont != NULL); + ASSERT(m_pFont != NULL); + ASSERT(src.m_pFont != NULL); m_pFont->LoadClone(src.m_pFont); CFX_SubstFont* pSubst = m_pFont->GetSubstFont(); if (!pSubst) { @@ -357,7 +357,7 @@ void CFX_GEFont::GetPsName(CFX_WideString& wsName) const { wsName = m_pFont->GetPsName(); } uint32_t CFX_GEFont::GetFontStyles() const { - FXSYS_assert(m_pFont != NULL); + ASSERT(m_pFont != NULL); #if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_ if (m_bUseLogFontStyle) { return m_dwLogFontStyle; @@ -390,7 +390,7 @@ FX_BOOL CFX_GEFont::GetCharWidth(FX_WCHAR wUnicode, int32_t& iWidth, FX_BOOL bRecursive, FX_BOOL bCharCode) { - FXSYS_assert(m_pCharWidthMap != NULL); + ASSERT(m_pCharWidthMap != NULL); iWidth = m_pCharWidthMap->GetAt(wUnicode, 0); if (iWidth < 1) { if (!m_pProvider || @@ -426,8 +426,8 @@ FX_BOOL CFX_GEFont::GetCharBBox(FX_WCHAR wUnicode, CFX_Rect& bbox, FX_BOOL bRecursive, FX_BOOL bCharCode) { - FXSYS_assert(m_pRectArray != NULL); - FXSYS_assert(m_pBBoxMap != NULL); + ASSERT(m_pRectArray != NULL); + ASSERT(m_pBBoxMap != NULL); void* pRect = NULL; if (!m_pBBoxMap->Lookup((void*)(uintptr_t)wUnicode, pRect)) { IFX_Font* pFont = NULL; @@ -478,7 +478,7 @@ int32_t CFX_GEFont::GetGlyphIndex(FX_WCHAR wUnicode, FX_BOOL bRecursive, IFX_Font** ppFont, FX_BOOL bCharCode) { - FXSYS_assert(m_pFontEncoding != NULL); + ASSERT(m_pFontEncoding != NULL); int32_t iGlyphIndex = m_pFontEncoding->GlyphFromCharCode(wUnicode); if (iGlyphIndex > 0) { if (ppFont != NULL) { diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp index 4b2a1422d2..dedc8b0ad2 100644 --- a/xfa/fgas/font/fgas_stdfontmgr.cpp +++ b/xfa/fgas/font/fgas_stdfontmgr.cpp @@ -63,7 +63,7 @@ IFX_Font* CFX_StdFontMgrImp::GetDefFontByCodePage( return NULL; } } - FXSYS_assert(pFD != NULL); + ASSERT(pFD != NULL); pFont = IFX_Font::LoadFont(pFD->wsFontFace, dwFontStyles, wCodePage, this); if (pFont != NULL) { m_Fonts.Add(pFont); @@ -144,7 +144,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily, return NULL; } } - FXSYS_assert(pFD != NULL); + ASSERT(pFD != NULL); if (wCodePage == 0xFFFF) { wCodePage = FX_GetCodePageFromCharset(pFD->uCharSet); } @@ -159,7 +159,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFontFamily, return NULL; } IFX_Font* CFX_StdFontMgrImp::LoadFont(const uint8_t* pBuffer, int32_t iLength) { - FXSYS_assert(pBuffer != NULL && iLength > 0); + ASSERT(pBuffer != NULL && iLength > 0); IFX_Font* pFont = NULL; if (m_BufferFonts.Lookup((void*)pBuffer, (void*&)pFont)) { if (pFont != NULL) { @@ -175,7 +175,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(const uint8_t* pBuffer, int32_t iLength) { return NULL; } IFX_Font* CFX_StdFontMgrImp::LoadFont(const FX_WCHAR* pszFileName) { - FXSYS_assert(pszFileName != NULL); + ASSERT(pszFileName != NULL); uint32_t dwHash = FX_HashCode_GetW(pszFileName, false); IFX_Font* pFont = NULL; if (m_FileFonts.Lookup((void*)(uintptr_t)dwHash, (void*&)pFont)) { @@ -196,7 +196,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, uint32_t dwFontStyles, uint16_t wCodePage, FX_BOOL bSaveStream) { - FXSYS_assert(pFontStream != NULL && pFontStream->GetLength() > 0); + ASSERT(pFontStream != NULL && pFontStream->GetLength() > 0); IFX_Font* pFont = NULL; if (m_StreamFonts.Lookup((void*)pFontStream, (void*&)pFont)) { if (pFont != NULL) { @@ -224,7 +224,7 @@ IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Stream* pFontStream, IFX_Font* CFX_StdFontMgrImp::LoadFont(IFX_Font* pSrcFont, uint32_t dwFontStyles, uint16_t wCodePage) { - FXSYS_assert(pSrcFont != NULL); + ASSERT(pSrcFont != NULL); if (pSrcFont->GetFontStyles() == dwFontStyles) { return pSrcFont->Retain(); } @@ -1191,7 +1191,7 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, ((0 == wCodePage || 0xFFFF == wCodePage) ? (uint16_t)-1 : FX_GetCodePageBit(wCodePage)); if (wBit != (uint16_t)-1) { - FXSYS_assert(wBit < 64); + ASSERT(wBit < 64); if (0 == (pInstalled->m_dwCsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; } else { @@ -1202,7 +1202,7 @@ int32_t CFX_FontMgrImp::CalcPenalty(CFX_FontDescriptor* pInstalled, ((0 == wcUnicode || 0xFFFE == wcUnicode) ? (uint16_t)999 : FX_GetUnicodeBit(wcUnicode)); if (wBit != (uint16_t)999) { - FXSYS_assert(wBit < 128); + ASSERT(wBit < 128); if (0 == (pInstalled->m_dwUsb[wBit / 32] & (1 << (wBit % 32)))) { nPenalty += 0xFFFF; } else { diff --git a/xfa/fgas/layout/fgas_rtfbreak.cpp b/xfa/fgas/layout/fgas_rtfbreak.cpp index 3adb251254..b44af96c77 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.cpp +++ b/xfa/fgas/layout/fgas_rtfbreak.cpp @@ -238,8 +238,8 @@ void CFX_RTFBreak::SetReadingOrder(FX_BOOL bRTL) { m_bRTL = bRTL; } void CFX_RTFBreak::SetAlignment(int32_t iAlignment) { - FXSYS_assert(iAlignment >= FX_RTFLINEALIGNMENT_Left && - iAlignment <= FX_RTFLINEALIGNMENT_Distributed); + ASSERT(iAlignment >= FX_RTFLINEALIGNMENT_Left && + iAlignment <= FX_RTFLINEALIGNMENT_Distributed); m_iAlignment = iAlignment; } void CFX_RTFBreak::SetUserData(IFX_Unknown* pUserData) { @@ -299,7 +299,7 @@ CFX_RTFLine* CFX_RTFBreak::GetRTFLine(FX_BOOL bReady) const { return NULL; } } - FXSYS_assert(m_pCurLine != NULL); + ASSERT(m_pCurLine != NULL); return m_pCurLine; } CFX_RTFPieceArray* CFX_RTFBreak::GetRTFPieces(FX_BOOL bReady) const { @@ -343,7 +343,7 @@ static const FX_RTFBreak_LPFAppendChar g_FX_RTFBreak_lpfAppendChar[16] = { &CFX_RTFBreak::AppendChar_Others, &CFX_RTFBreak::AppendChar_Others, }; uint32_t CFX_RTFBreak::AppendChar(FX_WCHAR wch) { - FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL); + ASSERT(m_pFont != NULL && m_pCurLine != NULL && m_pArabicChar != NULL); if (m_bCharCode) { return AppendChar_CharCode(wch); } @@ -392,8 +392,8 @@ uint32_t CFX_RTFBreak::AppendChar(FX_WCHAR wch) { return std::max(dwRet1, dwRet2); } uint32_t CFX_RTFBreak::AppendChar_CharCode(FX_WCHAR wch) { - FXSYS_assert(m_pFont != NULL && m_pCurLine != NULL); - FXSYS_assert(m_bCharCode); + ASSERT(m_pFont != NULL && m_pCurLine != NULL); + ASSERT(m_bCharCode); m_pCurLine->m_iMBCSChars++; CFX_RTFCharArray& tca = m_pCurLine->m_LineChars; CFX_RTFChar* pCurChar = tca.AddSpace(); @@ -606,8 +606,8 @@ uint32_t CFX_RTFBreak::AppendChar_Others(CFX_RTFChar* pCurChar, return FX_RTFBREAK_None; } uint32_t CFX_RTFBreak::EndBreak(uint32_t dwStatus) { - FXSYS_assert(dwStatus >= FX_RTFBREAK_PieceBreak && - dwStatus <= FX_RTFBREAK_PageBreak); + ASSERT(dwStatus >= FX_RTFBREAK_PieceBreak && + dwStatus <= FX_RTFBREAK_PageBreak); m_dwIdentity++; CFX_RTFPieceArray* pCurPieces = &m_pCurLine->m_LinePieces; int32_t iCount = pCurPieces->GetSize(); @@ -1067,7 +1067,7 @@ int32_t CFX_RTFBreak::GetBreakPos(CFX_RTFCharArray& tca, void CFX_RTFBreak::SplitTextLine(CFX_RTFLine* pCurLine, CFX_RTFLine* pNextLine, FX_BOOL bAllChars) { - FXSYS_assert(pCurLine != NULL && pNextLine != NULL); + ASSERT(pCurLine != NULL && pNextLine != NULL); int32_t iCount = pCurLine->CountChars(); if (iCount < 2) { return; @@ -1181,8 +1181,8 @@ int32_t CFX_RTFBreak::GetDisplayPos(const FX_RTFTEXTOBJ* pText, if (pText == NULL || pText->iLength < 1) { return 0; } - FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && - pText->pFont != NULL && pText->pRect != NULL); + ASSERT(pText->pStr != NULL && pText->pWidths != NULL && + pText->pFont != NULL && pText->pRect != NULL); const FX_WCHAR* pStr = pText->pStr; int32_t* pWidths = pText->pWidths; int32_t iLength = pText->iLength - 1; @@ -1422,8 +1422,8 @@ int32_t CFX_RTFBreak::GetCharRects(const FX_RTFTEXTOBJ* pText, if (pText == NULL || pText->iLength < 1) { return 0; } - FXSYS_assert(pText->pStr != NULL && pText->pWidths != NULL && - pText->pFont != NULL && pText->pRect != NULL); + ASSERT(pText->pStr != NULL && pText->pWidths != NULL && + pText->pFont != NULL && pText->pRect != NULL); const FX_WCHAR* pStr = pText->pStr; int32_t* pWidths = pText->pWidths; int32_t iLength = pText->iLength; diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h index 8a66dd9e93..95de85bde6 100644 --- a/xfa/fgas/layout/fgas_rtfbreak.h +++ b/xfa/fgas/layout/fgas_rtfbreak.h @@ -115,7 +115,7 @@ class CFX_RTFPiece : public CFX_Target { m_pUserData(NULL) {} ~CFX_RTFPiece() { Reset(); } void AppendChar(const CFX_RTFChar& tc) { - FXSYS_assert(m_pChars != NULL); + ASSERT(m_pChars != NULL); m_pChars->Add(tc); if (m_iWidth < 0) { m_iWidth = tc.m_iCharWidth; @@ -130,15 +130,15 @@ class CFX_RTFPiece : public CFX_Target { int32_t GetLength() const { return m_iChars; } int32_t GetEndChar() const { return m_iStartChar + m_iChars; } CFX_RTFChar& GetChar(int32_t index) { - FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); + ASSERT(index > -1 && index < m_iChars && m_pChars != NULL); return *m_pChars->GetDataPtr(m_iStartChar + index); } CFX_RTFChar* GetCharPtr(int32_t index) const { - FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); + ASSERT(index > -1 && index < m_iChars && m_pChars != NULL); return m_pChars->GetDataPtr(m_iStartChar + index); } void GetString(FX_WCHAR* pText) const { - FXSYS_assert(pText != NULL); + ASSERT(pText != NULL); int32_t iEndChar = m_iStartChar + m_iChars; CFX_RTFChar* pChar; for (int32_t i = m_iStartChar; i < iEndChar; i++) { @@ -152,7 +152,7 @@ class CFX_RTFPiece : public CFX_Target { wsText.ReleaseBuffer(m_iChars); } void GetWidths(int32_t* pWidths) const { - FXSYS_assert(pWidths != NULL); + ASSERT(pWidths != NULL); int32_t iEndChar = m_iStartChar + m_iChars; CFX_RTFChar* pChar; for (int32_t i = m_iStartChar; i < iEndChar; i++) { @@ -202,20 +202,20 @@ class CFX_RTFLine { ~CFX_RTFLine() { RemoveAll(); } int32_t CountChars() const { return m_LineChars.GetSize(); } CFX_RTFChar& GetChar(int32_t index) { - FXSYS_assert(index > -1 && index < m_LineChars.GetSize()); + ASSERT(index > -1 && index < m_LineChars.GetSize()); return *m_LineChars.GetDataPtr(index); } CFX_RTFChar* GetCharPtr(int32_t index) { - FXSYS_assert(index > -1 && index < m_LineChars.GetSize()); + ASSERT(index > -1 && index < m_LineChars.GetSize()); return m_LineChars.GetDataPtr(index); } int32_t CountPieces() const { return m_LinePieces.GetSize(); } CFX_RTFPiece& GetPiece(int32_t index) const { - FXSYS_assert(index > -1 && index < m_LinePieces.GetSize()); + ASSERT(index > -1 && index < m_LinePieces.GetSize()); return m_LinePieces.GetAt(index); } CFX_RTFPiece* GetPiecePtr(int32_t index) const { - FXSYS_assert(index > -1 && index < m_LinePieces.GetSize()); + ASSERT(index > -1 && index < m_LinePieces.GetSize()); return m_LinePieces.GetPtrAt(index); } int32_t GetLineEnd() const { return m_iStart + m_iWidth; } diff --git a/xfa/fgas/layout/fgas_textbreak.cpp b/xfa/fgas/layout/fgas_textbreak.cpp index f8cfcd0066..86fecbeef4 100644 --- a/xfa/fgas/layout/fgas_textbreak.cpp +++ b/xfa/fgas/layout/fgas_textbreak.cpp @@ -70,7 +70,7 @@ CFX_TxtBreak::~CFX_TxtBreak() { } void CFX_TxtBreak::SetLineWidth(FX_FLOAT fLineWidth) { m_iLineWidth = FXSYS_round(fLineWidth * 20000.0f); - FXSYS_assert(m_iLineWidth >= 20000); + ASSERT(m_iLineWidth >= 20000); } void CFX_TxtBreak::SetLinePos(FX_FLOAT fLinePos) { int32_t iLinePos = FXSYS_round(fLinePos * 20000.0f); @@ -167,8 +167,8 @@ void CFX_TxtBreak::SetCharRotation(int32_t iCharRotation) { m_iRotation %= 4; } void CFX_TxtBreak::SetAlignment(int32_t iAlignment) { - FXSYS_assert(iAlignment >= FX_TXTLINEALIGNMENT_Left && - iAlignment <= FX_TXTLINEALIGNMENT_Distributed); + ASSERT(iAlignment >= FX_TXTLINEALIGNMENT_Left && + iAlignment <= FX_TXTLINEALIGNMENT_Distributed); m_iAlignment = iAlignment; ResetArabicContext(); } @@ -342,7 +342,7 @@ void CFX_TxtBreak::AppendChar_PageLoad(CFX_Char* pCurChar, uint32_t dwProps) { } uint32_t CFX_TxtBreak::AppendChar_Combination(CFX_Char* pCurChar, int32_t iRotation) { - FXSYS_assert(pCurChar != NULL); + ASSERT(pCurChar != NULL); FX_WCHAR wch = pCurChar->m_wCharCode; FX_WCHAR wForm; int32_t iCharWidth = 0; @@ -608,7 +608,7 @@ uint32_t CFX_TxtBreak::AppendChar(FX_WCHAR wch) { return std::max(dwRet1, dwRet2); } void CFX_TxtBreak::EndBreak_UpdateArabicShapes() { - FXSYS_assert(m_bArabicShapes); + ASSERT(m_bArabicShapes); int32_t iCount = m_pCurLine->CountChars(); if (iCount < 2) { return; @@ -907,8 +907,8 @@ void CFX_TxtBreak::EndBreak_Alignment(CFX_TPOArray& tpos, } } uint32_t CFX_TxtBreak::EndBreak(uint32_t dwStatus) { - FXSYS_assert(dwStatus >= FX_TXTBREAK_PieceBreak && - dwStatus <= FX_TXTBREAK_PageBreak); + ASSERT(dwStatus >= FX_TXTBREAK_PieceBreak && + dwStatus <= FX_TXTBREAK_PageBreak); CFX_TxtPieceArray* pCurPieces = m_pCurLine->m_pLinePieces; int32_t iCount = pCurPieces->GetSize(); if (iCount > 0) { @@ -1074,7 +1074,7 @@ int32_t CFX_TxtBreak::GetBreakPos(CFX_TxtCharArray& ca, void CFX_TxtBreak::SplitTextLine(CFX_TxtLine* pCurLine, CFX_TxtLine* pNextLine, FX_BOOL bAllChars) { - FXSYS_assert(pCurLine != NULL && pNextLine != NULL); + ASSERT(pCurLine != NULL && pNextLine != NULL); int32_t iCount = pCurLine->CountChars(); if (iCount < 2) { return; diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index af6d52163f..41bd8f4921 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -133,11 +133,11 @@ class CFX_TxtPiece : public CFX_Target { int32_t GetLength() const { return m_iChars; } int32_t GetEndChar() const { return m_iStartChar + m_iChars; } CFX_TxtChar* GetCharPtr(int32_t index) const { - FXSYS_assert(index > -1 && index < m_iChars && m_pChars != NULL); + ASSERT(index > -1 && index < m_iChars && m_pChars != NULL); return m_pChars->GetDataPtr(m_iStartChar + index); } void GetString(FX_WCHAR* pText) const { - FXSYS_assert(pText != NULL); + ASSERT(pText != NULL); int32_t iEndChar = m_iStartChar + m_iChars; CFX_Char* pChar; for (int32_t i = m_iStartChar; i < iEndChar; i++) { @@ -152,7 +152,7 @@ class CFX_TxtPiece : public CFX_Target { wsText.ReleaseBuffer(m_iChars); } void GetWidths(int32_t* pWidths) const { - FXSYS_assert(pWidths != NULL); + ASSERT(pWidths != NULL); int32_t iEndChar = m_iStartChar + m_iChars; CFX_Char* pChar; for (int32_t i = m_iStartChar; i < iEndChar; i++) { @@ -189,12 +189,12 @@ class CFX_TxtLine { } int32_t CountChars() const { return m_pLineChars->GetSize(); } CFX_TxtChar* GetCharPtr(int32_t index) const { - FXSYS_assert(index > -1 && index < m_pLineChars->GetSize()); + ASSERT(index > -1 && index < m_pLineChars->GetSize()); return m_pLineChars->GetDataPtr(index); } int32_t CountPieces() const { return m_pLinePieces->GetSize(); } CFX_TxtPiece* GetPiecePtr(int32_t index) const { - FXSYS_assert(index > -1 && index < m_pLinePieces->GetSize()); + ASSERT(index > -1 && index < m_pLinePieces->GetSize()); return m_pLinePieces->GetPtrAt(index); } void GetString(CFX_WideString& wsStr) const { diff --git a/xfa/fgas/layout/fgas_unicode.cpp b/xfa/fgas/layout/fgas_unicode.cpp index a4cbee03b7..94f06253ac 100644 --- a/xfa/fgas/layout/fgas_unicode.cpp +++ b/xfa/fgas/layout/fgas_unicode.cpp @@ -7,8 +7,8 @@ #include "xfa/fgas/layout/fgas_unicode.h" void FX_TEXTLAYOUT_PieceSort(CFX_TPOArray& tpos, int32_t iStart, int32_t iEnd) { - FXSYS_assert(iStart > -1 && iStart < tpos.GetSize()); - FXSYS_assert(iEnd > -1 && iEnd < tpos.GetSize()); + ASSERT(iStart > -1 && iStart < tpos.GetSize()); + ASSERT(iEnd > -1 && iEnd < tpos.GetSize()); if (iStart >= iEnd) { return; } diff --git a/xfa/fgas/localization/fgas_datetime.cpp b/xfa/fgas/localization/fgas_datetime.cpp index 456e476dee..f3c560b823 100644 --- a/xfa/fgas/localization/fgas_datetime.cpp +++ b/xfa/fgas/localization/fgas_datetime.cpp @@ -31,23 +31,23 @@ const int64_t g_FXMillisecondsPerMinute = 60000; const int64_t g_FXMillisecondsPerHour = 3600000; const int64_t g_FXMillisecondsPerDay = 86400000; FX_BOOL FX_IsLeapYear(int32_t iYear) { - FXSYS_assert(iYear != 0); + ASSERT(iYear != 0); return ((iYear % 4) == 0 && (iYear % 100) != 0) || (iYear % 400) == 0; } int32_t FX_DaysInYear(int32_t iYear) { - FXSYS_assert(iYear != 0); + ASSERT(iYear != 0); return FX_IsLeapYear(iYear) ? g_FXDaysPerLeapYear : g_FXDaysPerYear; } uint8_t FX_DaysInMonth(int32_t iYear, uint8_t iMonth) { - FXSYS_assert(iYear != 0); - FXSYS_assert(iMonth >= 1 && iMonth <= 12); + ASSERT(iYear != 0); + ASSERT(iMonth >= 1 && iMonth <= 12); const uint8_t* p = FX_IsLeapYear(iYear) ? g_FXDaysPerLeapMonth : g_FXDaysPerMonth; return p[iMonth - 1]; } static int32_t FX_DaysBeforeMonthInYear(int32_t iYear, uint8_t iMonth) { - FXSYS_assert(iYear != 0); - FXSYS_assert(iMonth >= 1 && iMonth <= 12); + ASSERT(iYear != 0); + ASSERT(iMonth >= 1 && iMonth <= 12); const int32_t* p = FX_IsLeapYear(iYear) ? g_FXDaysBeforeLeapMonth : g_FXDaysBeforeMonth; return p[iMonth - 1]; @@ -56,9 +56,9 @@ static int64_t FX_DateToDays(int32_t iYear, uint8_t iMonth, uint8_t iDay, FX_BOOL bIncludeThisDay = FALSE) { - FXSYS_assert(iYear != 0); - FXSYS_assert(iMonth >= 1 && iMonth <= 12); - FXSYS_assert(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth)); + ASSERT(iYear != 0); + ASSERT(iMonth >= 1 && iMonth <= 12); + ASSERT(iDay >= 1 && iDay <= FX_DaysInMonth(iYear, iMonth)); int64_t iDays = FX_DaysBeforeMonthInYear(iYear, iMonth); iDays += iDay; if (!bIncludeThisDay) { @@ -197,10 +197,10 @@ void CFX_Unitime::Set(int32_t year, uint8_t minute, uint8_t second, uint16_t millisecond) { - FXSYS_assert(hour <= 23); - FXSYS_assert(minute <= 59); - FXSYS_assert(second <= 59); - FXSYS_assert(millisecond <= 999); + ASSERT(hour <= 23); + ASSERT(minute <= 59); + ASSERT(second <= 59); + ASSERT(millisecond <= 999); m_iUnitime = (int64_t)hour * g_FXMillisecondsPerHour + (int64_t)minute * g_FXMillisecondsPerMinute + (int64_t)second * g_FXMillisecondsPerSecond + millisecond; diff --git a/xfa/fgas/localization/fgas_locale.cpp b/xfa/fgas/localization/fgas_locale.cpp index 9a8e05cbc7..521b53536e 100644 --- a/xfa/fgas/localization/fgas_locale.cpp +++ b/xfa/fgas/localization/fgas_locale.cpp @@ -768,7 +768,7 @@ IFX_Locale* CFX_FormatString::GetNumericFormat(const CFX_WideString& wsPattern, if (!pLocale) { pLocale = m_pLocaleMgr->GetDefLocale(); } - FXSYS_assert(pLocale != NULL); + ASSERT(pLocale != NULL); pLocale->GetNumPattern(eSubCategory, wsSubCategory); iDotIndex = wsSubCategory.Find('.'); if (iDotIndex > 0) { @@ -2223,7 +2223,7 @@ FX_DATETIMETYPE CFX_FormatString::GetDateTimeFormat( if (!pLocale) { pLocale = m_pLocaleMgr->GetDefLocale(); } - FXSYS_assert(pLocale != NULL); + ASSERT(pLocale != NULL); switch (eCategory) { case FX_LOCALECATEGORY_Date: pLocale->GetDatePattern(eSubCategory, wsDatePattern); @@ -4487,7 +4487,7 @@ static inline void fxmath_decimal_helper_raw_mul(uint64_t a[], uint8_t bl, uint64_t c[], uint8_t cl) { - assert(al + bl <= cl); + ASSERT(al + bl <= cl); { for (int i = 0; i < cl; i++) { c[i] = 0; diff --git a/xfa/fgas/xml/fgas_sax_imp.cpp b/xfa/fgas/xml/fgas_sax_imp.cpp index ea3dafff59..d47bc44000 100644 --- a/xfa/fgas/xml/fgas_sax_imp.cpp +++ b/xfa/fgas/xml/fgas_sax_imp.cpp @@ -28,7 +28,7 @@ CFX_SAXFile::CFX_SAXFile() FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, uint32_t dwStart, uint32_t dwLen) { - FXSYS_assert(m_pFile == NULL && pFile != NULL); + ASSERT(m_pFile == NULL && pFile != NULL); uint32_t dwSize = pFile->GetSize(); if (dwStart >= dwSize) { return FALSE; @@ -52,7 +52,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, return TRUE; } FX_BOOL CFX_SAXFile::ReadNextBlock() { - FXSYS_assert(m_pFile != NULL); + ASSERT(m_pFile != NULL); uint32_t dwSize = m_dwEnd - m_dwCur; if (dwSize == 0) { return FALSE; @@ -558,7 +558,7 @@ void CFX_SAXReader::SkipNode() { return; } iLen--; - FXSYS_assert(iLen > -1); + ASSERT(iLen > -1); m_SkipStack.RemoveAt(iLen, 1); m_SkipChar = iLen ? m_SkipStack[iLen - 1] : 0; return; @@ -619,7 +619,7 @@ void CFX_SAXReader::SkipNode() { } } void CFX_SAXReader::NotifyData() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag) m_pHandler->OnTagData(m_pCurItem->m_pNode, m_bCharData ? FX_SAXNODE_CharData : FX_SAXNODE_Text, @@ -627,7 +627,7 @@ void CFX_SAXReader::NotifyData() { m_File.m_dwCur + m_dwDataOffset); } void CFX_SAXReader::NotifyEnter() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag || m_pCurItem->m_eNode == FX_SAXNODE_Instruction) { m_pCurItem->m_pNode = @@ -636,7 +636,7 @@ void CFX_SAXReader::NotifyEnter() { } } void CFX_SAXReader::NotifyAttribute() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag || m_pCurItem->m_eNode == FX_SAXNODE_Instruction) { m_pHandler->OnTagAttribute(m_pCurItem->m_pNode, @@ -645,20 +645,20 @@ void CFX_SAXReader::NotifyAttribute() { } } void CFX_SAXReader::NotifyBreak() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag) { m_pHandler->OnTagBreak(m_pCurItem->m_pNode); } } void CFX_SAXReader::NotifyClose() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag || m_pCurItem->m_eNode == FX_SAXNODE_Instruction) { m_pHandler->OnTagClose(m_pCurItem->m_pNode, m_dwNodePos); } } void CFX_SAXReader::NotifyEnd() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Tag) { m_pHandler->OnTagEnd(m_pCurItem->m_pNode, CFX_ByteStringC(m_pszData, m_iDataLength), @@ -666,7 +666,7 @@ void CFX_SAXReader::NotifyEnd() { } } void CFX_SAXReader::NotifyTargetData() { - FXSYS_assert(m_pHandler != NULL); + ASSERT(m_pHandler != NULL); if (m_pCurItem->m_eNode == FX_SAXNODE_Instruction) { m_pHandler->OnTargetData(m_pCurItem->m_pNode, m_pCurItem->m_eNode, CFX_ByteStringC(m_pszName, m_iNameLength), diff --git a/xfa/fwl/basewidget/fwl_comboboximp.cpp b/xfa/fwl/basewidget/fwl_comboboximp.cpp index d7fe209e16..d04c641fa3 100644 --- a/xfa/fwl/basewidget/fwl_comboboximp.cpp +++ b/xfa/fwl/basewidget/fwl_comboboximp.cpp @@ -201,7 +201,7 @@ void CFWL_ComboEditImp::SetComboBoxFocus(FX_BOOL bSet) { CFWL_ComboListImp::CFWL_ComboListImp(const CFWL_WidgetImpProperties& properties, IFWL_Widget* pOuter) : CFWL_ListBoxImp(properties, pOuter), m_bNotifyOwner(TRUE) { - FXSYS_assert(pOuter != NULL); + ASSERT(pOuter != NULL); } FWL_ERR CFWL_ComboListImp::Initialize() { if (CFWL_ListBoxImp::Initialize() != FWL_ERR_Succeeded) diff --git a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp index 0c6539b51d..32cec6d2e7 100644 --- a/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp +++ b/xfa/fwl/basewidget/fwl_monthcalendarimp.cpp @@ -950,7 +950,7 @@ FX_BOOL CFWL_MonthCalendarImp::RemoveSelDay(int32_t iDay, FX_BOOL bAll) { return TRUE; } FX_BOOL CFWL_MonthCalendarImp::AddSelDay(int32_t iDay) { - FXSYS_assert(iDay > 0); + ASSERT(iDay > 0); if (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_MCD_MultiSelect) { } else { if (m_arrSelDays.Find(iDay) == -1) { @@ -980,7 +980,7 @@ FX_BOOL CFWL_MonthCalendarImp::JumpToToday() { void CFWL_MonthCalendarImp::GetHeadText(int32_t iYear, int32_t iMonth, CFX_WideString& wsHead) { - FXSYS_assert(iMonth > 0 && iMonth < 13); + ASSERT(iMonth > 0 && iMonth < 13); static const FX_WCHAR* const pMonth[] = { L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", diff --git a/xfa/fwl/core/fwl_widgetimp.cpp b/xfa/fwl/core/fwl_widgetimp.cpp index f6be8cac5e..df3228c6ed 100644 --- a/xfa/fwl/core/fwl_widgetimp.cpp +++ b/xfa/fwl/core/fwl_widgetimp.cpp @@ -521,7 +521,7 @@ CFWL_WidgetImp::CFWL_WidgetImp(const CFWL_WidgetImpProperties& properties, m_iLock(0) { *m_pProperties = properties; m_pWidgetMgr = static_cast(FWL_GetWidgetMgr()); - FXSYS_assert(m_pWidgetMgr != NULL); + ASSERT(m_pWidgetMgr != NULL); } CFWL_WidgetImp::~CFWL_WidgetImp() { if (m_pPrivateData) { diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp index e6ca4091e5..0bd1acffc7 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.cpp +++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp @@ -34,7 +34,7 @@ CFWL_WidgetMgr::CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative) : m_dwCapability(0) { m_pDelegate = new CFWL_WidgetMgrDelegate(this); m_pAdapter = pAdapterNative->GetWidgetMgr(m_pDelegate); - FXSYS_assert(m_pAdapter); + ASSERT(m_pAdapter); CFWL_WidgetMgrItem* pRoot = new CFWL_WidgetMgrItem; m_mapWidgetItem.SetAt(NULL, pRoot); #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) diff --git a/xfa/fwl/lightwidget/cfwl_widget.cpp b/xfa/fwl/lightwidget/cfwl_widget.cpp index 31c54d8efa..5fbe935767 100644 --- a/xfa/fwl/lightwidget/cfwl_widget.cpp +++ b/xfa/fwl/lightwidget/cfwl_widget.cpp @@ -215,7 +215,7 @@ CFWL_Widget::CFWL_Widget() : m_pIface(NULL), m_pDelegate(NULL), m_pProperties(NULL) { m_pProperties = new CFWL_WidgetProperties; m_pWidgetMgr = static_cast(FWL_GetWidgetMgr()); - FXSYS_assert(m_pWidgetMgr != NULL); + ASSERT(m_pWidgetMgr != NULL); } CFWL_Widget::~CFWL_Widget() { diff --git a/xfa/fxfa/app/xfa_checksum.cpp b/xfa/fxfa/app/xfa_checksum.cpp index 56b0c88d63..59bf37b6a5 100644 --- a/xfa/fxfa/app/xfa_checksum.cpp +++ b/xfa/fxfa/app/xfa_checksum.cpp @@ -11,7 +11,7 @@ CXFA_SAXReaderHandler::CXFA_SAXReaderHandler(CXFA_ChecksumContext* pContext) : m_pContext(pContext) { - FXSYS_assert(m_pContext); + ASSERT(m_pContext); } CXFA_SAXReaderHandler::~CXFA_SAXReaderHandler() {} void* CXFA_SAXReaderHandler::OnTagEnter(const CFX_ByteStringC& bsTagName, diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp index 0acd9a59ce..12e562cdfb 100644 --- a/xfa/fxfa/app/xfa_ffdoc.cpp +++ b/xfa/fxfa/app/xfa_ffdoc.cpp @@ -141,7 +141,7 @@ int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) { } CPDF_Document* pPDFDocument = GetDocProvider()->OpenPDF(this, pXFAReader, TRUE); - FXSYS_assert(!m_pPDFDoc); + ASSERT(!m_pPDFDoc); if (!OpenDoc(pPDFDocument)) { return XFA_PARSESTATUS_SyntaxErr; } diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index 7a858748b7..405e4103a6 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -617,7 +617,7 @@ void CXFA_FFDocView::AddNewFormNode(CXFA_Node* pNode) { InitLayout(pNode); } void CXFA_FFDocView::AddIndexChangedSubform(CXFA_Node* pNode) { - FXSYS_assert(pNode->GetClassID() == XFA_ELEMENT_Subform); + ASSERT(pNode->GetClassID() == XFA_ELEMENT_Subform); m_IndexChangedSubforms.Add(pNode); } void CXFA_FFDocView::RunDocClose() { diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp index 872dc8f3ce..b48893a1fc 100644 --- a/xfa/fxfa/app/xfa_fffield.cpp +++ b/xfa/fxfa/app/xfa_fffield.cpp @@ -335,7 +335,7 @@ void CXFA_FFField::SetFWLRect() { } CFX_RectF rtUi = m_rtUI; if (rtUi.width < 1.0) { - FXSYS_assert(rtUi.width < 1.0); + ASSERT(rtUi.width < 1.0); rtUi.width = 1.0; } if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) { diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp index a5217abe7a..11628aa790 100644 --- a/xfa/fxfa/app/xfa_ffpageview.cpp +++ b/xfa/fxfa/app/xfa_ffpageview.cpp @@ -25,7 +25,7 @@ void GetPageMatrix(CFX_Matrix& pageMatrix, const CFX_Rect& devicePageRect, int32_t iRotate, uint32_t dwCoordinatesType) { - FXSYS_assert(iRotate >= 0 && iRotate <= 3); + ASSERT(iRotate >= 0 && iRotate <= 3); FX_BOOL bFlipX = (dwCoordinatesType & 0x01) != 0; FX_BOOL bFlipY = (dwCoordinatesType & 0x02) != 0; CFX_Matrix m; diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp index d070223751..6136fd3ce8 100644 --- a/xfa/fxfa/app/xfa_ffpushbutton.cpp +++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp @@ -52,7 +52,7 @@ void CXFA_FFPushButton::RenderWidget(CFX_Graphics* pGS, pGS, &mt); } FX_BOOL CXFA_FFPushButton::LoadWidget() { - FXSYS_assert(m_pNormalWidget == NULL); + ASSERT(m_pNormalWidget == NULL); CFWL_PushButton* pPushButton = CFWL_PushButton::Create(); if (pPushButton) { pPushButton->Initialize(); diff --git a/xfa/fxfa/app/xfa_ffsignature.cpp b/xfa/fxfa/app/xfa_ffsignature.cpp index 1cb77a4df1..ce1cee2033 100644 --- a/xfa/fxfa/app/xfa_ffsignature.cpp +++ b/xfa/fxfa/app/xfa_ffsignature.cpp @@ -37,7 +37,7 @@ void CXFA_FFSignature::RenderWidget(CFX_Graphics* pGS, DrawHighlight(pGS, &mtRotate, dwStatus, FALSE); CFX_RectF rtWidget = m_rtUI; IXFA_DocProvider* pDocProvider = m_pDataAcc->GetDoc()->GetDocProvider(); - FXSYS_assert(pDocProvider); + ASSERT(pDocProvider); pDocProvider->RenderCustomWidget(this, pGS, &mtRotate, rtWidget); } FX_BOOL CXFA_FFSignature::OnMouseEnter() { diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp index 037e6560de..34b29c79d2 100644 --- a/xfa/fxfa/app/xfa_ffwidget.cpp +++ b/xfa/fxfa/app/xfa_ffwidget.cpp @@ -1153,7 +1153,7 @@ static void XFA_BOX_GetPath(CXFA_Box box, int32_t nIndex, FX_BOOL bStart, FX_BOOL bCorner) { - FXSYS_assert(nIndex >= 0 && nIndex < 8); + ASSERT(nIndex >= 0 && nIndex < 8); FX_BOOL bInverted, bRound; FX_FLOAT fRadius1, fRadius2, sx, sy, vx, vy, nx, ny, offsetY, offsetX, offsetEX, offsetEY; diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp index 561db255d8..ad8cabad3a 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp +++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp @@ -293,7 +293,7 @@ void CXFA_WidgetAcc::SetImageEdit(const CFX_WideStringC& wsContentType, pHrefNode->SetCData(XFA_ATTRIBUTE_Value, wsHref); } else { CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); - FXSYS_assert(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode && pXMLNode->GetType() == FDE_XMLNODE_Element); static_cast(pXMLNode) ->SetString(FX_WSTRC(L"href"), wsHref); } @@ -647,7 +647,7 @@ int32_t CXFA_WidgetAcc::ExecuteScript(CXFA_Script script, static const uint32_t MAX_RECURSION_DEPTH = 2; if (m_nRecursionDepth > MAX_RECURSION_DEPTH) return XFA_EVENTERROR_Success; - FXSYS_assert(pEventParam); + ASSERT(pEventParam); if (!script) { return XFA_EVENTERROR_NotExist; } @@ -1596,7 +1596,7 @@ CXFA_Node* CXFA_TextProvider::GetTextNode(FX_BOOL& bRichText) { } else if (m_eType == XFA_TEXTPROVIDERTYPE_Datasets) { CXFA_Node* pBind = m_pWidgetAcc->GetDatasets(); CFDE_XMLNode* pXMLNode = pBind->GetXMLMappingNode(); - FXSYS_assert(pXMLNode); + ASSERT(pXMLNode); for (CFDE_XMLNode* pXMLChild = pXMLNode->GetNodeItem(CFDE_XMLNode::FirstChild); pXMLChild; diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.h b/xfa/fxfa/app/xfa_ffwidgetacc.h index 6d4303d72a..97514b78db 100644 --- a/xfa/fxfa/app/xfa_ffwidgetacc.h +++ b/xfa/fxfa/app/xfa_ffwidgetacc.h @@ -22,7 +22,7 @@ class CXFA_TextProvider { XFA_TEXTPROVIDERTYPE eType, CXFA_Node* pTextNode = NULL) : m_pWidgetAcc(pWidgetAcc), m_eType(eType), m_pTextNode(pTextNode) { - FXSYS_assert(m_pWidgetAcc); + ASSERT(m_pWidgetAcc); } ~CXFA_TextProvider() {} diff --git a/xfa/fxfa/app/xfa_fontmgr.cpp b/xfa/fxfa/app/xfa_fontmgr.cpp index 02b44be789..7c6d5cddec 100644 --- a/xfa/fxfa/app/xfa_fontmgr.cpp +++ b/xfa/fxfa/app/xfa_fontmgr.cpp @@ -1799,7 +1799,7 @@ IFX_Font* CXFA_DefFontMgr::GetDefaultFont(CXFA_FFDoc* hDoc, if (!pFont) pFont = pFDEFontMgr->LoadFont((const FX_WCHAR*)NULL, dwFontStyles, wCodePage); - FXSYS_assert(pFont); + ASSERT(pFont); if (pFont) { m_CacheFonts.Add(pFont); } diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index 462c7cb090..86da75e066 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -93,7 +93,7 @@ FWL_ERR CXFA_FWLTheme::Initialize() { #endif } - FXSYS_assert(NULL != m_pCalendarFont); + ASSERT(NULL != m_pCalendarFont); FWLTHEME_Init(); return FWL_ERR_Succeeded; } diff --git a/xfa/fxfa/app/xfa_textlayout.cpp b/xfa/fxfa/app/xfa_textlayout.cpp index b259a7f357..e210418337 100644 --- a/xfa/fxfa/app/xfa_textlayout.cpp +++ b/xfa/fxfa/app/xfa_textlayout.cpp @@ -70,7 +70,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) { if (m_pSelector == NULL) { CXFA_FFDoc* pDoc = pTextProvider->GetDocNode(); IFX_FontMgr* pFontMgr = pDoc->GetApp()->GetFDEFontMgr(); - FXSYS_assert(pFontMgr); + ASSERT(pFontMgr); m_pSelector = IFDE_CSSStyleSelector::Create(); m_pSelector->SetFontMgr(pFontMgr); FX_FLOAT fFontSize = 10; @@ -165,7 +165,7 @@ IFDE_CSSComputedStyle* CXFA_TextParser::CreateStyle( IFDE_CSSComputedStyle* pParentStyle) { IFDE_CSSComputedStyle* pNewStyle = m_pSelector->CreateComputedStyle(pParentStyle); - FXSYS_assert(pNewStyle); + ASSERT(pNewStyle); if (pParentStyle) { IFDE_CSSParagraphStyle* pParaStyle = pParentStyle->GetParagraphStyles(); uint32_t dwDecoration = pParaStyle->GetTextDecoration(); @@ -645,7 +645,7 @@ CXFA_TextLayout::CXFA_TextLayout(CXFA_TextProvider* pTextProvider) m_fMaxWidth(0), m_pTabstopContext(nullptr), m_bBlockContinue(TRUE) { - FXSYS_assert(m_pTextProvider); + ASSERT(m_pTextProvider); } CXFA_TextLayout::~CXFA_TextLayout() { m_textParser.Reset(); @@ -1194,7 +1194,7 @@ FX_BOOL CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice, pDevice->SetClipRect(rtClip); CFDE_Brush* pSolidBrush = new CFDE_Brush; CFDE_Pen* pPen = new CFDE_Pen; - FXSYS_assert(pDevice); + ASSERT(pDevice); if (m_pieceLines.GetSize() == 0) { int32_t iBlockCount = CountBlocks(); @@ -1390,7 +1390,7 @@ FX_BOOL CXFA_TextLayout::LoadRichText(CFDE_XMLNode* pXMLNode, } if (wsName == FX_WSTRC(L"a")) { CFX_WideString wsLinkContent; - FXSYS_assert(pElement); + ASSERT(pElement); pElement->GetString(FX_WSTRC(L"href").c_str(), wsLinkContent); if (!wsLinkContent.IsEmpty()) { pLinkData = FXTARGET_NewWith(m_pAllocator) CXFA_LinkUserData( diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h index ccebff8ad9..e823448105 100644 --- a/xfa/fxfa/app/xfa_textlayout.h +++ b/xfa/fxfa/app/xfa_textlayout.h @@ -197,7 +197,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_pLinkData(nullptr), m_pAllocator(pAllocator), m_dwRefCount(0) { - FXSYS_assert(m_pAllocator); + ASSERT(m_pAllocator); if (m_pStyle) m_pStyle->AddRef(); } @@ -208,7 +208,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { m_pLinkData(pLinkData), m_pAllocator(pAllocator), m_dwRefCount(0) { - FXSYS_assert(m_pAllocator); + ASSERT(m_pAllocator); if (m_pStyle) m_pStyle->AddRef(); } diff --git a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp index 9ab426d541..852ea1bd6a 100644 --- a/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp +++ b/xfa/fxfa/fm2js/xfa_fm2jscontext.cpp @@ -1090,7 +1090,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, FXJSE_Value_SetNull(args.GetReturnValue()); } else { CXFA_Document* pDoc = pContext->GetDocument(); - FXSYS_assert(pDoc); + ASSERT(pDoc); IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); CFX_ByteString szArgString; HValueToUTF8String(argOne, szArgString); @@ -1110,7 +1110,7 @@ void CXFA_FM2JSContext::IsoTime2Num(FXJSE_HOBJECT hThis, int32_t second = uniTime.GetSecond(); int32_t milSecond = uniTime.GetMillisecond(); IFX_Locale* pDefLocale = pMgr->GetDefLocale(); - FXSYS_assert(pDefLocale); + ASSERT(pDefLocale); FX_TIMEZONE tzLocale; pDefLocale->GetTimeZone(tzLocale); int32_t mins = hour * 60 + min; @@ -1578,7 +1578,7 @@ void CXFA_FM2JSContext::Time2Num(FXJSE_HOBJECT hThis, if (localString.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2025,7 +2025,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoDate(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocale.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2062,7 +2062,7 @@ FX_BOOL CXFA_FM2JSContext::Local2IsoTime(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocale.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2102,7 +2102,7 @@ FX_BOOL CXFA_FM2JSContext::IsoDate2Local(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocale.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2141,7 +2141,7 @@ FX_BOOL CXFA_FM2JSContext::IsoTime2Local(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocale.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2182,7 +2182,7 @@ FX_BOOL CXFA_FM2JSContext::GetGMTTime(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocale.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2364,7 +2364,7 @@ void CXFA_FM2JSContext::GetLocalDateFormat(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocalStr.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -2419,7 +2419,7 @@ void CXFA_FM2JSContext::GetLocalTimeFormat(FXJSE_HOBJECT hThis, IFX_Locale* pLocale = NULL; if (szLocalStr.IsEmpty()) { CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); pLocale = widgetData.GetLocal(); } else { @@ -3287,7 +3287,7 @@ void CXFA_FM2JSContext::Ref(FXJSE_HOBJECT hThis, #ifndef NDEBUG FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); - FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3); + ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); FXJSE_Value_Release(lengthValue); #endif FXJSE_HVALUE propertyValue = FXJSE_Value_Create(hruntime); @@ -4376,7 +4376,7 @@ void CXFA_FM2JSContext::Format(FXJSE_HOBJECT hThis, CXFA_Document* pDoc = pContext->GetDocument(); IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); IFX_Locale* pLocale = widgetData.GetLocal(); uint32_t patternType; @@ -4590,7 +4590,7 @@ void CXFA_FM2JSContext::Parse(FXJSE_HOBJECT hThis, CXFA_Document* pDoc = pContext->GetDocument(); IFX_LocaleMgr* pMgr = (IFX_LocaleMgr*)pDoc->GetLocalMgr(); CXFA_Node* pThisNode = ToNode(pDoc->GetScriptContext()->GetThisObject()); - FXSYS_assert(pThisNode); + ASSERT(pThisNode); CXFA_WidgetData widgetData(pThisNode); IFX_Locale* pLocale = widgetData.GetLocal(); uint32_t patternType; @@ -6464,7 +6464,7 @@ void CXFA_FM2JSContext::get_fm_jsobj(FXJSE_HOBJECT hThis, FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); - FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3); + ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); FXJSE_Value_Release(lengthValue); #endif FXJSE_Value_GetObjectPropByIdx(argOne, 2, args.GetReturnValue()); @@ -6489,7 +6489,7 @@ void CXFA_FM2JSContext::fm_var_filter(FXJSE_HOBJECT hThis, #ifndef NDEBUG FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); FXJSE_Value_GetObjectProp(argOne, "length", lengthValue); - FXSYS_assert(FXJSE_Value_ToInteger(lengthValue) >= 3); + ASSERT(FXJSE_Value_ToInteger(lengthValue) >= 3); FXJSE_Value_Release(lengthValue); #endif FXJSE_HVALUE flagsValue = FXJSE_Value_Create(hruntime); @@ -6587,7 +6587,7 @@ FXJSE_HVALUE CXFA_FM2JSContext::GetSimpleHValue(FXJSE_HOBJECT hThis, CXFA_FM2JSContext* pContext = (CXFA_FM2JSContext*)FXJSE_Value_ToObject(hThis, NULL); FXJSE_HRUNTIME hruntime = pContext->GetScriptRuntime(); - FXSYS_assert(index < (uint32_t)args.GetLength()); + ASSERT(index < (uint32_t)args.GetLength()); FXJSE_HVALUE argIndex = args.GetValue(index); if (FXJSE_Value_IsArray(argIndex)) { FXJSE_HVALUE lengthValue = FXJSE_Value_Create(hruntime); @@ -6875,7 +6875,7 @@ int32_t CXFA_FM2JSContext::ResolveObjects(FXJSE_HOBJECT hThis, dFlags = XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; } else { pNode = (CXFA_Object*)FXJSE_Value_ToObject(hRefValue, NULL); - FXSYS_assert(pNode); + ASSERT(pNode); if (bHasNoResolveName) { CFX_WideString wsName; if (CXFA_Node* pXFANode = pNode->AsNode()) { @@ -7215,7 +7215,7 @@ void CXFA_FM2JSContext::Release() { } void CXFA_FM2JSContext::ThrowScriptErrorMessage(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); - FXSYS_assert(pAppProvider); + ASSERT(pAppProvider); CFX_WideString wsFormat; pAppProvider->LoadString(iStringID, wsFormat); CFX_WideString wsMessage; diff --git a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp index f652961b6e..468bb3bf89 100644 --- a/xfa/fxfa/fm2js/xfa_simpleexpression.cpp +++ b/xfa/fxfa/fm2js/xfa_simpleexpression.cpp @@ -332,7 +332,7 @@ void CXFA_FMEqualityExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << gs_lpStrExpFuncName[NOTEQUALITY]; break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } javascript << FX_WSTRC(L"("); @@ -368,7 +368,7 @@ void CXFA_FMRelationalExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << gs_lpStrExpFuncName[GREATEREQUAL]; break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } javascript << FX_WSTRC(L"("); @@ -394,7 +394,7 @@ void CXFA_FMAdditiveExpression::ToJavaScript(CFX_WideTextBuf& javascript) { javascript << gs_lpStrExpFuncName[MINUS]; break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } javascript << FX_WSTRC(L"("); @@ -421,7 +421,7 @@ void CXFA_FMMultiplicativeExpression::ToJavaScript( javascript << gs_lpStrExpFuncName[DIVIDE]; break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } javascript << FX_WSTRC(L"("); diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 0c3d065a39..7ca020fe6f 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -1565,7 +1565,7 @@ FX_BOOL CXFA_WidgetData::GetNormalizeDataValue( if (wsPicture.IsEmpty()) return TRUE; - FXSYS_assert(GetNode()); + ASSERT(GetNode()); CXFA_LocaleMgr* pLocalMgr = GetNode()->GetDocument()->GetLocalMgr(); IFX_Locale* pLocale = GetLocal(); CXFA_LocaleValue widgetValue = XFA_GetLocaleValue(this); @@ -1590,7 +1590,7 @@ FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, return TRUE; if (IFX_Locale* pLocale = GetLocal()) { - FXSYS_assert(GetNode()); + ASSERT(GetNode()); CXFA_Node* pNodeValue = GetNode()->GetChild(0, XFA_ELEMENT_Value); if (!pNodeValue) return FALSE; diff --git a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp index ed392ff1b6..c988902b63 100644 --- a/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datadescription_imp.cpp @@ -29,7 +29,7 @@ class CXFA_TraverseStrategy_DDGroup { }; void XFA_DataDescription_UpdateDataRelation(CXFA_Node* pDataNode, CXFA_Node* pDataDescriptionNode) { - FXSYS_assert(pDataDescriptionNode); + ASSERT(pDataDescriptionNode); for (CXFA_Node* pDataChild = pDataNode->GetNodeItem(XFA_NODEITEM_FirstChild); pDataChild; pDataChild = pDataChild->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -77,7 +77,7 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( if (!pParentDDNode) { CXFA_Node* pDataNode = pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); - FXSYS_assert(pDataNode); + ASSERT(pDataNode); pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); pDataNode->CreateXMLMappingNode(); pDataParent->InsertChild(pDataNode); @@ -107,7 +107,7 @@ CXFA_Node* XFA_DataDescription_MaybeCreateDataNode( } CXFA_Node* pDataNode = pDocument->CreateNode(XFA_XDPPACKET_Datasets, eNodeType); - FXSYS_assert(pDataNode); + ASSERT(pDataNode); pDataNode->SetCData(XFA_ATTRIBUTE_Name, wsName); pDataNode->CreateXMLMappingNode(); if (eNodeType == XFA_ELEMENT_DataValue && diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp index 59e663eec1..ccb69df1a1 100644 --- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp +++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp @@ -52,7 +52,7 @@ static CXFA_Node* XFA_DataMerge_FormValueNode_CreateChild( static void XFA_DataMerge_FormValueNode_MatchNoneCreateChild( CXFA_Node* pFormNode) { CXFA_WidgetData* pWidgetData = pFormNode->GetWidgetData(); - FXSYS_assert(pWidgetData); + ASSERT(pWidgetData); pWidgetData->GetUIType(); } static FX_BOOL XFA_DataMerge_FormValueNode_SetChildContent( @@ -62,7 +62,7 @@ static FX_BOOL XFA_DataMerge_FormValueNode_SetChildContent( if (!pValueNode) { return FALSE; } - FXSYS_assert(pValueNode->GetPacketID() == XFA_XDPPACKET_Form); + ASSERT(pValueNode->GetPacketID() == XFA_XDPPACKET_Form); CXFA_Node* pChildNode = XFA_DataMerge_FormValueNode_CreateChild(pValueNode, iType); if (!pChildNode) { @@ -96,7 +96,7 @@ static FX_BOOL XFA_DataMerge_FormValueNode_SetChildContent( pChildNode->SetCData(XFA_ATTRIBUTE_Value, wsContent); } break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } return TRUE; @@ -111,7 +111,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, return; } CXFA_WidgetData* pWidgetData = pFormNode->GetWidgetData(); - FXSYS_assert(pWidgetData); + ASSERT(pWidgetData); FX_BOOL bNotify = FALSE; XFA_ELEMENT eUIType = pWidgetData->GetUIType(); CXFA_Value defValue(pFormNode->GetProperty(0, XFA_ELEMENT_Value)); @@ -130,7 +130,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, } CFDE_XMLElement* pXMLDataElement = static_cast(pDataNode->GetXMLMappingNode()); - FXSYS_assert(pXMLDataElement); + ASSERT(pXMLDataElement); pWidgetData->GetFormatDataValue(wsValue, wsFormatedValue); pDataNode->SetAttributeValue(wsValue, wsFormatedValue); pDataNode->SetCData(XFA_ATTRIBUTE_ContentType, wsContentType); @@ -155,7 +155,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, } } else { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); - FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); static_cast(pXMLNode) ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); } @@ -268,7 +268,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, if (image) { CFDE_XMLElement* pXMLDataElement = static_cast(pDataNode->GetXMLMappingNode()); - FXSYS_assert(pXMLDataElement); + ASSERT(pXMLDataElement); CFX_WideString wsContentType; CFX_WideString wsHref; pXMLDataElement->GetString(L"xfa:contentType", wsContentType); @@ -296,7 +296,7 @@ static void XFA_DataMerge_CreateDataBinding(CXFA_Node* pFormNode, wsNormailizeValue += wsItem; } CXFA_ExData exData = defValue.GetExData(); - FXSYS_assert(exData); + ASSERT(exData); exData.SetContentType((iCounts == 1) ? FX_WSTRC(L"text/plain") : FX_WSTRC(L"text/xml")); } @@ -591,7 +591,7 @@ static CXFA_Node* XFA_NodeMerge_CloneOrMergeInstanceManager( } CXFA_Node* pNewNode = pDocument->GetParser()->GetFactory()->CreateNode( XFA_XDPPACKET_Form, XFA_ELEMENT_InstanceManager); - FXSYS_assert(pNewNode); + ASSERT(pNewNode); wsInstMgrNodeName = FX_WSTRC(L"_") + pTemplateNode->GetCData(XFA_ATTRIBUTE_Name); pNewNode->SetCData(XFA_ATTRIBUTE_Name, wsInstMgrNodeName); @@ -831,7 +831,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( pFirstInstance = pSubformNode; } XFA_DataMerge_CreateDataBinding(pSubformNode, pDataNode); - FXSYS_assert(pSubformNode); + ASSERT(pSubformNode); subformMapArray.SetAt(pSubformNode, pDataNode); subformArray.Add(pSubformNode); } @@ -872,7 +872,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( eRelation == XFA_ATTRIBUTEENUM_Unordered) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); - FXSYS_assert(pSubformSetNode); + ASSERT(pSubformSetNode); if (!pFirstInstance) { pFirstInstance = pSubformSetNode; } @@ -908,7 +908,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( } switch (eRelation) { case XFA_ATTRIBUTEENUM_Choice: { - FXSYS_assert(rgItemMatchList.GetSize()); + ASSERT(rgItemMatchList.GetSize()); XFA_DataMerge_SortRecurseRecord(rgItemMatchList, pDataScope, TRUE); pDocument->DataMerge_CopyContainer( rgItemMatchList[0].pTemplateChild, pSubformSetNode, pDataScope); @@ -935,7 +935,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( } else { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); - FXSYS_assert(pSubformSetNode); + ASSERT(pSubformSetNode); if (!pFirstInstance) { pFirstInstance = pSubformSetNode; } @@ -977,7 +977,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( } CXFA_Node* pSubformNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); - FXSYS_assert(pSubformNode); + ASSERT(pSubformNode); if (!pFirstInstance) { pFirstInstance = pSubformNode; } @@ -1001,7 +1001,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_SubformSet( for (; iCurRepeatIndex < iMinimalLimit; iCurRepeatIndex++) { CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormParentNode, pTemplateNode, FALSE, pSearchArray); - FXSYS_assert(pSubformSetNode); + ASSERT(pSubformSetNode); if (!pFirstInstance) { pFirstInstance = pSubformSetNode; } @@ -1034,7 +1034,7 @@ static CXFA_Node* XFA_DataMerge_CopyContainer_Field(CXFA_Document* pDocument, FX_BOOL bUpLevel = TRUE) { CXFA_Node* pFieldNode = XFA_NodeMerge_CloneOrMergeContainer( pDocument, pFormNode, pTemplateNode, FALSE); - FXSYS_assert(pFieldNode); + ASSERT(pFieldNode); for (CXFA_Node* pTemplateChildNode = pTemplateNode->GetNodeItem(XFA_NODEITEM_FirstChild); pTemplateChildNode; pTemplateChildNode = pTemplateChildNode->GetNodeItem( @@ -1089,7 +1089,7 @@ CXFA_Node* CXFA_Document::DataMerge_CopyContainer(CXFA_Node* pTemplateNode, case XFA_ELEMENT_Variables: break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } return NULL; @@ -1142,7 +1142,7 @@ static void XFA_DataMerge_UpdateBindingRelations(CXFA_Document* pDocument, CXFA_Node* pDataParent = pDataNode->GetNodeItem(XFA_NODEITEM_Parent); if (pDataParent != pDataScope) { - FXSYS_assert(pDataParent); + ASSERT(pDataParent); pDataParent->RemoveChild(pDataNode); pDataScope->InsertChild(pDataNode); } @@ -1334,7 +1334,7 @@ void CXFA_Document::DoDataMerge() { if (!pFormRoot) { bEmptyForm = TRUE; pFormRoot = CreateNode(XFA_XDPPACKET_Form, XFA_ELEMENT_Form); - FXSYS_assert(pFormRoot); + ASSERT(pFormRoot); pFormRoot->SetCData(XFA_ATTRIBUTE_Name, FX_WSTRC(L"form")); m_pRootNode->InsertChild(pFormRoot, NULL); } else { @@ -1347,7 +1347,7 @@ void CXFA_Document::DoDataMerge() { } CXFA_Node* pSubformSetNode = XFA_NodeMerge_CloneOrMergeContainer( this, pFormRoot, pTemplateChosen, FALSE); - FXSYS_assert(pSubformSetNode); + ASSERT(pSubformSetNode); if (!pDataTopLevel) { CFX_WideStringC wsFormName = pSubformSetNode->GetCData(XFA_ATTRIBUTE_Name); CFX_WideString wsDataTopLevelName = @@ -1361,7 +1361,7 @@ void CXFA_Document::DoDataMerge() { CXFA_Node* pBeforeNode = pDataRoot->GetNodeItem(XFA_NODEITEM_FirstChild); pDataRoot->InsertChild(pDataTopLevel, pBeforeNode); } - FXSYS_assert(pDataTopLevel); + ASSERT(pDataTopLevel); XFA_DataMerge_CreateDataBinding(pSubformSetNode, pDataTopLevel); for (CXFA_Node* pTemplateChild = pTemplateChosen->GetNodeItem(XFA_NODEITEM_FirstChild); diff --git a/xfa/fxfa/parser/xfa_document_serialize.cpp b/xfa/fxfa/parser/xfa_document_serialize.cpp index 09b51914ca..fce951420d 100644 --- a/xfa/fxfa/parser/xfa_document_serialize.cpp +++ b/xfa/fxfa/parser/xfa_document_serialize.cpp @@ -165,7 +165,7 @@ FX_BOOL XFA_DataExporter_ContentNodeNeedtoExport(CXFA_Node* pContentNode) { if (!pContentNode->TryContent(wsContent, FALSE, FALSE)) { return FALSE; } - FXSYS_assert(pContentNode->GetObjectType() == XFA_OBJECTTYPE_ContentNode); + ASSERT(pContentNode->GetObjectType() == XFA_OBJECTTYPE_ContentNode); CXFA_Node* pParentNode = pContentNode->GetNodeItem(XFA_NODEITEM_Parent); if (!pParentNode || pParentNode->GetClassID() != XFA_ELEMENT_Value) { return TRUE; @@ -282,10 +282,10 @@ static void XFA_DataExporter_RegenerateFormFile_Changed( iEnd = wsRawValue.Find(L'\n', iStart); } CXFA_Node* pParentNode = pNode->GetNodeItem(XFA_NODEITEM_Parent); - FXSYS_assert(pParentNode); + ASSERT(pParentNode); CXFA_Node* pGrandparentNode = pParentNode->GetNodeItem(XFA_NODEITEM_Parent); - FXSYS_assert(pGrandparentNode); + ASSERT(pGrandparentNode); CFX_WideString bodyTagName; bodyTagName = pGrandparentNode->GetCData(XFA_ATTRIBUTE_Name); if (bodyTagName.IsEmpty()) { @@ -512,7 +512,7 @@ FX_BOOL CXFA_DataExporter::Export(IFX_Stream* pStream, return FALSE; } CXFA_Node* pDataNode = pNode->GetNodeItem(XFA_NODEITEM_FirstChild); - FXSYS_assert(pDataNode); + ASSERT(pDataNode); XFA_DataExporter_DealWithDataGroupNode(pDataNode); pXMLDoc->SaveXMLNode(pStream, pElement); } break; @@ -568,14 +568,14 @@ void XFA_DataExporter_DealWithDataGroupNode(CXFA_Node* pDataNode) { if (pDataNode->GetClassID() == XFA_ELEMENT_DataGroup) { if (iChildNum > 0) { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); - FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); CFDE_XMLElement* pXMLElement = static_cast(pXMLNode); if (pXMLElement->HasAttribute(L"xfa:dataNode")) { pXMLElement->RemoveAttribute(L"xfa:dataNode"); } } else { CFDE_XMLNode* pXMLNode = pDataNode->GetXMLMappingNode(); - FXSYS_assert(pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLNode->GetType() == FDE_XMLNODE_Element); static_cast(pXMLNode) ->SetString(FX_WSTRC(L"xfa:dataNode"), FX_WSTRC(L"dataGroup")); } diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index b5d3bff885..ef2df840c9 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -46,8 +46,8 @@ CXFA_ItemLayoutProcessor::CXFA_ItemLayoutProcessor(CXFA_Node* pNode, m_bUseInheriated(FALSE), m_ePreProcessRs(XFA_ItemLayoutProcessorResult_Done), m_bHasAvailHeight(TRUE) { - FXSYS_assert(m_pFormNode && (m_pFormNode->IsContainerNode() || - m_pFormNode->GetClassID() == XFA_ELEMENT_Form)); + ASSERT(m_pFormNode && (m_pFormNode->IsContainerNode() || + m_pFormNode->GetClassID() == XFA_ELEMENT_Form)); m_pOldLayoutItem = (CXFA_ContentLayoutItem*)m_pFormNode->GetUserData(XFA_LAYOUTITEMKEY); } diff --git a/xfa/fxfa/parser/xfa_localemgr.cpp b/xfa/fxfa/parser/xfa_localemgr.cpp index 90c9824b76..069279cdc5 100644 --- a/xfa/fxfa/parser/xfa_localemgr.cpp +++ b/xfa/fxfa/parser/xfa_localemgr.cpp @@ -1271,7 +1271,7 @@ static CXFA_TimeZoneProvider* g_pProvider = NULL; // Static. CXFA_TimeZoneProvider* CXFA_TimeZoneProvider::Create() { - FXSYS_assert(!g_pProvider); + ASSERT(!g_pProvider); g_pProvider = new CXFA_TimeZoneProvider(); return g_pProvider; } diff --git a/xfa/fxfa/parser/xfa_localevalue.cpp b/xfa/fxfa/parser/xfa_localevalue.cpp index 2c018ea72d..7530d80f5a 100644 --- a/xfa/fxfa/parser/xfa_localevalue.cpp +++ b/xfa/fxfa/parser/xfa_localevalue.cpp @@ -371,7 +371,7 @@ CFX_Unitime CXFA_LocaleValue::GetDate() const { CFX_Unitime CXFA_LocaleValue::GetTime() const { if (m_bValid && m_dwType == XFA_VT_TIME) { CFX_Unitime dt(0); - FXSYS_assert(m_pLocaleMgr); + ASSERT(m_pLocaleMgr); FX_TimeFromCanonical(m_wsValue.AsStringC(), dt, m_pLocaleMgr->GetDefLocale()); return dt; @@ -383,7 +383,7 @@ CFX_Unitime CXFA_LocaleValue::GetDateTime() const { int32_t index = m_wsValue.Find('T'); CFX_Unitime dt; FX_DateFromCanonical(m_wsValue.Left(index), dt); - FXSYS_assert(m_pLocaleMgr); + ASSERT(m_pLocaleMgr); FX_TimeFromCanonical( m_wsValue.Right(m_wsValue.GetLength() - index - 1).AsStringC(), dt, m_pLocaleMgr->GetDefLocale()); @@ -890,8 +890,8 @@ void CXFA_LocaleValue::GetNumbericFormat(CFX_WideString& wsFormat, int32_t nIntLen, int32_t nDecLen, FX_BOOL bSign) { - FXSYS_assert(wsFormat.IsEmpty()); - FXSYS_assert(nIntLen >= -1 && nDecLen >= -1); + ASSERT(wsFormat.IsEmpty()); + ASSERT(nIntLen >= -1 && nDecLen >= -1); int32_t nTotalLen = (nIntLen >= 0 ? nIntLen : 2) + (bSign ? 1 : 0) + (nDecLen >= 0 ? nDecLen : 2) + (nDecLen == 0 ? 0 : 1); FX_WCHAR* lpBuf = wsFormat.GetBuffer(nTotalLen); @@ -963,7 +963,7 @@ FX_BOOL CXFA_LocaleValue::ValidateNumericTemp(CFX_WideString& wsNumeric, return FALSE; } while (nf < nCountFmt && (cf = pFmt[nf]) != L'.') { - FXSYS_assert(cf == L'z' || cf == L'*'); + ASSERT(cf == L'z' || cf == L'*'); ++nf; } CFX_WideString wsDecimalSymbol; diff --git a/xfa/fxfa/parser/xfa_object_imp.cpp b/xfa/fxfa/parser/xfa_object_imp.cpp index fd54b1509b..6b438387be 100644 --- a/xfa/fxfa/parser/xfa_object_imp.cpp +++ b/xfa/fxfa/parser/xfa_object_imp.cpp @@ -64,7 +64,7 @@ void CXFA_Object::Script_ObjectClass_ClassName(FXJSE_HVALUE hValue, } void CXFA_Object::ThrowScriptErrorMessage(int32_t iStringID, ...) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); - FXSYS_assert(pAppProvider); + ASSERT(pAppProvider); CFX_WideString wsFormat; pAppProvider->LoadString(iStringID, wsFormat); CFX_WideString wsMessage; @@ -108,7 +108,7 @@ CXFA_Node::CXFA_Node(CXFA_Document* pDoc, ASSERT(m_pDocument); } CXFA_Node::~CXFA_Node() { - FXSYS_assert(m_pParent == NULL); + ASSERT(m_pParent == NULL); RemoveMapModuleKey(); CXFA_Node *pNext, *pNode = m_pChild; while (pNode) { @@ -316,7 +316,7 @@ CXFA_Node* CXFA_Node::CreateSamePacketNode(XFA_ELEMENT eElement, return pNode; } CXFA_Node* CXFA_Node::CloneTemplateToForm(FX_BOOL bRecursive) { - FXSYS_assert(m_ePacket == XFA_XDPPACKET_Template); + ASSERT(m_ePacket == XFA_XDPPACKET_Template); CXFA_Document* pFactory = m_pDocument->GetParser()->GetFactory(); CXFA_Node* pClone = pFactory->CreateNode(XFA_XDPPACKET_Form, m_eNodeClass); if (!pClone) { @@ -500,7 +500,7 @@ CXFA_WidgetData* CXFA_Node::GetContainerWidgetData() { FX_BOOL CXFA_Node::GetLocaleName(CFX_WideString& wsLocaleName) { CXFA_Node* pForm = GetDocument()->GetXFAObject(XFA_HASHCODE_Form)->AsNode(); CXFA_Node* pTopSubform = pForm->GetFirstChildByClass(XFA_ELEMENT_Subform); - FXSYS_assert(pTopSubform); + ASSERT(pTopSubform); CXFA_Node* pLocaleNode = this; FX_BOOL bLocale = FALSE; do { @@ -623,7 +623,7 @@ CXFA_Node* CXFA_Node::GetDataDescriptionNode() { return NULL; } void CXFA_Node::SetDataDescriptionNode(CXFA_Node* pDataDescriptionNode) { - FXSYS_assert(m_ePacket == XFA_XDPPACKET_Datasets); + ASSERT(m_ePacket == XFA_XDPPACKET_Datasets); m_pAuxNode = pDataDescriptionNode; } void CXFA_Node::Script_TreeClass_ResolveNode(CFXJSE_Arguments* pArguments) { @@ -748,7 +748,7 @@ void CXFA_Node::Script_TreeClass_Nodes(FXJSE_HVALUE hValue, } if (bSetting) { IXFA_AppProvider* pAppProvider = m_pDocument->GetNotify()->GetAppProvider(); - FXSYS_assert(pAppProvider); + ASSERT(pAppProvider); CFX_WideString wsMessage; pAppProvider->LoadString(XFA_IDS_Unable_TO_SET, wsMessage); FXJSE_ThrowMessage( @@ -1928,7 +1928,7 @@ void CXFA_Node::Script_Draw_DefaultValue(FXJSE_HVALUE hValue, if (bSetting) { if (FXJSE_Value_IsUTF8String(hValue)) { CXFA_WidgetData* pWidgetData = GetWidgetData(); - FXSYS_assert(pWidgetData); + ASSERT(pWidgetData); XFA_ELEMENT uiType = pWidgetData->GetUIType(); if (uiType == XFA_ELEMENT_Text) { CFX_ByteString newValue; @@ -3297,7 +3297,7 @@ int32_t CXFA_Node::InstanceManager_SetInstances(int32_t iDesired) { continue; } if (pRemoveInstance->GetClassID() == XFA_ELEMENT_InstanceManager) { - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } if (pRemoveInstance->GetNameHash() == dInstanceNameHash) { @@ -3691,7 +3691,7 @@ void CXFA_Node::Script_Xfa_This(FXJSE_HVALUE hValue, XFA_ATTRIBUTE eAttribute) { if (!bSetting) { CXFA_Object* pThis = m_pDocument->GetScriptContext()->GetThisObject(); - FXSYS_assert(pThis); + ASSERT(pThis); FXJSE_Value_Set(hValue, m_pDocument->GetScriptContext()->GetJSValueFromMap(pThis)); } @@ -3981,14 +3981,14 @@ FX_BOOL CXFA_Node::SetCData(XFA_ATTRIBUTE eAttr, static_cast(m_pXMLNode)->SetText(wsValue); break; default: - FXSYS_assert(0); + ASSERT(0); } return TRUE; } const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr); if (pInfo) { - FXSYS_assert(m_pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(m_pXMLNode->GetType() == FDE_XMLNODE_Element); CFX_WideString wsAttrName = pInfo->pName; if (pInfo->eName == XFA_ATTRIBUTE_ContentType) { wsAttrName = FX_WSTRC(L"xfa:") + wsAttrName; @@ -4038,7 +4038,7 @@ FX_BOOL CXFA_Node::SetAttributeValue(const CFX_WideString& wsValue, static_cast(m_pXMLNode)->SetText(wsXMLValue); break; default: - FXSYS_assert(0); + ASSERT(0); } } return TRUE; @@ -4119,7 +4119,7 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, SetMapModuleValue(pKey, pValue); OnChanged(eAttr, bNotify, FALSE); if (IsNeedSavingXMLNode()) { - FXSYS_assert(m_pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(m_pXMLNode->GetType() == FDE_XMLNODE_Element); const XFA_ATTRIBUTEINFO* pInfo = XFA_GetAttributeByID(eAttr); if (pInfo) { switch (eType) { @@ -4140,7 +4140,7 @@ FX_BOOL CXFA_Node::SetValue(XFA_ATTRIBUTE eAttr, ->SetInteger(pInfo->pName, (int32_t)(uintptr_t)pValue); break; default: - FXSYS_assert(0); + ASSERT(0); } } } @@ -4189,7 +4189,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, if (XFA_FieldIsMultiListBox(this)) { CXFA_Node* pValue = GetProperty(0, XFA_ELEMENT_Value); CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild); - FXSYS_assert(pChildValue); + ASSERT(pChildValue); pChildValue->SetCData(XFA_ATTRIBUTE_ContentType, FX_WSTRC(L"text/xml")); pChildValue->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify, FALSE); @@ -4268,7 +4268,7 @@ FX_BOOL CXFA_Node::SetScriptContent(const CFX_WideString& wsContent, } else { CXFA_Node* pValue = GetProperty(0, XFA_ELEMENT_Value); CXFA_Node* pChildValue = pValue->GetNodeItem(XFA_NODEITEM_FirstChild); - FXSYS_assert(pChildValue); + ASSERT(pChildValue); pChildValue->SetScriptContent(wsContent, wsContent, bNotify, bScriptModify, FALSE); } @@ -4551,7 +4551,7 @@ int32_t CXFA_Node::CountChildren(XFA_ELEMENT eElement, FX_BOOL bOnlyChild) { CXFA_Node* CXFA_Node::GetChild(int32_t index, XFA_ELEMENT eElement, FX_BOOL bOnlyChild) { - FXSYS_assert(index > -1); + ASSERT(index > -1); CXFA_Node* pNode = m_pChild; int32_t iCount = 0; for (; pNode; pNode = pNode->GetNodeItem(XFA_NODEITEM_NextSibling)) { @@ -4576,7 +4576,7 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { pNode->m_pParent = this; FX_BOOL bWasPurgeNode = m_pDocument->RemovePurgeNode(pNode); if (!bWasPurgeNode) - FXSYS_assert(false); + ASSERT(false); if (m_pChild == NULL || index == 0) { if (index > 0) { @@ -4611,7 +4611,7 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { pNotify->OnChildAdded(this); if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { - FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); + ASSERT(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, index); pNode->ClearFlag(XFA_NODEFLAG_OwnXMLNode); } @@ -4620,12 +4620,12 @@ int32_t CXFA_Node::InsertChild(int32_t index, CXFA_Node* pNode) { FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { if (!pNode || pNode->m_pParent || (pBeforeNode && pBeforeNode->m_pParent != this)) { - FXSYS_assert(false); + ASSERT(false); return FALSE; } FX_BOOL bWasPurgeNode = m_pDocument->RemovePurgeNode(pNode); if (!bWasPurgeNode) - FXSYS_assert(false); + ASSERT(false); int32_t nIndex = -1; pNode->m_pParent = this; @@ -4657,7 +4657,7 @@ FX_BOOL CXFA_Node::InsertChild(CXFA_Node* pNode, CXFA_Node* pBeforeNode) { pNotify->OnChildAdded(this); if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { - FXSYS_assert(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); + ASSERT(pNode->m_pXMLNode->GetNodeItem(CFDE_XMLNode::Parent) == NULL); m_pXMLNode->InsertChildNode(pNode->m_pXMLNode, nIndex); pNode->ClearFlag(XFA_NODEFLAG_OwnXMLNode); } @@ -4677,7 +4677,7 @@ CXFA_Node* CXFA_Node::Deprecated_GetPrevSibling() { } FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { if (pNode == NULL || pNode->m_pParent != this) { - FXSYS_assert(FALSE); + ASSERT(FALSE); return FALSE; } if (m_pChild == pNode) { @@ -4702,8 +4702,8 @@ FX_BOOL CXFA_Node::RemoveChild(CXFA_Node* pNode, bool bNotify) { m_pDocument->AddPurgeNode(pNode); if (IsNeedSavingXMLNode() && pNode->m_pXMLNode) { if (pNode->IsAttributeInXML()) { - FXSYS_assert(pNode->m_pXMLNode == m_pXMLNode && - m_pXMLNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pNode->m_pXMLNode == m_pXMLNode && + m_pXMLNode->GetType() == FDE_XMLNODE_Element); if (pNode->m_pXMLNode->GetType() == FDE_XMLNODE_Element) { CFDE_XMLElement* pXMLElement = static_cast(pNode->m_pXMLNode); diff --git a/xfa/fxfa/parser/xfa_parser_imp.cpp b/xfa/fxfa/parser/xfa_parser_imp.cpp index 4c53d3f512..7eef2bd403 100644 --- a/xfa/fxfa/parser/xfa_parser_imp.cpp +++ b/xfa/fxfa/parser/xfa_parser_imp.cpp @@ -668,7 +668,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_Data( if (pParentXMLNode) { pParentXMLNode->RemoveChildNode(pXMLDocumentNode); } - FXSYS_assert(pXMLDocumentNode->GetType() == FDE_XMLNODE_Element); + ASSERT(pXMLDocumentNode->GetType() == FDE_XMLNODE_Element); if (pXMLDocumentNode->GetType() == FDE_XMLNODE_Element) { static_cast(pXMLDocumentNode) ->RemoveAttribute(L"xmlns:xfa"); @@ -958,7 +958,7 @@ void XFA_ConvertXMLToPlainText(CFDE_XMLElement* pRootXMLNode, } } break; default: - FXSYS_assert(FALSE); + ASSERT(FALSE); break; } } @@ -1014,7 +1014,7 @@ void CXFA_SimpleParser::ParseContentNode(CXFA_Node* pXFANode, if (pXFANode->GetObjectType() == XFA_OBJECTTYPE_ContentNode) { CXFA_Node* pContentRawDataNode = m_pFactory->CreateNode(ePacketID, element); - FXSYS_assert(pContentRawDataNode); + ASSERT(pContentRawDataNode); pContentRawDataNode->SetCData(XFA_ATTRIBUTE_Value, wsValue); pXFANode->InsertChild(pContentRawDataNode); } else { @@ -1363,7 +1363,7 @@ int32_t CXFA_DocumentParser::StartParse(IFX_FileRead* pStream, int32_t CXFA_DocumentParser::DoParse(IFX_Pause* pPause) { int32_t nRetStatus = m_nodeParser.DoParse(pPause); if (nRetStatus >= XFA_PARSESTATUS_Done) { - FXSYS_assert(m_pDocument); + ASSERT(m_pDocument); m_pDocument->SetRoot(m_nodeParser.GetRootNode()); } return nRetStatus; diff --git a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp index 6a8700c670..c771000ebd 100644 --- a/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_hostpseudomodel.cpp @@ -405,7 +405,7 @@ void CScript_HostPseudoModel::Script_HostPseudoModel_DocumentInBatch( static int32_t XFA_FilterName(const CFX_WideStringC& wsExpression, int32_t nStart, CFX_WideString& wsFilter) { - FXSYS_assert(nStart > -1); + ASSERT(nStart > -1); int32_t iLength = wsExpression.GetLength(); if (nStart >= iLength) { return iLength; diff --git a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp index 1094beb31b..e46b7060a1 100644 --- a/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp +++ b/xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp @@ -422,7 +422,7 @@ void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Relayout( CFXJSE_Arguments* pArguments) { CXFA_Node* pRootNode = m_pDocument->GetRoot(); CXFA_Node* pFormRoot = pRootNode->GetFirstChildByClass(XFA_ELEMENT_Form); - FXSYS_assert(pFormRoot); + ASSERT(pFormRoot); CXFA_Node* pContentRootNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild); CXFA_LayoutProcessor* pLayoutProcessor = m_pDocument->GetLayoutProcessor(); if (pContentRootNode) { diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index fcd24bf949..6ea1a331c1 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -522,7 +522,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter( const CFX_WideStringC& wsExpression, int32_t nStart, CXFA_ResolveNodesData& rnd) { - FXSYS_assert(nStart > -1); + ASSERT(nStart > -1); int32_t iLength = wsExpression.GetLength(); if (nStart >= iLength) { return 0; @@ -691,7 +691,7 @@ void CXFA_ResolveProcessor::XFA_ResolveNode_DoPredicateFilter( int32_t iFoundCount, CXFA_ResolveNodesData& rnd) { CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes; - FXSYS_assert(iFoundCount == findNodes.GetSize()); + ASSERT(iFoundCount == findNodes.GetSize()); CFX_WideString wsExpression; XFA_SCRIPTLANGTYPE eLangType = XFA_SCRIPTLANGTYPE_Unkown; if (wsCondition.Left(2) == FX_WSTRC(L".[") && diff --git a/xfa/fxjse/class.cpp b/xfa/fxjse/class.cpp index 181398c630..d6744a6112 100644 --- a/xfa/fxjse/class.cpp +++ b/xfa/fxjse/class.cpp @@ -132,7 +132,7 @@ static void FXJSE_V8ConstructorCallback_Wrapper( if (!lpClassDefinition) { return; } - FXSYS_assert(info.This()->InternalFieldCount()); + ASSERT(info.This()->InternalFieldCount()); info.This()->SetAlignedPointerInInternalField(0, NULL); } -- cgit v1.2.3