drowe67 / LPCNet

Experimental Neural Net speech coding for FreeDV
BSD 3-Clause "New" or "Revised" License
68 stars 25 forks source link

Clean up warnings encountered during Windows and macOS builds. #55

Open tmiw opened 1 year ago

tmiw commented 1 year ago

This PR cleans up the following warnings:

/home/mooneer/freedv-gui/build_win_x86_64/LPCNet_src/src/lpcnet.c:149:16: warning: variable 'count' set but not used [-Wunused-but-set-variable]
    static int count = 0;
               ^
1 warning generated.

/home/mooneer/freedv-gui/build_win_x86_64/LPCNet_src/src/lpcnet_enc.c:150:9: warning: variable 'f' set but not used [-Wunused-but-set-variable]
    int f=0;
        ^
1 warning generated.

The following warnings are still appearing as of this PR. I'm not sure how to fix those yet (if we can), so feedback is appreciated:

/Users/mooneer/devel/LPCNet/src/pitch.c:229:37: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction]
   celt_assert((((unsigned char *)_x-(unsigned char *)NULL)&3)==0);
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mooneer/devel/LPCNet/src/arch.h:63:34: note: expanded from macro 'celt_assert'
#define celt_assert(cond) {if (!(cond)) {celt_fatal("assertion failed: " #cond);}}
                                 ^~~~
1 warning generated
/Users/mooneer/devel/LPCNet/src/from_codec2/sine.c:406:57: warning: unused parameter 'W' [-Wunused-parameter]
void estimate_amplitudes(MODEL *model, COMP Sw[], float W[], int est_phase)
                                                        ^
1 warning generated.
/Users/mooneer/devel/LPCNet/src/from_codec2/nlp.c:255:10: warning: unused parameter 'Sw' [-Wunused-parameter]
  COMP   Sw[],                  /* Freq domain version of Sn[]                        */
         ^
/Users/mooneer/devel/LPCNet/src/from_codec2/nlp.c:256:10: warning: unused parameter 'W' [-Wunused-parameter]
  float  W[],                   /* Freq domain window                                 */
         ^
/Users/mooneer/devel/LPCNet/src/from_codec2/nlp.c:431:10: warning: unused parameter 'pmin' [-Wunused-parameter]
                                 int pmin, int pmax, float gmax, int gmax_bin,
                                     ^
3 warnings generated.