Commit 679f5cc6 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

Enabling warnings and restricting symbol visibility

parent 92518982
......@@ -5,7 +5,7 @@ AC_INIT(libcelt/arch.h)
AM_CONFIG_HEADER([config.h])
CELT_MAJOR_VERSION=0
CELT_MINOR_VERSION=2
CELT_MINOR_VERSION=3
CELT_MICRO_VERSION=0
CELT_EXTRA_VERSION=
CELT_VERSION=$CELT_MAJOR_VERSION.$CELT_MINOR_VERSION.$CELT_MICRO_VERSION$CELT_EXTRA_VERSION
......@@ -108,6 +108,9 @@ AC_ARG_ENABLE(static-modes, [ --enable-static-modes],
AC_DEFINE([STATIC_MODES], , [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"
fi
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
......
......@@ -140,7 +140,7 @@ void EXPORT celt_encoder_destroy(CELTEncoder *st)
celt_free(st);
}
inline celt_int16_t SIG2INT16(celt_sig_t x)
static inline celt_int16_t SIG2INT16(celt_sig_t x)
{
x = PSHR32(x, SIG_SHIFT);
if (x>32767)
......@@ -155,7 +155,7 @@ inline celt_int16_t SIG2INT16(celt_sig_t x)
}
/** Apply window and compute the MDCT for all sub-frames and all channels in a frame */
static celt_word32_t compute_mdcts(const mdct_lookup *mdct_lookup, const celt_word16_t *window, celt_sig_t *in, celt_sig_t *out, int N, int overlap, int B, int C)
static celt_word32_t compute_mdcts(const mdct_lookup *lookup, const celt_word16_t *window, celt_sig_t *in, celt_sig_t *out, int N, int overlap, int B, int C)
{
int i, c, N4;
celt_word32_t E = 0;
......@@ -184,7 +184,7 @@ static celt_word32_t compute_mdcts(const mdct_lookup *mdct_lookup, const celt_wo
}
for (j=0;j<2*N;j++)
E += MULT16_16(EXTRACT16(SHR32(x[j],SIG_SHIFT+4)),EXTRACT16(SHR32(x[j],SIG_SHIFT+4)));
mdct_forward(mdct_lookup, x, tmp);
mdct_forward(lookup, x, tmp);
/* Interleaving the sub-frames */
for (j=0;j<N;j++)
out[C*B*j+C*i+c] = tmp[j];
......@@ -195,7 +195,7 @@ static celt_word32_t compute_mdcts(const mdct_lookup *mdct_lookup, const celt_wo
}
/** Compute the IMDCT and apply window for all sub-frames and all channels in a frame */
static void compute_inv_mdcts(const mdct_lookup *mdct_lookup, const celt_word16_t *window, celt_sig_t *X, celt_sig_t *out_mem, celt_sig_t *mdct_overlap, int N, int overlap, int B, int C)
static void compute_inv_mdcts(const mdct_lookup *lookup, const celt_word16_t *window, celt_sig_t *X, celt_sig_t *out_mem, celt_sig_t *mdct_overlap, int N, int overlap, int B, int C)
{
int i, c, N4;
VARDECL(celt_word32_t, x);
......@@ -212,7 +212,7 @@ static void compute_inv_mdcts(const mdct_lookup *mdct_lookup, const celt_word16_
/* De-interleaving the sub-frames */
for (j=0;j<N;j++)
tmp[j] = X[C*B*j+C*i+c];
mdct_backward(mdct_lookup, tmp, x);
mdct_backward(lookup, tmp, x);
/* The first and last part would need to be set to zero if we actually
wanted to use them. */
for (j=0;j<overlap;j++)
......
......@@ -152,7 +152,7 @@ void compute_alloc_cache(CELTMode *m)
#endif /* !STATIC_MODES */
int bits2pulses(const CELTMode *m, int band, int bits)
static int bits2pulses(const CELTMode *m, int band, int bits)
{
int lo, hi;
lo = 0;
......@@ -172,7 +172,7 @@ int bits2pulses(const CELTMode *m, int band, int bits)
return hi;
}
int vec_bits2pulses(const CELTMode *m, int *bits, int *pulses, int len)
static int vec_bits2pulses(const CELTMode *m, int *bits, int *pulses, int len)
{
int i;
int sum=0;
......@@ -186,7 +186,7 @@ int vec_bits2pulses(const CELTMode *m, int *bits, int *pulses, int len)
return sum;
}
int interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int *pulses, int len)
static int interp_bits2pulses(const CELTMode *m, int *bits1, int *bits2, int total, int *pulses, int len)
{
int lo, hi, out;
int j;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment