From 76b428d4b46d4917caea81c8e262ae0fd326863a Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 6 Apr 2016 08:53:36 -0700 Subject: Remove redundant parentheses around == comparison operator Bug: 28026175 Change-Id: I8ff9d8d1dd73933dc181f2745292a0a3398a2479 --- libAACdec/src/block.cpp | 3 +-- libAACdec/src/rvlcconceal.cpp | 4 ++-- libAACenc/src/aacenc_lib.cpp | 2 +- libSBRenc/src/sbr_encoder.cpp | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/libAACdec/src/block.cpp b/libAACdec/src/block.cpp index 9d703cc..526accb 100644 --- a/libAACdec/src/block.cpp +++ b/libAACdec/src/block.cpp @@ -329,8 +329,7 @@ AAC_DECODER_ERROR CBlock_ReadSectionData(HANDLE_FDK_BITSTREAM bs, if (numLinesInSecIdx >= MAX_SFB_HCR) { return AAC_DEC_PARSE_ERROR; } - if ( - (sect_cb == BOOKSCL) ) + if (sect_cb == BOOKSCL) { return AAC_DEC_INVALID_CODE_BOOK; } else { diff --git a/libAACdec/src/rvlcconceal.cpp b/libAACdec/src/rvlcconceal.cpp index ae6b4da..cf33dd5 100644 --- a/libAACdec/src/rvlcconceal.cpp +++ b/libAACdec/src/rvlcconceal.cpp @@ -459,7 +459,7 @@ void BidirectionalEstimation_UseScfOfPrevFrameAsReference ( break; case NOISE_HCB: - if ( (pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB) ) { + if ( pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB ) { commonMin = FDKmin(pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfFwd[bnds],pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfBwd[bnds]); pAacDecoderChannelInfo->pDynData->aScaleFactor[bnds] = FDKmin(commonMin, pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousScaleFactor[bnds]); } else { @@ -669,7 +669,7 @@ void PredictiveInterpolation ( break; case NOISE_HCB: - if ( (pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB) ) { + if ( pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousCodebook[bnds]==NOISE_HCB ) { commonMin = FDKmin(pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfFwd[bnds],pAacDecoderChannelInfo->pComData->overlay.aac.aRvlcScfBwd[bnds]); pAacDecoderChannelInfo->pDynData->aScaleFactor[bnds] = FDKmin(commonMin, pAacDecoderStaticChannelInfo->concealmentInfo.aRvlcPreviousScaleFactor[bnds]); } diff --git a/libAACenc/src/aacenc_lib.cpp b/libAACenc/src/aacenc_lib.cpp index 63563fd..e24df65 100644 --- a/libAACenc/src/aacenc_lib.cpp +++ b/libAACenc/src/aacenc_lib.cpp @@ -1046,7 +1046,7 @@ static AACENC_ERROR aacEncInit(HANDLE_AACENCODER hAacEncoder, } /* Clear input buffer */ - if ( (InitFlags == AACENC_INIT_ALL) ) { + if ( InitFlags == AACENC_INIT_ALL ) { FDKmemclear(hAacEncoder->inputBuffer, sizeof(INT_PCM)*hAacEncoder->nMaxAacChannels*INPUTBUFFER_SIZE); } diff --git a/libSBRenc/src/sbr_encoder.cpp b/libSBRenc/src/sbr_encoder.cpp index 464c013..abe9793 100644 --- a/libSBRenc/src/sbr_encoder.cpp +++ b/libSBRenc/src/sbr_encoder.cpp @@ -1851,10 +1851,10 @@ INT sbrEncoder_Init( if ( (aot==AOT_PS) || (aot==AOT_MP2_PS) || (aot==AOT_DABPLUS_PS) || (aot==AOT_DRM_MPEG_PS) ) { usePs = 1; } - if ( (aot==AOT_ER_AAC_ELD) ) { + if ( aot==AOT_ER_AAC_ELD ) { lowDelay = 1; } - else if ( (aot==AOT_ER_AAC_LD) ) { + else if ( aot==AOT_ER_AAC_LD ) { error = 1; goto bail; } -- cgit v1.2.3 From 4bd4510b19f6bdf21bfdc7350e9d3eab2db9c6b8 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 6 Apr 2016 08:54:07 -0700 Subject: Left shift of negative int is undefined Bug: 28026175 Change-Id: I9dc851b818262e95711033bdc03b7b7f30cff133 --- libAACenc/src/metadata_compressor.cpp | 50 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/libAACenc/src/metadata_compressor.cpp b/libAACenc/src/metadata_compressor.cpp index 876de57..68a64ae 100644 --- a/libAACenc/src/metadata_compressor.cpp +++ b/libAACenc/src/metadata_compressor.cpp @@ -193,36 +193,36 @@ struct DRC_COMP { * Profile tables. */ static const FIXP_DBL tabMaxBoostThr[] = { - (FIXP_DBL)(-43<channels = channelMapping.nChannels; /* Init states. */ - drcComp->smoothLevel[0] = drcComp->smoothLevel[1] = (FIXP_DBL)(-135<smoothLevel[0] = drcComp->smoothLevel[1] = (FIXP_DBL)(int)((unsigned)-135<smoothGain, sizeof(drcComp->smoothGain)); FDKmemclear(drcComp->holdCnt, sizeof(drcComp->holdCnt)); -- cgit v1.2.3 From 1dd76496664e6e9f0d6d7aa4619a89252ab99b39 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 6 Apr 2016 08:54:21 -0700 Subject: Add default case for undefined pointer initialization Bug: 28026175 Change-Id: I1b149bf1573296df18abbe44f737bd87ab3913f9 --- libSBRdec/src/env_extr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libSBRdec/src/env_extr.cpp b/libSBRdec/src/env_extr.cpp index 6cb0b99..bdb29e5 100644 --- a/libSBRdec/src/env_extr.cpp +++ b/libSBRdec/src/env_extr.cpp @@ -904,6 +904,9 @@ static const FRAME_INFO v_frame_info4_8 = { 0, 4, {0, 2, 4, 6, 8}, {1, 1, 1, 1}, break; default: FDK_ASSERT(0); + /* in case assertion checks are disabled, force a definite memory fault at first access */ + pTable = NULL; + break; } /* look number of envelopes in table */ -- cgit v1.2.3 From 32db3a45dffee7d9c277a527d8926d2d913848a2 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Wed, 6 Apr 2016 08:51:45 -0700 Subject: Disable warnings that are not easily fixable Bug: 28026175 Change-Id: I6e9cfcd9efeb853caee01b54b241f24e64cf1e94 --- Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/Android.mk b/Android.mk index 4c28670..519e820 100644 --- a/Android.mk +++ b/Android.mk @@ -40,6 +40,7 @@ LOCAL_SRC_FILES := \ $(sbrenc_sources:%=libSBRenc/src/%) LOCAL_CFLAGS += -Wno-sequence-point -Wno-extra +LOCAL_CFLAGS += "-Wno-\#warnings" -Wno-constant-logical-operand -Wno-self-assign LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/libAACdec/include \ -- cgit v1.2.3