summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-02-19 11:58:42 +0000
committerDave Chapman <dave@dchapman.com>2005-02-19 11:58:42 +0000
commit52e43cb6e164627993dc1ef4edc0eeb0bd7f21dd (patch)
tree4f8b08fd31701c49205dbb59daefe6aa61476567
parent8243127dc4986bbd3225cb090fcc0c290fb87937 (diff)
downloadrockbox-52e43cb6e164627993dc1ef4edc0eeb0bd7f21dd.tar.gz
rockbox-52e43cb6e164627993dc1ef4edc0eeb0bd7f21dd.zip
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
-rw-r--r--apps/codecs/Tremor/SOURCES2
-rw-r--r--apps/codecs/Tremor/bitwise.c4
-rw-r--r--apps/codecs/Tremor/config.h27
-rw-r--r--apps/codecs/Tremor/ctype.c22
-rw-r--r--apps/codecs/Tremor/floor0.c6
-rw-r--r--apps/codecs/Tremor/floor1.c2
-rw-r--r--apps/codecs/Tremor/ivorbisfile.h5
-rw-r--r--apps/codecs/Tremor/misc.h8
-rw-r--r--apps/codecs/Tremor/vorbisfile.c8
9 files changed, 55 insertions, 29 deletions
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
11res012.c 11res012.c
12sharedbook.c 12sharedbook.c
13synthesis.c 13synthesis.c
14vorbisfile.c
14window.c 15window.c
16ctype.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){
81/* Read in bits without advancing the bitptr; bits <= 32 */ 81/* Read in bits without advancing the bitptr; bits <= 32 */
82long oggpack_look(oggpack_buffer *b,int bits){ 82long oggpack_look(oggpack_buffer *b,int bits){
83 unsigned long m=mask[bits]; 83 unsigned long m=mask[bits];
84 unsigned long ret; 84 unsigned long ret=0;
85 85
86 bits+=b->headbit; 86 bits+=b->headbit;
87 87
@@ -175,7 +175,7 @@ int oggpack_eop(oggpack_buffer *b){
175/* bits <= 32 */ 175/* bits <= 32 */
176long oggpack_read(oggpack_buffer *b,int bits){ 176long oggpack_read(oggpack_buffer *b,int bits){
177 unsigned long m=mask[bits]; 177 unsigned long m=mask[bits];
178 ogg_uint32_t ret; 178 ogg_uint32_t ret=0;
179 179
180 bits+=b->headbit; 180 bits+=b->headbit;
181 181
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 @@
1/* a52dec profiling */
2/* #undef A52DEC_GPROF */
3
4/* Define to 1 if you have the `memalign' function. */
5/* #undef HAVE_MEMALIGN 1 */
6
7/* liba52 djbfft support */
8/* #undef LIBA52_DJBFFT */
9
10/* a52 sample precision */
11/* #undef LIBA52_DOUBLE */
12
13/* use fixed-point arithmetic */
14#define LIBA52_FIXED
15
16
17/* Define to 1 if your processor stores words with the most significant byte
18 first (like Motorola and SPARC, unlike Intel and VAX). */
19
20/* Used in bitstream.h */
21#define BYTE_ORDER 1
22#define BIG_ENDIAN 1 1#define BIG_ENDIAN 1
23#define LITTLE_ENDIAN 0 2#define LITTLE_ENDIAN 0
24 3
25#define WORDS_BIGENDIAN 1 4#ifdef SIMULATOR
5 #define BYTE_ORDER LITTLE_ENDIAN
6#else
7 #define BYTE_ORDER BIG_ENDIAN
8#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 @@
1#include <ctype.h>
2
3const char _ctype_[257]={
4 0,
5 _C, _C, _C, _C, _C, _C, _C, _C,
6 _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C,
7 _C, _C, _C, _C, _C, _C, _C, _C,
8 _C, _C, _C, _C, _C, _C, _C, _C,
9 _S|_B, _P, _P, _P, _P, _P, _P, _P,
10 _P, _P, _P, _P, _P, _P, _P, _P,
11 _N, _N, _N, _N, _N, _N, _N, _N,
12 _N, _N, _P, _P, _P, _P, _P, _P,
13 _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U,
14 _U, _U, _U, _U, _U, _U, _U, _U,
15 _U, _U, _U, _U, _U, _U, _U, _U,
16 _U, _U, _U, _P, _P, _P, _P, _P,
17 _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L,
18 _L, _L, _L, _L, _L, _L, _L, _L,
19 _L, _L, _L, _L, _L, _L, _L, _L,
20 _L, _L, _L, _P, _P, _P, _P, _C
21};
22
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,
139 ogg_int32_t ampoffset, 139 ogg_int32_t ampoffset,
140 ogg_int32_t *icos){ 140 ogg_int32_t *icos){
141 141
142 (void)ln;
142 /* 0 <= m < 256 */ 143 /* 0 <= m < 256 */
143 144
144 /* set up for using all int later */ 145 /* set up for using all int later */
@@ -343,7 +344,7 @@ static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){
343static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi, 344static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
344 vorbis_info_floor *i){ 345 vorbis_info_floor *i){
345 int j; 346 int j;
346 ogg_int32_t scale; 347 // ogg_int32_t scale;
347 vorbis_info *vi=vd->vi; 348 vorbis_info *vi=vd->vi;
348 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; 349 codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
349 vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; 350 vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
@@ -413,7 +414,8 @@ static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i,
413 void *memo,ogg_int32_t *out){ 414 void *memo,ogg_int32_t *out){
414 vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; 415 vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
415 vorbis_info_floor0 *info=look->vi; 416 vorbis_info_floor0 *info=look->vi;
416 417 (void)vb;
418
417 if(memo){ 419 if(memo){
418 ogg_int32_t *lsp=(ogg_int32_t *)memo; 420 ogg_int32_t *lsp=(ogg_int32_t *)memo;
419 ogg_int32_t amp=lsp[look->m]; 421 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,
129 vorbis_look_floor1 *look=(vorbis_look_floor1 *)_ogg_calloc(1,sizeof(*look)); 129 vorbis_look_floor1 *look=(vorbis_look_floor1 *)_ogg_calloc(1,sizeof(*look));
130 int i,j,n=0; 130 int i,j,n=0;
131 131
132 (void)vd;
133 (void)mi;
132 look->vi=info; 134 look->vi=info;
133 look->n=info->postlist[1]; 135 look->n=info->postlist[1];
134 136
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"
26#include <stdio.h> 26#include <stdio.h>
27#include "ivorbiscodec.h" 27#include "ivorbiscodec.h"
28 28
29
29#define CHUNKSIZE 1024 30#define CHUNKSIZE 1024
30/* The function prototypes for the callbacks are basically the same as for 31/* The function prototypes for the callbacks are basically the same as for
31 * the stdio functions fread, fseek, fclose, ftell. 32 * the stdio functions fread, fseek, fclose, ftell.
@@ -86,11 +87,11 @@ typedef struct OggVorbis_File {
86} OggVorbis_File; 87} OggVorbis_File;
87 88
88extern int ov_clear(OggVorbis_File *vf); 89extern int ov_clear(OggVorbis_File *vf);
89extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); 90 //extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
90extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf, 91extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
91 char *initial, long ibytes, ov_callbacks callbacks); 92 char *initial, long ibytes, ov_callbacks callbacks);
92 93
93extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes); 94 //extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
94extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf, 95extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
95 char *initial, long ibytes, ov_callbacks callbacks); 96 char *initial, long ibytes, ov_callbacks callbacks);
96extern int ov_test_open(OggVorbis_File *vf); 97extern 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 @@
24 24
25#include "asm_arm.h" 25#include "asm_arm.h"
26 26
27
28/* Some prototypes that were not defined elsewhere */
29#include <stdlib.h>
30void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
31void _vorbis_block_ripcord(vorbis_block *vb);
32extern int _ilog(unsigned int v);
33void* alloca(size_t size);
34
27#ifndef _V_WIDE_MATH 35#ifndef _V_WIDE_MATH
28#define _V_WIDE_MATH 36#define _V_WIDE_MATH
29 37
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,
657 657
658/* if, eg, 64 bit stdio is configured by default, this will build with 658/* if, eg, 64 bit stdio is configured by default, this will build with
659 fseek64 */ 659 fseek64 */
660#if 0
660static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ 661static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
661 if(f==NULL)return(-1); 662 if(f==NULL)return(-1);
662 return fseek(f,off,whence); 663 return fseek(f,off,whence);
663} 664}
665#endif
664 666
665static int _ov_open1(void *f,OggVorbis_File *vf,char *initial, 667static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
666 long ibytes, ov_callbacks callbacks){ 668 long ibytes, ov_callbacks callbacks){
@@ -764,6 +766,7 @@ int ov_open_callbacks(void *f,OggVorbis_File *vf,char *initial,long ibytes,
764 return _ov_open2(vf); 766 return _ov_open2(vf);
765} 767}
766 768
769#if 0
767int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ 770int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
768 ov_callbacks callbacks = { 771 ov_callbacks callbacks = {
769 (size_t (*)(void *, size_t, size_t, void *)) fread, 772 (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){
774 777
775 return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks); 778 return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
776} 779}
780#endif
777 781
778/* Only partially open the vorbis file; test for Vorbisness, and load 782/* Only partially open the vorbis file; test for Vorbisness, and load
779 the headers for the first chain. Do not seek (although test for 783 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,
786 return _ov_open1(f,vf,initial,ibytes,callbacks); 790 return _ov_open1(f,vf,initial,ibytes,callbacks);
787} 791}
788 792
793#if 0
789int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ 794int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
790 ov_callbacks callbacks = { 795 ov_callbacks callbacks = {
791 (size_t (*)(void *, size_t, size_t, void *)) fread, 796 (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){
796 801
797 return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks); 802 return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
798} 803}
804#endif
799 805
800int ov_test_open(OggVorbis_File *vf){ 806int ov_test_open(OggVorbis_File *vf){
801 if(vf->ready_state!=PARTOPEN)return(OV_EINVAL); 807 if(vf->ready_state!=PARTOPEN)return(OV_EINVAL);
@@ -988,7 +994,7 @@ int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos){
988 int lastblock=0; 994 int lastblock=0;
989 int accblock=0; 995 int accblock=0;
990 int thisblock; 996 int thisblock;
991 int eosflag; 997 int eosflag=0;
992 998
993 work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */ 999 work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */
994 while(1){ 1000 while(1){