Commit f52f2eda authored by mave2802's avatar mave2802
Browse files

refactored code according to STL 2024 Basop rules regarding usage of IF() vs if()

parent 198ffcfe
Loading
Loading
Loading
Loading
Loading
+34 −34
Original line number Diff line number Diff line
@@ -2572,15 +2572,13 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */
      Word16 *ptr_e )           /* o  : exponent of result         */
{
    Word16 shift;
    Word32 c_m;
    Word16 c_e = 0;

    /* Compare exponents: the difference is limited to +/- 30
    /* Compare exponents: the difference is limited to +/- 31
       The Word32 mantissa of the operand with lower exponent is shifted right by the exponent difference.
       Then, the unshifted mantissa of the operand with the higher exponent is added. The addition result
       is normalized and the result represents the mantissa to return. The returned exponent takes into
       account all shift operations.
    */

    if ( !a_m )
    {
        a_e = b_e;
@@ -2592,39 +2590,42 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */
        b_e = a_e;
        move16();
    }

    shift = sub( a_e, b_e );

    if ( shift > 0 )
        shift = s_min( shift, 31 );
    if ( shift < 0 )
        shift = s_max( shift, -31 );

    /* shift > 0 exponent of a is greater than exponent of b */
    if ( shift > 0 )
        b_m = L_shr( b_m, shift );
    /* shift < 0 exponent of b is greater than exponent of a */
    if ( shift < 0 )
        a_m = L_shl( a_m, shift );

    a_m = L_add( L_shr( a_m, 1 ), L_shr( b_m, 1 ) );

    if ( shift >= 0 )
    {
        /* exponent of a is greater or equal than exponent of b */
        c_e = add( a_e, 1 );
        shift = add( shift, 1 );
        a_m = L_shr( a_m, 1 );
        b_m = L_shr( b_m, s_min( shift,31 ));
    }
        a_e = add( a_e, 1 );
    if ( shift < 0 )
    {
        /* exponent of b is greater or equal than exponent of a */
        c_e = add( b_e, 1 );
        shift = sub( shift, 1 );
        a_m = L_shl( a_m, s_max( shift, -31));
        b_m = L_shr( b_m, 1 );
    }
    c_m = L_add( a_m, b_m );
        a_e = add( b_e, 1 );

    if ( c_m == 0 )
    shift = norm_l( a_m );
    if ( shift )
        a_m = L_shl( a_m, shift );
    if ( !a_m )
    {
        c_e = 0;
        a_e = 0;
        move16();
    }
    if ( c_m != 0 )
    {
        shift = norm_l( c_m );
        c_m = L_shl( c_m, shift );
        c_e = sub( c_e, shift );
    }
    if ( a_m )
        a_e = sub( a_e, shift );

    *ptr_e = c_e;
    return( c_m );
    *ptr_e = a_e;

    return ( a_m );
}
#else
Word32 BASOP_Util_Add_Mant32Exp /* o  : normalized result mantissa */
@@ -2643,7 +2644,6 @@ Word32 BASOP_Util_Add_Mant32Exp /* o : normalized result mantissa */
       is normalized and the result represents the mantissa to return. The returned exponent takes into
       account all shift operations.
    */

    if ( !a_m )
    {
        a_e = b_e;
+0 −1
Original line number Diff line number Diff line
@@ -72,7 +72,6 @@
#endif

/* ################### Start FIXES switches ########################### */

#define FIX_1990_SANITIZER_IN_REVERB_LOAD                    /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define FIX_1999_TEMPORARY_DISABLE_DIST_ATT_CHECK            /* Eri: Issue 1999: Range check on float values of distance attenuation, while the float values are not propagated to this function. The test is not correct, but configurable distance attenuation is not used in Characterization.*/
#define TEMP_FIX_2088_MSAN_INIT_ERROR                        /* Eri: Temporary fix for Issue 2088 - MSAN error. Will come with later port of JBM+Split rendering update */