shithub: sox

Download patch

ref: 3c32acc029a3fe7cd55a933e842ccdf0625fbf82
parent: 38464c2045ca581b2a5dfee895cabd683646f816
author: rrt <rrt>
date: Fri Apr 13 07:21:32 EDT 2007

Fix compiler warnings. All fixes were trivial and one of three:

1. Some functions were made static.

2. Some files had acelp.h #included to get prototypes for functions
   being defined.

3. In one case, two variables had to be initialised to avoid a
   harmless "may be used uninitalised" warning.

--- a/amr-wb/az_isp.c
+++ b/amr-wb/az_isp.c
@@ -25,6 +25,7 @@
  * predictor coefficient a[M].                                           *
  *-----------------------------------------------------------------------*/
 
+#include "acelp.h"
 #include "typedef.h"
 #include "basic_op.h"
 #include "oper_32b.h"
--- a/amr-wb/basicop2.c
+++ b/amr-wb/basicop2.c
@@ -445,63 +445,6 @@
 
 /*___________________________________________________________________________
  |                                                                           |
- |   Function Name : L_mult                                                  |
- |                                                                           |
- |   Purpose :                                                               |
- |                                                                           |
- |   L_mult is the 32 bit result of the multiplication of var1 times var2    |
- |   with one shift left i.e.:                                               |
- |        L_mult(var1,var2) = L_shl((var1 times var2),1) and                   |
- |        L_mult(-32768,-32768) = 2147483647.                                |
- |                                                                           |
- |   Complexity weight : 1                                                   |
- |                                                                           |
- |   Inputs :                                                                |
- |                                                                           |
- |    var1                                                                   |
- |             16 bit short signed integer (Word16) whose value falls in the |
- |             range : 0xffff 8000 <= var1 <= 0x0000 7fff.                   |
- |                                                                           |
- |    var2                                                                   |
- |             16 bit short signed integer (Word16) whose value falls in the |
- |             range : 0xffff 8000 <= var1 <= 0x0000 7fff.                   |
- |                                                                           |
- |   Outputs :                                                               |
- |                                                                           |
- |    none                                                                   |
- |                                                                           |
- |   Return Value :                                                          |
- |                                                                           |
- |    L_var_out                                                              |
- |             32 bit long signed integer (Word32) whose value falls in the  |
- |             range : 0x8000 0000 <= L_var_out <= 0x7fff ffff.              |
- |___________________________________________________________________________|
-*/
-
-Word32 _L_mult (Word16 var1, Word16 var2)
-{
-    Word32 L_var_out;
-
-    L_var_out = (Word32) var1 *(Word32) var2;
-
-    if (L_var_out != (Word32) 0x40000000L)
-    {
-        L_var_out *= 2;
-    }
-    else
-    {
-        Overflow = 1;
-        L_var_out = MAX_32;
-    }
-
-#if (WMOPS)
-    multiCounter[currCounter].L_mult++;
-#endif
-    return (L_var_out);
-}
-
-/*___________________________________________________________________________
- |                                                                           |
  |   Function Name : negate                                                  |
  |                                                                           |
  |   Purpose :                                                               |
--- a/amr-wb/c4t64fx.c
+++ b/amr-wb/c4t64fx.c
@@ -97,7 +97,7 @@
                                            /* (o) : index (88): 11+11+11+11+11+11+11+11 = 88 bits.   */
 )
 {
-    Word16 i, j, k, st, ix, iy, pos, index, track, nb_pulse, nbiter;
+    Word16 i, j, k, st, ix = 0, iy = 0, pos, index, track, nb_pulse, nbiter;
     Word16 psk, ps, alpk, alp, val, k_cn, k_dn, exp;
     Word16 *p0, *p1, *p2, *p3, *psign;
     Word16 *h, *h_inv, *ptr_h1, *ptr_h2, *ptr_hf, h_shift;
--- a/amr-wb/convolve.c
+++ b/amr-wb/convolve.c
@@ -7,6 +7,7 @@
  *------------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/cor_h_x.c
+++ b/amr-wb/cor_h_x.c
@@ -7,6 +7,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "math_op.h"
 #include "count.h"
--- a/amr-wb/count.c
+++ b/amr-wb/count.c
@@ -1,7 +1,7 @@
-/***********************************************************************
+ /***********************************************************************
  *
  *   This file contains functions for the automatic complexity calculation
- * $Id: count.c,v 1.1 2007/02/15 23:22:35 robs Exp $
+ * $Id: count.c,v 1.2 2007/04/13 11:21:33 rrt Exp $
  *************************************************************************/
 
 #include <stdlib.h>
@@ -76,6 +76,7 @@
   objectName[++maxCounter]=my_strdup(objectNameArg);
   return maxCounter;
 #else
+  (void)objectNameArg;
   return 0; /* Dummy */
 #endif
 }
@@ -89,6 +90,8 @@
       return;
     }
   currCounter=counterId;
+#else
+  (void)counterId;
 #endif
 }
 
@@ -289,7 +292,8 @@
         fprintf (stdout, "  WorstWC=%.3f", ((float) tot_wc) * 0.00005);
     }
     fprintf (stdout, " (%d frames)\n", nbframe[currCounter]);
-    
+#else
+    (void)dtx_mode;
 #endif
 }
 
--- a/amr-wb/d2t64fx.c
+++ b/amr-wb/d2t64fx.c
@@ -13,6 +13,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 #include "cnst.h"
--- a/amr-wb/d4t64fx.c
+++ b/amr-wb/d4t64fx.c
@@ -19,6 +19,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 #include "cnst.h"
--- a/amr-wb/deemph.c
+++ b/amr-wb/deemph.c
@@ -8,6 +8,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "math_op.h"
 #include "count.h"
--- a/amr-wb/g_pitch.c
+++ b/amr-wb/g_pitch.c
@@ -7,6 +7,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "math_op.h"
 #include "count.h"
--- a/amr-wb/gpclip.c
+++ b/amr-wb/gpclip.c
@@ -8,6 +8,7 @@
  *-----------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/homing.c
+++ b/amr-wb/homing.c
@@ -5,6 +5,7 @@
  *------------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "main.h"
 #include "cnst.h"
 #include "basic_op.h"
 #include "bits.h"
--- a/amr-wb/isp_az.c
+++ b/amr-wb/isp_az.c
@@ -5,6 +5,7 @@
  *-----------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "oper_32b.h"
 #include "count.h"
--- a/amr-wb/isp_isf.c
+++ b/amr-wb/isp_isf.c
@@ -9,6 +9,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/lag_wind.c
+++ b/amr-wb/lag_wind.c
@@ -10,6 +10,7 @@
  *---------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "oper_32b.h"
 
--- a/amr-wb/lp_dec2.c
+++ b/amr-wb/lp_dec2.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 #include "cnst.h"
--- a/amr-wb/pit_shrp.c
+++ b/amr-wb/pit_shrp.c
@@ -5,6 +5,7 @@
  *-----------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/pred_lt4.c
+++ b/amr-wb/pred_lt4.c
@@ -9,6 +9,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/preemph.c
+++ b/amr-wb/preemph.c
@@ -7,6 +7,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/random.c
+++ b/amr-wb/random.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/residu.c
+++ b/amr-wb/residu.c
@@ -5,6 +5,7 @@
  *-----------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/scale.c
+++ b/amr-wb/scale.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/syn_filt.c
+++ b/amr-wb/syn_filt.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "math_op.h"
 #include "count.h"
--- a/amr-wb/updt_tar.c
+++ b/amr-wb/updt_tar.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/util.c
+++ b/amr-wb/util.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"
 
--- a/amr-wb/voicefac.c
+++ b/amr-wb/voicefac.c
@@ -5,6 +5,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "math_op.h"
 #include "count.h"
--- a/amr-wb/wb_vad.c
+++ b/amr-wb/wb_vad.c
@@ -38,7 +38,7 @@
 *
 */
 
-Word16 ilog2(                              /* return: output value of the log2 */
+static Word16 ilog2(                       /* return: output value of the log2 */
      Word16 mant                           /* i: value to be converted */
 )
 {
--- a/amr-wb/weight_a.c
+++ b/amr-wb/weight_a.c
@@ -6,6 +6,7 @@
  *-------------------------------------------------------------------*/
 
 #include "typedef.h"
+#include "acelp.h"
 #include "basic_op.h"
 #include "count.h"