1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2005-02-19 11:58:42 +00:00
parent 8243127dc4
commit 52e43cb6e1
9 changed files with 55 additions and 29 deletions

View file

@ -11,4 +11,6 @@ registry.c
res012.c res012.c
sharedbook.c sharedbook.c
synthesis.c synthesis.c
vorbisfile.c
window.c window.c
ctype.c

View file

@ -81,7 +81,7 @@ void oggpack_readinit(oggpack_buffer *b,ogg_reference *r){
/* Read in bits without advancing the bitptr; bits <= 32 */ /* Read in bits without advancing the bitptr; bits <= 32 */
long oggpack_look(oggpack_buffer *b,int bits){ long oggpack_look(oggpack_buffer *b,int bits){
unsigned long m=mask[bits]; unsigned long m=mask[bits];
unsigned long ret; unsigned long ret=0;
bits+=b->headbit; bits+=b->headbit;
@ -175,7 +175,7 @@ int oggpack_eop(oggpack_buffer *b){
/* bits <= 32 */ /* bits <= 32 */
long oggpack_read(oggpack_buffer *b,int bits){ long oggpack_read(oggpack_buffer *b,int bits){
unsigned long m=mask[bits]; unsigned long m=mask[bits];
ogg_uint32_t ret; ogg_uint32_t ret=0;
bits+=b->headbit; bits+=b->headbit;

View file

@ -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 BIG_ENDIAN 1
#define LITTLE_ENDIAN 0 #define LITTLE_ENDIAN 0
#define WORDS_BIGENDIAN 1 #ifdef SIMULATOR
#define BYTE_ORDER LITTLE_ENDIAN
#else
#define BYTE_ORDER BIG_ENDIAN
#endif

View file

@ -0,0 +1,22 @@
#include <ctype.h>
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
};

View file

@ -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 ampoffset,
ogg_int32_t *icos){ ogg_int32_t *icos){
(void)ln;
/* 0 <= m < 256 */ /* 0 <= m < 256 */
/* set up for using all int later */ /* 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, static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi,
vorbis_info_floor *i){ vorbis_info_floor *i){
int j; int j;
ogg_int32_t scale; // ogg_int32_t scale;
vorbis_info *vi=vd->vi; vorbis_info *vi=vd->vi;
codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; codec_setup_info *ci=(codec_setup_info *)vi->codec_setup;
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; 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){ void *memo,ogg_int32_t *out){
vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_look_floor0 *look=(vorbis_look_floor0 *)i;
vorbis_info_floor0 *info=look->vi; vorbis_info_floor0 *info=look->vi;
(void)vb;
if(memo){ if(memo){
ogg_int32_t *lsp=(ogg_int32_t *)memo; ogg_int32_t *lsp=(ogg_int32_t *)memo;
ogg_int32_t amp=lsp[look->m]; ogg_int32_t amp=lsp[look->m];

View file

@ -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)); vorbis_look_floor1 *look=(vorbis_look_floor1 *)_ogg_calloc(1,sizeof(*look));
int i,j,n=0; int i,j,n=0;
(void)vd;
(void)mi;
look->vi=info; look->vi=info;
look->n=info->postlist[1]; look->n=info->postlist[1];

View file

@ -26,6 +26,7 @@ extern "C"
#include <stdio.h> #include <stdio.h>
#include "ivorbiscodec.h" #include "ivorbiscodec.h"
#define CHUNKSIZE 1024 #define CHUNKSIZE 1024
/* The function prototypes for the callbacks are basically the same as for /* The function prototypes for the callbacks are basically the same as for
* the stdio functions fread, fseek, fclose, ftell. * the stdio functions fread, fseek, fclose, ftell.
@ -86,11 +87,11 @@ typedef struct OggVorbis_File {
} OggVorbis_File; } OggVorbis_File;
extern int ov_clear(OggVorbis_File *vf); 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, extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks); 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, extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
char *initial, long ibytes, ov_callbacks callbacks); char *initial, long ibytes, ov_callbacks callbacks);
extern int ov_test_open(OggVorbis_File *vf); extern int ov_test_open(OggVorbis_File *vf);

View file

@ -24,6 +24,14 @@
#include "asm_arm.h" #include "asm_arm.h"
/* Some prototypes that were not defined elsewhere */
#include <stdlib.h>
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 #ifndef _V_WIDE_MATH
#define _V_WIDE_MATH #define _V_WIDE_MATH

View file

@ -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 /* if, eg, 64 bit stdio is configured by default, this will build with
fseek64 */ fseek64 */
#if 0
static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){ static int _fseek64_wrap(FILE *f,ogg_int64_t off,int whence){
if(f==NULL)return(-1); if(f==NULL)return(-1);
return fseek(f,off,whence); return fseek(f,off,whence);
} }
#endif
static int _ov_open1(void *f,OggVorbis_File *vf,char *initial, static int _ov_open1(void *f,OggVorbis_File *vf,char *initial,
long ibytes, ov_callbacks callbacks){ 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); return _ov_open2(vf);
} }
#if 0
int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
ov_callbacks callbacks = { ov_callbacks callbacks = {
(size_t (*)(void *, size_t, size_t, void *)) fread, (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); return ov_open_callbacks((void *)f, vf, initial, ibytes, callbacks);
} }
#endif
/* Only partially open the vorbis file; test for Vorbisness, and load /* Only partially open the vorbis file; test for Vorbisness, and load
the headers for the first chain. Do not seek (although test for 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); return _ov_open1(f,vf,initial,ibytes,callbacks);
} }
#if 0
int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){ int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes){
ov_callbacks callbacks = { ov_callbacks callbacks = {
(size_t (*)(void *, size_t, size_t, void *)) fread, (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); return ov_test_callbacks((void *)f, vf, initial, ibytes, callbacks);
} }
#endif
int ov_test_open(OggVorbis_File *vf){ int ov_test_open(OggVorbis_File *vf){
if(vf->ready_state!=PARTOPEN)return(OV_EINVAL); 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 lastblock=0;
int accblock=0; int accblock=0;
int thisblock; int thisblock;
int eosflag; int eosflag=0;
work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */ work_os=ogg_stream_create(vf->current_serialno); /* get the memory ready */
while(1){ while(1){