From 5b990899973519bca96adc42f53df355be2b99d5 Mon Sep 17 00:00:00 2001 From: yilmazt Date: Mon, 13 Aug 2018 20:00:23 +0200 Subject: [PATCH] Minor warning fixes --- openair1/PHY/CODING/TESTBENCH/polartest.c | 2 +- openair1/PHY/CODING/nr_polar_init.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c index b9d52d849f..aa811399a0 100644 --- a/openair1/PHY/CODING/TESTBENCH/polartest.c +++ b/openair1/PHY/CODING/TESTBENCH/polartest.c @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { double SNR, SNR_lin; int16_t nBitError = 0; // -1 = Decoding failed (All list entries have failed the CRC checks). int8_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error. - uint16_t testLength, coderLength, blockErrorCumulative=0, bitErrorCumulative=0; + uint16_t testLength = 0, coderLength = 0, blockErrorCumulative=0, bitErrorCumulative=0; double timeEncoderCumulative = 0, timeDecoderCumulative = 0; uint8_t aggregation_level, decoderListSize = 8, pathMetricAppr = 0; //0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12) diff --git a/openair1/PHY/CODING/nr_polar_init.c b/openair1/PHY/CODING/nr_polar_init.c index c0dcdf7b0b..a4a86389cc 100644 --- a/openair1/PHY/CODING/nr_polar_init.c +++ b/openair1/PHY/CODING/nr_polar_init.c @@ -31,16 +31,11 @@ void nr_polar_init(t_nrPolar_paramsPtr *polarParams, uint8_t aggregation_level) { t_nrPolar_paramsPtr currentPtr = *polarParams; - t_nrPolar_paramsPtr previousPtr = NULL; //Parse the list. If the node is already created, return without initialization. while (currentPtr != NULL) { - if (currentPtr->idx == (messageType * messageLength)) { - return; - } else { - previousPtr = currentPtr; - currentPtr = currentPtr->nextPtr; - } + if (currentPtr->idx == (messageType * messageLength)) return; + else currentPtr = currentPtr->nextPtr; } //Else, initialize and add node to the end of the linked list. @@ -174,7 +169,7 @@ t_nrPolar_paramsPtr nr_polar_params (t_nrPolar_paramsPtr polarParams, int8_t messageType, uint16_t messageLength) { - t_nrPolar_paramsPtr currentPtr; + t_nrPolar_paramsPtr currentPtr = NULL; while (polarParams != NULL) { if (polarParams->idx == (messageType * messageLength)) {