From 52e43cb6e164627993dc1ef4edc0eeb0bd7f21dd Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Sat, 19 Feb 2005 11:58:42 +0000 Subject: Cosmetic changes to remove compiler warnings and compile cleanly under Rockbox git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6015 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/Tremor/SOURCES | 2 ++ apps/codecs/Tremor/bitwise.c | 4 ++-- apps/codecs/Tremor/config.h | 27 +++++---------------------- apps/codecs/Tremor/ctype.c | 22 ++++++++++++++++++++++ apps/codecs/Tremor/floor0.c | 6 ++++-- apps/codecs/Tremor/floor1.c | 2 ++ apps/codecs/Tremor/ivorbisfile.h | 5 +++-- apps/codecs/Tremor/misc.h | 8 ++++++++ apps/codecs/Tremor/vorbisfile.c | 8 +++++++- 9 files changed, 55 insertions(+), 29 deletions(-) create mode 100644 apps/codecs/Tremor/ctype.c (limited to 'apps') diff --git a/apps/codecs/Tremor/SOURCES b/apps/codecs/Tremor/SOURCES index dabb5ebf8b..51b54cf6cd 100644 --- a/apps/codecs/Tremor/SOURCES +++ b/apps/codecs/Tremor/SOURCES @@ -11,4 +11,6 @@ registry.c res012.c sharedbook.c synthesis.c +vorbisfile.c window.c +ctype.c diff --git a/apps/codecs/Tremor/bitwise.c b/apps/codecs/Tremor/bitwise.c index ccb82b0f3f..6215b0f5ac 100644 --- a/apps/codecs/Tremor/bitwise.c +++ b/apps/codecs/Tremor/bitwise.c @@ -81,7 +81,7 @@ void oggpack_readinit(oggpack_buffer *b,ogg_reference *r){ /* Read in bits without advancing the bitptr; bits <= 32 */ long oggpack_look(oggpack_buffer *b,int bits){ unsigned long m=mask[bits]; - unsigned long ret; + unsigned long ret=0; bits+=b->headbit; @@ -175,7 +175,7 @@ int oggpack_eop(oggpack_buffer *b){ /* bits <= 32 */ long oggpack_read(oggpack_buffer *b,int bits){ unsigned long m=mask[bits]; - ogg_uint32_t ret; + ogg_uint32_t ret=0; bits+=b->headbit; diff --git a/apps/codecs/Tremor/config.h b/apps/codecs/Tremor/config.h index 950412234a..feb9b152be 100644 --- a/apps/codecs/Tremor/config.h +++ b/apps/codecs/Tremor/config.h @@ -1,25 +1,8 @@ -/* a52dec profiling */ -/* #undef A52DEC_GPROF */ - -/* Define to 1 if you have the `memalign' function. */ -/* #undef HAVE_MEMALIGN 1 */ - -/* liba52 djbfft support */ -/* #undef LIBA52_DJBFFT */ - -/* a52 sample precision */ -/* #undef LIBA52_DOUBLE */ - -/* use fixed-point arithmetic */ -#define LIBA52_FIXED - - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ - -/* Used in bitstream.h */ -#define BYTE_ORDER 1 #define BIG_ENDIAN 1 #define LITTLE_ENDIAN 0 -#define WORDS_BIGENDIAN 1 +#ifdef SIMULATOR + #define BYTE_ORDER LITTLE_ENDIAN +#else + #define BYTE_ORDER BIG_ENDIAN +#endif diff --git a/apps/codecs/Tremor/ctype.c b/apps/codecs/Tremor/ctype.c new file mode 100644 index 0000000000..651dacda86 --- /dev/null +++ b/apps/codecs/Tremor/ctype.c @@ -0,0 +1,22 @@ +#include + +const char _ctype_[257]={ + 0, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _S|_B, _P, _P, _P, _P, _P, _P, _P, + _P, _P, _P, _P, _P, _P, _P, _P, + _N, _N, _N, _N, _N, _N, _N, _N, + _N, _N, _P, _P, _P, _P, _P, _P, + _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _P, _P, _P, _P, _P, + _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _P, _P, _P, _P, _C +}; + diff --git a/apps/codecs/Tremor/floor0.c b/apps/codecs/Tremor/floor0.c index 3ed57a561a..4ba232edd8 100644 --- a/apps/codecs/Tremor/floor0.c +++ b/apps/codecs/Tremor/floor0.c @@ -139,6 +139,7 @@ void vorbis_lsp_to_curve(ogg_int32_t *curve,int *map,int n,int ln, ogg_int32_t ampoffset, ogg_int32_t *icos){ + (void)ln; /* 0 <= m < 256 */ /* set up for using all int later */ @@ -343,7 +344,7 @@ static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){ static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi, vorbis_info_floor *i){ int j; - ogg_int32_t scale; + // ogg_int32_t scale; vorbis_info *vi=vd->vi; codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; @@ -413,7 +414,8 @@ static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i, void *memo,ogg_int32_t *out){ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_info_floor0 *info=look->vi; - + (void)vb; + if(memo){ ogg_int32_t *lsp=(ogg_int32_t *)memo; ogg_int32_t amp=lsp[look->m]; diff --git a/apps/codecs/Tremor/floor1.c b/apps/codecs/Tremor/floor1.c index 21dd5bef79..fecdc8770c 100644 --- a/apps/codecs/Tremor/floor1.c +++ b/apps/codecs/Tremor/floor1.c @@ -129,6 +129,8 @@ static vorbis_look_floor *floor1_look(vorbis_dsp_state *vd,vorbis_info_mode *mi, vorbis_look_floor1 *look=(vorbis_look_floor1 *)_ogg_calloc(1,sizeof(*look)); int i,j,n=0; + (void)vd; + (void)mi; look->vi=info; look->n=info->postlist[1]; diff --git a/apps/codecs/Tremor/ivorbisfile.h b/apps/codecs/Tremor/ivorbisfile.h index dd773788a1..1ec0f7428b 100644 --- a/apps/codecs/Tremor/ivorbisfile.h +++ b/apps/codecs/Tremor/ivorbisfile.h @@ -26,6 +26,7 @@ extern "C" #include #include "ivorbiscodec.h" + #define CHUNKSIZE 1024 /* The function prototypes for the callbacks are basically the same as for * the stdio functions fread, fseek, fclose, ftell. @@ -86,11 +87,11 @@ typedef struct OggVorbis_File { } OggVorbis_File; extern int ov_clear(OggVorbis_File *vf); -extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); + //extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); -extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); + //extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, char *initial, long ibytes, ov_callbacks callbacks); extern int ov_test_open(OggVorbis_File *vf); diff --git a/apps/codecs/Tremor/misc.h b/apps/codecs/Tremor/misc.h index ffa9c42f1b..6fff34e5aa 100644 --- a/apps/codecs/Tremor/misc.h +++ b/apps/codecs/Tremor/misc.h @@ -24,6 +24,14 @@ #include "asm_arm.h" + +/* Some prototypes that were not defined elsewhere */ +#include +void *_vorbis_block_alloc(vorbis_block *vb,long bytes); +void _vorbis_block_ripcord(vorbis_block *vb); +extern int _ilog(unsigned int v); +void* alloca(size_t size); + #ifndef _V_WIDE_MATH #define _V_WIDE_MATH diff --git a/apps/codecs/Tremor/vorbisfile.c b/apps/codecs/Tremor/vorbisfile.c index 7448b1ed1d..7b9913b881 100644 --- a/apps/codecs/Tremor/vorbisfile.c +++ b/apps/codecs/Tremor/vorbisfile.c @@ -657,10 +657,12 @@ static int _fetch_and_process_packet(OggVorbis_File *vf, /* if, eg, 64 bit stdio is configured by default, this will build with fseek64 */ +#if 0 static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ if(f==NULL)return(-1); return fseek(f,off,whence); } +#endif static int _ov_open1(void *f,OggVorbis_File *vf,char *initial, long ibytes, ov_callbacks callbacks){ @@ -764,6 +766,7 @@ int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes, return _ov_open2(vf); } +#if 0 int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ ov_callbacks callbacks = { (size_t (*)(void *, size_t, size_t, void *)) fread, @@ -774,6 +777,7 @@ int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks); } +#endif /* Only partially open the vorbis file; test for Vorbisness, and load the headers for the first chain. Do not seek (although test for @@ -786,6 +790,7 @@ int ov_test_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes, return _ov_open1(f,vf,initial,ibytes,callbacks); } +#if 0 int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ ov_callbacks callbacks = { (size_t (*)(void *, size_t, size_t, void *)) fread, @@ -796,6 +801,7 @@ int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks); } +#endif int ov_test_open(OggVorbis_File *vf){ if(vf->ready_state!=PARTOPEN)return(OV_EINVAL); @@ -988,7 +994,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){ int lastblock=0; int accblock=0; int thisblock; - int eosflag; + int eosflag=0; work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */ while(1){ -- cgit v1.2.3