diff --git a/configure.ac b/configure.ac index f4e6c87c..5072dcfc 100644 --- a/configure.ac +++ b/configure.ac @@ -109,7 +109,8 @@ AC_ARG_ENABLE(static-modes, [ --enable-static-modes], fi]) if test $ac_cv_c_compiler_gnu = yes ; then - CFLAGS="$CFLAGS -fvisibility=hidden -W -Wstrict-prototypes -Wmissing-prototypes -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wno-parentheses" + CFLAGS="$CFLAGS -fvisibility=hidden -W -Wstrict-prototypes -Wall -Wextra -Wcast-align -Wnested-externs -Wshadow -Wno-parentheses -Wno-unused-parameter -Wno-sign-compare" + #CFLAGS="$CFLAGS -fvisibility=hidden -W -Wstrict-prototypes -Wmissing-prototypes -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wno-parentheses" fi AC_CHECK_SIZEOF(short) diff --git a/libcelt/quant_bands.c b/libcelt/quant_bands.c index f7e973b1..26423a43 100644 --- a/libcelt/quant_bands.c +++ b/libcelt/quant_bands.c @@ -83,10 +83,10 @@ static inline celt_word16_t amp2dB(celt_ener_t amp) static const celt_word16_t base_resolution = QCONST16(6.f,8); -static void quant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word16_t *oldEBands, int budget, ec_enc *enc) +static void quant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word16_t *oldEBands, unsigned budget, ec_enc *enc) { int i; - int bits; + unsigned bits; celt_word16_t prev = 0; celt_word16_t coef = m->ePredCoef; celt_word16_t beta; @@ -162,10 +162,10 @@ static void quant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word1 RESTORE_STACK; } -static void unquant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word16_t *oldEBands, int budget, ec_dec *dec) +static void unquant_energy_mono(const CELTMode *m, celt_ener_t *eBands, celt_word16_t *oldEBands, unsigned budget, ec_dec *dec) { int i; - int bits; + unsigned bits; celt_word16_t prev = 0; celt_word16_t coef = m->ePredCoef; /* The .7 is a heuristic */ diff --git a/libcelt/vq.c b/libcelt/vq.c index 7718bd8b..79eec66d 100644 --- a/libcelt/vq.c +++ b/libcelt/vq.c @@ -243,7 +243,6 @@ void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, const celt_norm_t * if (score>nbest[Lupdate-1]->score) { - int k; int id = Lupdate-1; struct NBest *tmp_best; @@ -376,7 +375,6 @@ void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t for (i=0;i #include "laplace.h" -int main() +int main(void) { int i; int ret = 0; diff --git a/tests/mathops-test.c b/tests/mathops-test.c index 70449138..0a541265 100644 --- a/tests/mathops-test.c +++ b/tests/mathops-test.c @@ -14,7 +14,7 @@ int ret = 0; -void testdiv() +void testdiv(void) { celt_int32_t i; for (i=-327670;i<=327670;i++) @@ -37,7 +37,7 @@ void testdiv() } } -void testsqrt() +void testsqrt(void) { celt_int32_t i; for (i=1;i<=1000000000;i++) @@ -55,7 +55,7 @@ void testsqrt() } } -int main() +int main(void) { testdiv(); testsqrt(); diff --git a/tests/rotation-test.c b/tests/rotation-test.c index 561dcc78..b66154f1 100644 --- a/tests/rotation-test.c +++ b/tests/rotation-test.c @@ -39,7 +39,7 @@ void test_rotation(int N, int K) ret = 1; } -int main() +int main(void) { test_rotation(15, 3); test_rotation(23, 5); diff --git a/tests/type-test.c b/tests/type-test.c index 792b155f..47a676eb 100644 --- a/tests/type-test.c +++ b/tests/type-test.c @@ -5,7 +5,7 @@ #include "celt_types.h" #include -int main() +int main(void) { celt_int16_t i = 1; i <<= 14; diff --git a/tools/celtdec.c b/tools/celtdec.c index d24b0608..4a184610 100644 --- a/tools/celtdec.c +++ b/tools/celtdec.c @@ -247,7 +247,7 @@ FILE *out_file_open(char *outFile, int rate, int *channels) return fout; } -void usage() +void usage(void) { printf ("Usage: celtdec [options] input_file.spx [output_file]\n"); printf ("\n"); @@ -274,13 +274,13 @@ void usage() printf ("\n"); } -void version() +void version(void) { printf ("celtenc (CELT encoder)\n"); printf ("Copyright (C) 2008 Jean-Marc Valin\n"); } -void version_short() +void version_short(void) { printf ("celtenc (CELT encoder)\n"); printf ("Copyright (C) 2008 Jean-Marc Valin\n"); @@ -291,7 +291,7 @@ static CELTDecoder *process_header(ogg_packet *op, celt_int32_t enh_enabled, cel CELTDecoder *st; CELTHeader header; - celt_header_from_packet((char*)op->packet, op->bytes, &header); + celt_header_from_packet(op->packet, op->bytes, &header); if (header.nb_channels>2 || header.nb_channels<1) { @@ -348,7 +348,6 @@ int main(int argc, char **argv) int frame_size=0, granule_frame_size=0; void *st=NULL; CELTMode *mode=NULL; - unsigned char bits[1000]; int packet_count=0; int stream_init = 0; int quiet = 0; @@ -382,7 +381,7 @@ int main(int argc, char **argv) int rate=0; int extra_headers=0; int wav_format=0; - int lookahead; + int lookahead=0; int celt_serialno = -1; int firstpacket = 1; @@ -487,7 +486,7 @@ int main(int argc, char **argv) while (1) { char *data; - int i, j, nb_read; + int i, nb_read; /*Get the ogg buffer for writing*/ data = ogg_sync_buffer(&oy, 200); /*Read bitstream from input file*/ diff --git a/tools/celtenc.c b/tools/celtenc.c index 2ba5ccb8..1831c4a8 100644 --- a/tools/celtenc.c +++ b/tools/celtenc.c @@ -182,19 +182,19 @@ void add_fisbone_packet (ogg_stream_state *os, celt_int32_t serialno, CELTHeader add_fisbone_to_stream(os, &fp); } -void version() +void version(void) { printf ("celtenc (CELT encoder)\n"); printf ("Copyright (C) 2008 Jean-Marc Valin\n"); } -void version_short() +void version_short(void) { printf ("celtenc (CELT encoder)\n"); printf ("Copyright (C) 2008 Jean-Marc Valin\n"); } -void usage() +void usage(void) { printf ("Usage: celtenc [options] input_file output_file\n"); printf ("\n");