From 830e0964ef9db5a948fb32e0a439f847e61d48d2 Mon Sep 17 00:00:00 2001 From: azmill Date: Mon, 24 Jul 2023 13:55:23 +1000 Subject: [PATCH 1/3] Fixing warnings on OSX with clang --- apps/decoder.c | 2 -- apps/renderer.c | 2 +- lib_debug/debug.c | 2 +- lib_debug/snr.c | 2 +- lib_rend/ivas_CQMFDecoder.c | 21 ++++++++------------- lib_rend/ivas_PredEncoder.c | 7 ------- lib_rend/ivas_efap.c | 21 +-------------------- 7 files changed, 12 insertions(+), 45 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 6e3e23bb47..74aa3d7376 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2352,7 +2352,6 @@ static ivas_error decodeVoIP( uint32_t nextPacketRcvTime_ms = 0; uint32_t systemTime_ms = 0; uint32_t systemTimeInc_ms = (uint32_t) JBM_FRONTEND_FETCH_FRAMESIZE_MS; - int32_t nFramesWritten = 0; int32_t nFramesFed = 0; @@ -2710,7 +2709,6 @@ static ivas_error decodeVoIP( frame++; systemTime_ms += systemTimeInc_ms; - nFramesWritten++; #ifdef WMOPS update_mem(); diff --git a/apps/renderer.c b/apps/renderer.c index 239e792162..c2b952755f 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -3485,7 +3485,7 @@ static void parseSceneDescriptionFile( return; } -static void printSupportedAudioConfigs() +static void printSupportedAudioConfigs( void ) { uint16_t i; const char *supportedFormats[] = { diff --git a/lib_debug/debug.c b/lib_debug/debug.c index 65497dda0a..736f35d43d 100644 --- a/lib_debug/debug.c +++ b/lib_debug/debug.c @@ -387,7 +387,7 @@ int16_t dbgread( * Closes opened files and frees allocated memory *--------------------------------------------------------------------*/ -void dbgclose() +void dbgclose( void ) { int16_t i; diff --git a/lib_debug/snr.c b/lib_debug/snr.c index f6e6fa9d52..5efefe8737 100644 --- a/lib_debug/snr.c +++ b/lib_debug/snr.c @@ -423,7 +423,7 @@ void snr_celp( * Finalizes and presents accumulated SNR data *--------------------------------------------------------------------*/ -void print_snr() +void print_snr( void ) { int16_t i; double snr, segsnr, wsegsnr; diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 8b04ec753d..33d9d49422 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -731,43 +731,38 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, float ***pppfCQMFImag ) { int32_t n; - int32_t iBitsRead; - - iBitsRead = 0; - iBitsRead += - ReadHeaderInformation( &psCQMFDecoder->iNumBands, pBits ); + ReadHeaderInformation( &psCQMFDecoder->iNumBands, pBits ); if ( psCQMFDecoder->iChannels == 2 ) { - iBitsRead += ReadMSInformation( + ReadMSInformation( psCQMFDecoder->iNumBands, &psCQMFDecoder->iMSMode, psCQMFDecoder->piMSFlags, psCQMFDecoder->piLRPhaseDiffs, psCQMFDecoder->piMSPredCoefs, pBits ); } - iBitsRead += ReadPredictors( psCQMFDecoder->psPredictionDecoder, + ReadPredictors( psCQMFDecoder->psPredictionDecoder, pBits ); - iBitsRead += ReadGroupInformation( + ReadGroupInformation( psCQMFDecoder->iChannels, psCQMFDecoder->iNumBlocks, &psCQMFDecoder->iCommonGrouping, psCQMFDecoder->piNumGroups, psCQMFDecoder->ppiGroupLengths, pBits ); - iBitsRead += ReadRMSEnvelope( + ReadRMSEnvelope( psCQMFDecoder->iChannels, (const int32_t *) psCQMFDecoder->piNumGroups, psCQMFDecoder->iNumBands, psCQMFDecoder->pppiRMSEnvelope, pBits ); #ifdef ENABLE_PMOD_ADJUST - iBitsRead += - ReadPmodInformation( psCQMFDecoder->ppiHiSMRFlags, psCQMFDecoder->psBSRead, + ReadPmodInformation( psCQMFDecoder->ppiHiSMRFlags, psCQMFDecoder->psBSRead, psCQMFDecoder->iChannels, psCQMFDecoder->iNumBands ); #endif - iBitsRead += ReadAllocInformation( &psCQMFDecoder->iAllocOffset, + ReadAllocInformation( &psCQMFDecoder->iAllocOffset, pBits ); if ( psCQMFDecoder->iChannels == 2 && @@ -807,7 +802,7 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, for ( n = 0; n < psCQMFDecoder->iChannels; n++ ) { - iBitsRead += ReadCQMFData( + ReadCQMFData( psCQMFDecoder->piNumGroups[n], (const int32_t *) psCQMFDecoder->ppiGroupLengths[n], psCQMFDecoder->iNumBands, psCQMFDecoder->piBandwidths, diff --git a/lib_rend/ivas_PredEncoder.c b/lib_rend/ivas_PredEncoder.c index e04d9f6359..6381588dda 100644 --- a/lib_rend/ivas_PredEncoder.c +++ b/lib_rend/ivas_PredEncoder.c @@ -145,9 +145,7 @@ int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, for ( c = 0; c < psPredictionEncoder->iChannels; c++ ) { int32_t b; - float fChanPredictionGainBits; psPredictionEncoder->piNumPredBands[c] = 50; - fChanPredictionGainBits = 0.0; for ( b = 0; b < psPredictionEncoder->piNumPredBands[c]; b++ ) { int32_t n; @@ -267,11 +265,6 @@ int32_t ComputePredictors( PredictionEncoder *psPredictionEncoder, psPredictionEncoder->ppfA1Imag[c][b] = fA1Imag; psPredictionEncoder->ppiA1Mag[c][b] = iA1Mag; psPredictionEncoder->ppiA1Phase[c][b] = iA1Phase; - - if ( psPredictionEncoder->ppiPredBandEnable[c][b] == 1 ) - { - fChanPredictionGainBits += fBitGain; // change this calculation - } } #if 0 // Estimate if the savings outway the signaling cost diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 4301d75dec..98277e3544 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -719,7 +719,7 @@ static void add_ghost_speakers( int16_t numVertex; int16_t lengthVertGhst; /* Nb of vertical ghost added */ int16_t lengthHorGhst; /* Nb of Horizontal Ghost */ - int16_t i, j, k, n, a; /* Integer for loops */ + int16_t i, j, k, a; /* Integer for loops */ int16_t num_new; /* Number of new vertices to add */ float maxAngle; /* Max azimuth tolerance for extend the LS setup horizontaly */ float newDiff; /* Angle differences that will help us set the extended LS setup */ @@ -842,12 +842,8 @@ static void add_ghost_speakers( } /* Adding new virtual speakers */ - n = 0; - for ( i = 0; i < k; ++i ) { - ++n; - if ( sectors[i] > 1 ) { newDiff = tmpAngleDiff[i] / sectors[i]; @@ -858,7 +854,6 @@ static void add_ghost_speakers( newAzi = tmpAzi[i] + ( j + 1 ) * newDiff; add_vertex( vertexArray, newAzi, 0, numVertex + a, EFAP_DMX_INTENSITY ); - ++n; ++a; if ( j > 0 ) @@ -1016,7 +1011,6 @@ static void visible_edges( int16_t maxVertex; int16_t i, j, k; int16_t a, b; - int16_t nbOfEdges; int16_t tmpSurface[4]; int16_t counter[EFAP_MAX_SIZE_TMP_BUFF][EFAP_MAX_SIZE_TMP_BUFF]; int16_t counterTranspose[EFAP_MAX_SIZE_TMP_BUFF][EFAP_MAX_SIZE_TMP_BUFF]; @@ -1059,19 +1053,6 @@ static void visible_edges( } } - nbOfEdges = 0; - for ( i = 0; i < maxVertex + 1; ++i ) - { - for ( j = 0; j < maxVertex + 1; ++j ) - { - counter[i][j] = counterTranspose[i][j] + counterTranspose[j][i]; - if ( counter[i][j] == 1 ) - { - ++nbOfEdges; - } - } - } - /* Finding the edges */ k = 0; -- GitLab From e07ca4f8b8b01a2f5edfbe79f636cbc7d5e697af Mon Sep 17 00:00:00 2001 From: azmill Date: Mon, 24 Jul 2023 14:13:06 +1000 Subject: [PATCH 2/3] Fixing formating for #620 warnings fixes. --- lib_rend/ivas_CQMFDecoder.c | 6 +++--- lib_rend/ivas_efap.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib_rend/ivas_CQMFDecoder.c b/lib_rend/ivas_CQMFDecoder.c index 33d9d49422..cea424d3d7 100644 --- a/lib_rend/ivas_CQMFDecoder.c +++ b/lib_rend/ivas_CQMFDecoder.c @@ -743,7 +743,7 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, pBits ); } ReadPredictors( psCQMFDecoder->psPredictionDecoder, - pBits ); + pBits ); ReadGroupInformation( @@ -759,11 +759,11 @@ int32_t DecodeFrame( CQMFDecoder *psCQMFDecoder, #ifdef ENABLE_PMOD_ADJUST ReadPmodInformation( psCQMFDecoder->ppiHiSMRFlags, psCQMFDecoder->psBSRead, - psCQMFDecoder->iChannels, psCQMFDecoder->iNumBands ); + psCQMFDecoder->iChannels, psCQMFDecoder->iNumBands ); #endif ReadAllocInformation( &psCQMFDecoder->iAllocOffset, - pBits ); + pBits ); if ( psCQMFDecoder->iChannels == 2 && psCQMFDecoder->iCommonGrouping == 1 ) diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 98277e3544..5663a4ce7c 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -719,7 +719,7 @@ static void add_ghost_speakers( int16_t numVertex; int16_t lengthVertGhst; /* Nb of vertical ghost added */ int16_t lengthHorGhst; /* Nb of Horizontal Ghost */ - int16_t i, j, k, a; /* Integer for loops */ + int16_t i, j, k, a; /* Integer for loops */ int16_t num_new; /* Number of new vertices to add */ float maxAngle; /* Max azimuth tolerance for extend the LS setup horizontaly */ float newDiff; /* Angle differences that will help us set the extended LS setup */ -- GitLab From 5a7ab3ed552a3f548f6b58aa73cc7113c336d73b Mon Sep 17 00:00:00 2001 From: azmill Date: Mon, 24 Jul 2023 14:19:56 +1000 Subject: [PATCH 3/3] Removed too much code when fixing warnings from #620, restoring it back --- lib_rend/ivas_efap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib_rend/ivas_efap.c b/lib_rend/ivas_efap.c index 5663a4ce7c..42ef8beaa3 100644 --- a/lib_rend/ivas_efap.c +++ b/lib_rend/ivas_efap.c @@ -1053,6 +1053,14 @@ static void visible_edges( } } + for ( i = 0; i < maxVertex + 1; ++i ) + { + for ( j = 0; j < maxVertex + 1; ++j ) + { + counter[i][j] = counterTranspose[i][j] + counterTranspose[j][i]; + } + } + /* Finding the edges */ k = 0; -- GitLab