summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-01-30 00:02:58 +0100
committerMarcel Holtmann <marcel@holtmann.org>2009-01-30 00:02:58 +0100
commit04adf8f0acd6c2ad0e58d94573d6430735070607 (patch)
tree7611d6ab40f94d2d00310edd8d11ddf59c120094 /sbc
parentf7c622b6c214a74a226ca85decdf5091d4b365bc (diff)
Fix SBC to compile cleanly with -Wsign-compare
Diffstat (limited to 'sbc')
-rw-r--r--sbc/Makefile.am4
-rw-r--r--sbc/sbc.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/sbc/Makefile.am b/sbc/Makefile.am
index 1f8e7f95..f8701641 100644
--- a/sbc/Makefile.am
+++ b/sbc/Makefile.am
@@ -12,8 +12,8 @@ libsbc_la_SOURCES = sbc.h sbc.c sbc_math.h sbc_tables.h \
sbc_primitives.h sbc_primitives_mmx.h sbc_primitives_neon.h \
sbc_primitives.c sbc_primitives_mmx.c sbc_primitives_neon.c
-libsbc_la_CFLAGS = -finline-functions -funswitch-loops \
- -fgcse-after-reload -funroll-loops -Wno-sign-compare
+libsbc_la_CFLAGS = -finline-functions -fgcse-after-reload \
+ -funswitch-loops -funroll-loops
noinst_PROGRAMS = sbcinfo sbcdec sbcenc $(sndfile_programs)
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 29f1d14c..29258d05 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -362,7 +362,7 @@ static void sbc_calculate_bits(const struct sbc_frame *frame, int (*bits)[8])
static int sbc_unpack_frame(const uint8_t *data, struct sbc_frame *frame,
size_t len)
{
- int consumed;
+ unsigned int consumed;
/* Will copy the parts of the header that are relevant to crc
* calculation here */
uint8_t crc_header[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@@ -794,7 +794,7 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
/* like frame->sb_sample but joint stereo */
int32_t sb_sample_j[16][2];
/* scalefactor and scale_factor in joint case */
- u_int32_t scalefactor_j[2];
+ uint32_t scalefactor_j[2];
uint8_t scale_factor_j[2];
uint8_t joint = 0;
@@ -807,6 +807,7 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
scalefactor_j[1] = 2 << SCALE_OUT_BITS;
for (blk = 0; blk < frame->blocks; blk++) {
+ uint32_t tmp;
/* Calculate joint stereo signal */
sb_sample_j[blk][0] =
ASR(frame->sb_sample_f[blk][0][sb], 1) +
@@ -816,11 +817,13 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
ASR(frame->sb_sample_f[blk][1][sb], 1);
/* calculate scale_factor_j and scalefactor_j for joint case */
- while (scalefactor_j[0] < fabs(sb_sample_j[blk][0])) {
+ tmp = fabs(sb_sample_j[blk][0]);
+ while (scalefactor_j[0] < tmp) {
scale_factor_j[0]++;
scalefactor_j[0] *= 2;
}
- while (scalefactor_j[1] < fabs(sb_sample_j[blk][1])) {
+ tmp = fabs(sb_sample_j[blk][1]);
+ while (scalefactor_j[1] < tmp) {
scale_factor_j[1]++;
scalefactor_j[1] *= 2;
}