From ff46aaf499edcf153ee2f57c7016587aa96dcfa0 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 27 Jul 2015 11:55:29 -0700 Subject: FX Bool considered harmful, part 3 Try to reland this patch after fixing underlying issues that caused it to be reverted. fx_system.h is the only manual edit. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1258093002 . --- core/src/fxcodec/jbig2/JBig2_Context.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'core/src/fxcodec/jbig2/JBig2_Context.cpp') diff --git a/core/src/fxcodec/jbig2/JBig2_Context.cpp b/core/src/fxcodec/jbig2/JBig2_Context.cpp index 68c973547c..0b71c475c2 100644 --- a/core/src/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/src/fxcodec/jbig2/JBig2_Context.cpp @@ -47,7 +47,7 @@ CJBig2_Context::CJBig2_Context(uint8_t *pGlobalData, FX_DWORD dwGlobalLength, JBIG2_ALLOC(m_pSegmentList, CJBig2_List); JBIG2_ALLOC(m_pPageInfoList, CJBig2_List(1)); m_pPage = NULL; - m_bBufSpecified = FALSE; + m_bBufSpecified = false; m_pPause = pPause; m_nSegmentDecoded = 0; m_PauseStep = 10; @@ -231,11 +231,11 @@ int32_t CJBig2_Context::getFirstPage(uint8_t *pBuf, int32_t width, int32_t heigh return nRet; } } - m_bFirstPage = TRUE; + m_bFirstPage = true; m_PauseStep = 0; delete m_pPage; JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf)); - m_bBufSpecified = TRUE; + m_bBufSpecified = true; if(m_pPage && pPause && pPause->NeedToPauseNow()) { m_PauseStep = 1; m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; @@ -298,11 +298,11 @@ int32_t CJBig2_Context::Continue(IFX_Pause* pPause) int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height, int32_t stride, IFX_Pause* pPause) { int32_t nRet = JBIG2_ERROR_STREAM_TYPE; - m_bFirstPage = FALSE; + m_bFirstPage = false; m_PauseStep = 0; delete m_pPage; JBIG2_ALLOC(m_pPage, CJBig2_Image(width, height, stride, pBuf)); - m_bBufSpecified = TRUE; + m_bBufSpecified = true; if(m_pPage && pPause && pPause->NeedToPauseNow()) { m_PauseStep = 1; m_ProcessiveStatus = FXCODEC_STATUS_DECODE_TOBECONTINUE; @@ -330,7 +330,7 @@ int32_t CJBig2_Context::getNextPage(uint8_t *pBuf, int32_t width, int32_t height int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) { int32_t nRet; - m_bFirstPage = TRUE; + m_bFirstPage = true; m_PauseStep = 0; if(m_pGlobalContext) { nRet = m_pGlobalContext->decode_EmbedOrgnazation(pPause); @@ -338,14 +338,14 @@ int32_t CJBig2_Context::getFirstPage(CJBig2_Image **image, IFX_Pause* pPause) return nRet; } } - m_bBufSpecified = FALSE; + m_bBufSpecified = false; return Continue(pPause); } int32_t CJBig2_Context::getNextPage(CJBig2_Image **image, IFX_Pause* pPause) { int32_t nRet; - m_bBufSpecified = FALSE; - m_bFirstPage = FALSE; + m_bBufSpecified = false; + m_bFirstPage = false; m_PauseStep = 0; switch(m_nStreamType) { case JBIG2_FILE_STREAM: @@ -601,14 +601,14 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa CJBig2_HuffmanTable *Table_B1 = NULL, *Table_B2 = NULL, *Table_B3 = NULL, *Table_B4 = NULL, *Table_B5 = NULL; int32_t i, nIndex, nRet; CJBig2_Segment *pSeg = NULL, *pLRSeg = NULL; - FX_BOOL bUsed; + bool bUsed; CJBig2_Image ** SDINSYMS = NULL; CJBig2_SDDProc *pSymbolDictDecoder; JBig2ArithCtx *gbContext = NULL, *grContext = NULL; CJBig2_ArithDecoder *pArithDecoder; JBIG2_ALLOC(pSymbolDictDecoder, CJBig2_SDDProc()); uint8_t *key = pSegment->m_pData; - FX_BOOL cache_hit = false; + bool cache_hit = false; if(m_pStream->readShortInteger(&wFlags) != 0) { m_pModule->JBig2_Error("symbol dictionary segment : data header too short."); nRet = JBIG2_ERROR_TOO_SHORT; @@ -825,16 +825,16 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa } } if(wFlags & 0x0200) { - pSegment->m_Result.sd->m_bContextRetained = TRUE; + pSegment->m_Result.sd->m_bContextRetained = true; if(pSymbolDictDecoder->SDHUFF == 0) { pSegment->m_Result.sd->m_gbContext = gbContext; } if(pSymbolDictDecoder->SDREFAGG == 1) { pSegment->m_Result.sd->m_grContext = grContext; } - bUsed = TRUE; + bUsed = true; } else { - bUsed = FALSE; + bUsed = false; } delete pSymbolDictDecoder; if(SDINSYMS) { @@ -845,7 +845,7 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment *pSegment, IFX_Pause* pPa delete Table_B3; delete Table_B4; delete Table_B5; - if(bUsed == FALSE) { + if(bUsed == false) { if(gbContext) { m_pModule->JBig2_Free(gbContext); } -- cgit v1.2.3