diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-07-12 10:10:02 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-07-12 10:10:02 +0000 |
commit | 7ba03e627962e2f903b1c122b7b33d7ce3b7be06 (patch) | |
tree | 7b52eaf9fd5abd849a29ed96fba842ccfa497128 /apps/codecs/lib | |
parent | a19acbdadd036e0d2c1ca000661c86922f775d56 (diff) |
removed an extra codec_api struct pointer and the function setting it
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7117 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/lib')
-rw-r--r-- | apps/codecs/lib/codeclib.c | 2 | ||||
-rw-r--r-- | apps/codecs/lib/codeclib.h | 2 | ||||
-rw-r--r-- | apps/codecs/lib/xxx2wav.c | 26 |
3 files changed, 12 insertions, 18 deletions
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c index 8b814d0f25..2494fe59f1 100644 --- a/apps/codecs/lib/codeclib.c +++ b/apps/codecs/lib/codeclib.c @@ -29,8 +29,6 @@ struct codec_api *local_rb; int codec_init(struct codec_api* rb) { local_rb = rb; - - xxx2wav_set_api(rb); mem_ptr = 0; mallocbuf = (unsigned char *)rb->get_codec_memory((long *)&bufsize); diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h index 762b68dd95..77276fbae2 100644 --- a/apps/codecs/lib/codeclib.h +++ b/apps/codecs/lib/codeclib.h @@ -24,7 +24,7 @@ extern int mem_ptr; extern int bufsize; -extern unsigned char* mallocbuf; // 512K from the start of MP3 buffer +extern unsigned char* mallocbuf; /* 512K from the start of MP3 buffer */ void* codec_malloc(size_t size); void* codec_calloc(size_t nmemb, size_t size); diff --git a/apps/codecs/lib/xxx2wav.c b/apps/codecs/lib/xxx2wav.c index 8b61e3c6e7..338f1c41aa 100644 --- a/apps/codecs/lib/xxx2wav.c +++ b/apps/codecs/lib/xxx2wav.c @@ -25,7 +25,7 @@ #include "codecs.h" #include "xxx2wav.h" -static struct codec_api* local_rb; +extern struct codec_api* local_rb; int mem_ptr; int bufsize; @@ -38,7 +38,7 @@ void* codec_malloc(size_t size) void* x; x=&mallocbuf[mem_ptr]; - mem_ptr+=(size+3)&~3; // Keep memory 32-bit aligned (if it was already?) + mem_ptr+=(size+3)&~3; /* Keep memory 32-bit aligned */ return(x); } @@ -66,23 +66,23 @@ void* codec_realloc(void* ptr, size_t size) { void* x; (void)ptr; - x = codec_malloc(size); - return(x); + x = codec_malloc(size); + return(x); } void *memcpy(void *dest, const void *src, size_t n) { - return(local_rb->memcpy(dest,src,n)); + return(local_rb->memcpy(dest,src,n)); } void *memset(void *s, int c, size_t n) { - return(local_rb->memset(s,c,n)); + return(local_rb->memset(s,c,n)); } int memcmp(const void *s1, const void *s2, size_t n) { - return(local_rb->memcmp(s1,s2,n)); + return(local_rb->memcmp(s1,s2,n)); } void* memchr(const void *s, int c, size_t n) @@ -96,20 +96,16 @@ void* memmove(const void *s1, const void *s2, size_t n) char* src=(char*)s2; size_t i; - for (i=0;i<n;i++) { dest[i]=src[i]; } + for (i=0;i<n;i++) + dest[i]=src[i]; return(dest); } void qsort(void *base, size_t nmemb, size_t size, - int(*compar)(const void *, const void *)) { - local_rb->qsort(base,nmemb,size,compar); -} - - -void xxx2wav_set_api(struct codec_api* rb) + int(*compar)(const void *, const void *)) { - local_rb = rb; + local_rb->qsort(base,nmemb,size,compar); } #endif /* CONFIG_HWCODEC == MASNONE */ |