applied Thomas's patch to fix some -Wall -Werror issues, thanks Thomas
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 9 Mar 2012 00:15:42 +0000 (00:15 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Fri, 9 Mar 2012 00:15:42 +0000 (00:15 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@344 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/src/fft.c
codec2-dev/unittest/extract.c
codec2-dev/unittest/tcodec2.c
codec2-dev/unittest/tinterp.c
codec2-dev/unittest/tnlp.c
codec2-dev/unittest/vqtrain.c

index 73c46c846f460f11a491c0a9e9fa5a648e8e8c2e..df1fbcf1428e76f5e7cef5522ba2ad3b6b60b409 100644 (file)
@@ -76,7 +76,6 @@ fft (float x[], int n, int isign)
     {
       initialize_fft (n);
     }
-  int isReverse = 0;
   int c;
   for (c = 0; c < n * 2; c += 2)
     {
index dcd75df4b8b0f330e60a57745277244a1c69ea4d..36c6d6817c4cec56cca383b1f59af9edd093a464 100644 (file)
@@ -33,6 +33,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <assert.h>
 
 void scan_line(FILE *fp, float f[], int n);
 
@@ -110,8 +111,8 @@ void scan_line(FILE *fp, float f[], int n)
     char   *ps,*pe;
     int           i;
 
-    fgets(s,MAX_STR,fp);
-    ps = pe = s;
+    ps = pe = fgets(s,MAX_STR,fp); 
+    assert(ps);
     for(i=0; i<n; i++) {
        while( isspace(*pe)) pe++;
        while( !isspace(*pe)) pe++;
index bc590b78864c7a258358f5c01f29875df99ac9c2..d89669e8eb09d4d52fef35c5f9e296dd439f8f2b 100644 (file)
@@ -130,22 +130,22 @@ int test2()
        encode_lsps_scalar(lsp_indexes, lsps, LPC_ORD);
        energy_index = encode_energy(e);
        nbit = 0;
-       pack(bits, &nbit, Wo_index, WO_BITS);
+       pack((unsigned char*)bits, (unsigned *)&nbit, Wo_index, WO_BITS);
        for(i=0; i<LPC_ORD; i++) {
-           pack(bits, &nbit, lsp_indexes[i], lsp_bits(i));
+           pack((unsigned char*)bits, (unsigned *)&nbit, lsp_indexes[i], lsp_bits(i));
        }
-       pack(bits, &nbit, energy_index, E_BITS);
-       pack(bits, &nbit, voiced1, 1);
-       pack(bits, &nbit, voiced2, 1);
+       pack((unsigned char*)bits, (unsigned *)&nbit, energy_index, E_BITS);
+       pack((unsigned char*)bits, (unsigned *)&nbit, voiced1, 1);
+       pack((unsigned char*)bits, (unsigned *)&nbit, voiced2, 1);
  
        nbit = 0;
-       Wo_index = unpack(bits, &nbit, WO_BITS);
+       Wo_index = unpack((unsigned char*)bits, (unsigned *)&nbit, WO_BITS);
        for(i=0; i<LPC_ORD; i++) {
-           lsp_indexes[i] = unpack(bits, &nbit, lsp_bits(i));
+           lsp_indexes[i] = unpack((unsigned char*)bits, (unsigned *)&nbit, lsp_bits(i));
        }
-       energy_index = unpack(bits, &nbit, E_BITS);
-       voiced1 = unpack(bits, &nbit, 1);
-       voiced2 = unpack(bits, &nbit, 1);
+       energy_index = unpack((unsigned char*)bits, (unsigned *)&nbit, E_BITS);
+       voiced1 = unpack((unsigned char*)bits, (unsigned *)&nbit, 1);
+       voiced2 = unpack((unsigned char*)bits, (unsigned *)&nbit, 1);
 
        model.Wo = decode_Wo(Wo_index);
        model.L = PI/model.Wo;
index e743e6bae88ce39ae13236fb8c195c6e113bcf6f..52e782b4b777e19a4ee3dafd517ad09c83f7157b 100644 (file)
@@ -97,8 +97,9 @@ void load_amp(MODEL *model, char file[], int frame)
     f = fopen(file,"rt");
 
     for(i=0; i<frame; i++)
-       fgets(s, 1023, f);
+       ps = fgets(s, 1023, f);
 
+    /// can frame ever be 0? what if fgets fails?
     ps = s;
     ps = get_next_float(ps, &model->Wo);
     ps = get_next_int(ps, &model->L);
index 5ecff87740d5acd12167e190f1ef2a74ed90ef28..2f85f7fd7c2fe6c2e1c5b4e57b596b6b7514d097 100644 (file)
@@ -116,7 +116,8 @@ char *argv[];
     if (dump) 
       dump_on(argv[dump+1]);
 #else
-#warning "Compile with -DDUMP if you expect to dump anything."
+/// TODO
+/// #warning "Compile with -DDUMP if you expect to dump anything."
 #endif
 
     nlp_states = nlp_create();
index ef423158824215623158d9a78014877f53fbd699..dbea6f3d9381a6a60113d97a03c18b3e64c5e663 100644 (file)
@@ -37,6 +37,7 @@
 #include <string.h>
 #include <math.h>
 #include <ctype.h>
+#include <assert.h>
 
 /*-----------------------------------------------------------------------*\