From 6fabc99db825d46eadbe497c0f1c3f52510afbc8 Mon Sep 17 00:00:00 2001 From: halleyscometsw Date: Fri, 15 Feb 2008 16:26:29 +0000 Subject: [PATCH] use -Wall, address warnings git-svn-id: https://vgmstream.svn.sourceforge.net/svnroot/vgmstream@32 51a99a44-fe44-0410-b1ba-c3e57ba2b86b --- src/coding/g721_decoder.c | 13 ++++++------- src/coding/g721_decoder.h | 1 + src/meta/rsf.c | 1 - src/vgmstream.c | 3 ++- src/vgmstream.h | 7 ++----- test/Makefile | 2 +- test/test.c | 2 ++ 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/coding/g721_decoder.c b/src/coding/g721_decoder.c index f3725ee4..0150ae0a 100644 --- a/src/coding/g721_decoder.c +++ b/src/coding/g721_decoder.c @@ -69,7 +69,7 @@ fmult( int srn) { short anmag, anexp, anmant; - short wanexp, wanmag, wanmant; + short wanexp, wanmant; short retval; anmag = (an > 0) ? an : ((-an) & 0x1FFF); @@ -275,12 +275,11 @@ update( struct g72x_state *state_ptr) /* coder state pointer */ { int cnt; - short mag, exp, mant; /* Adaptive predictor, FLOAT A */ + short mag, exp; /* Adaptive predictor, FLOAT A */ short a2p; /* LIMC */ short a1ul; /* UPA1 */ - short ua2, pks1; /* UPA2 */ - short uga2a, fa1; - short uga2b; + short pks1; /* UPA2 */ + short fa1; char tr; /* tone/transition detector */ short ylint, thr2, dqthr; short ylfrac, thr1; @@ -368,11 +367,12 @@ update( /* UPA1 */ /* update predictor pole a[0] */ state_ptr->a[0] -= state_ptr->a[0] >> 8; - if (dqsez != 0) + if (dqsez != 0) { if (pks1 == 0) state_ptr->a[0] += 192; else state_ptr->a[0] -= 192; + } /* LIMD */ a1ul = 15360 - a2p; @@ -453,7 +453,6 @@ update( state_ptr->ap += (-state_ptr->ap) >> 4; } -static short qtab_721[7] = {-124, 80, 178, 246, 300, 349, 400}; /* * Maps G.721 code word to reconstructed scale factor normalized log * magnitude values. diff --git a/src/coding/g721_decoder.h b/src/coding/g721_decoder.h index a9565abc..1ea7802a 100644 --- a/src/coding/g721_decoder.h +++ b/src/coding/g721_decoder.h @@ -5,5 +5,6 @@ #include "../streamtypes.h" void decode_g721(VGMSTREAMCHANNEL * stream, sample * outbuf, int channelspacing, int32_t first_sample, int32_t samples_to_do); +void g72x_init_state(struct g72x_state *state_ptr); #endif diff --git a/src/meta/rsf.c b/src/meta/rsf.c index 76ab2ecc..df6c9e29 100644 --- a/src/meta/rsf.c +++ b/src/meta/rsf.c @@ -8,7 +8,6 @@ VGMSTREAM * init_vgmstream_rsf(const char * const filename) { VGMSTREAM * vgmstream = NULL; STREAMFILE * infile = NULL; - int i; size_t file_size; /* check extension, case insensitive */ diff --git a/src/vgmstream.c b/src/vgmstream.c index 85e841fd..bc65f377 100644 --- a/src/vgmstream.c +++ b/src/vgmstream.c @@ -10,6 +10,7 @@ #include "coding/adx_decoder.h" #include "coding/gcdsp_decoder.h" #include "coding/pcm_decoder.h" +#include "coding/ima_decoder.h" #include "coding/ngc_dtk_decoder.h" #include "coding/g721_decoder.h" @@ -286,8 +287,8 @@ int vgmstream_do_loop(VGMSTREAM * vgmstream) { /* if (vgmstream->loop_flag) {*/ /* is this the loop end? */ if (vgmstream->current_sample==vgmstream->loop_end_sample) { - int i; /* + int i; for (i=0;ichannels;i++) { vgmstream->loop_ch[i].adpcm_history1_32 = vgmstream->ch[i].adpcm_history1_32; vgmstream->loop_ch[i].adpcm_history2_32 = vgmstream->ch[i].adpcm_history2_32; diff --git a/src/vgmstream.h b/src/vgmstream.h index 030c88c5..d50084d1 100644 --- a/src/vgmstream.h +++ b/src/vgmstream.h @@ -18,14 +18,9 @@ typedef enum { coding_PCM8, /* 8-bit PCM */ /* 4-bit ADPCM */ coding_NDS_IMA, /* IMA ADPCM w/ NDS layout */ - coding_XBOX_IMA, /* IMA ADPCM w/ XBOX layout */ coding_CRI_ADX, /* CRI ADX */ coding_NGC_DSP, /* NGC ADPCM, called DSP */ - coding_NGC_AFC, /* other NGC ADPCM, called AFC */ coding_NGC_DTK, /* NGC hardware disc ADPCM, called DTK, TRK or ADP */ - coding_PS2ADPCM, /* PS2 ADPCM, sometimes called "VAG" */ - coding_EA_XA, /* Electronic Arts XA */ - coding_CD_XA, /* CD-XA */ coding_G721, /* CCITT G.721 ADPCM */ } coding_t; @@ -36,11 +31,13 @@ typedef enum { /* interleave */ layout_interleave, /* equal interleave throughout the stream */ layout_interleave_shortblock, /* interleave with a short last block */ +#if 0 layout_interleave_byte, /* full byte interleave */ /* headered blocks */ layout_halp_blocked, /* blocks with HALP-format header */ layout_ast_blocked, /* */ layout_strm_blocked, /* */ +#endif /* otherwise odd */ layout_dtk_interleave, /* dtk interleaves channels by nibble */ } layout_t; diff --git a/test/Makefile b/test/Makefile index 32265ba6..1cfd1a4b 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,5 @@ SHELL = /bin/sh -CFLAGS=-lm -O3 +CFLAGS=-lm -Wall VGMSTREAMFILES = ../src/streamfile.c ../src/vgmstream.c ../src/util.c ../src/meta/adx_header.c ../src/coding/adx_decoder.c ../src/coding/gcdsp_decoder.c ../src/meta/brstm.c ../src/layout/interleave.c ../src/layout/nolayout.c ../src/coding/pcm_decoder.c ../src/meta/nds_strm.c ../src/coding/ima_decoder.c ../src/meta/agsc.c ../src/meta/ngc_adpdtk.c ../src/coding/ngc_dtk_decoder.c ../src/coding/g721_decoder.c ../src/meta/rsf.c diff --git a/test/test.c b/test/test.c index 7c810b37..6f3db7fe 100644 --- a/test/test.c +++ b/test/test.c @@ -152,4 +152,6 @@ int main(int argc, char ** argv) { } close_vgmstream(s); + + return 0; }