1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Daniel Stenberg 2005-07-12 10:10:02 +00:00
parent a19acbdadd
commit 7ba03e6279
3 changed files with 12 additions and 18 deletions

View file

@ -29,8 +29,6 @@ struct codec_api *local_rb;
int codec_init(struct codec_api* rb) int codec_init(struct codec_api* rb)
{ {
local_rb = rb; local_rb = rb;
xxx2wav_set_api(rb);
mem_ptr = 0; mem_ptr = 0;
mallocbuf = (unsigned char *)rb->get_codec_memory((long *)&bufsize); mallocbuf = (unsigned char *)rb->get_codec_memory((long *)&bufsize);

View file

@ -24,7 +24,7 @@
extern int mem_ptr; extern int mem_ptr;
extern int bufsize; 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_malloc(size_t size);
void* codec_calloc(size_t nmemb, size_t size); void* codec_calloc(size_t nmemb, size_t size);

View file

@ -25,7 +25,7 @@
#include "codecs.h" #include "codecs.h"
#include "xxx2wav.h" #include "xxx2wav.h"
static struct codec_api* local_rb; extern struct codec_api* local_rb;
int mem_ptr; int mem_ptr;
int bufsize; int bufsize;
@ -38,7 +38,7 @@ void* codec_malloc(size_t size)
void* x; void* x;
x=&mallocbuf[mem_ptr]; 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); return(x);
} }
@ -66,23 +66,23 @@ void* codec_realloc(void* ptr, size_t size)
{ {
void* x; void* x;
(void)ptr; (void)ptr;
x = codec_malloc(size); x = codec_malloc(size);
return(x); return(x);
} }
void *memcpy(void *dest, const void *src, size_t n) 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) 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) 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) 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; char* src=(char*)s2;
size_t i; 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); return(dest);
} }
void qsort(void *base, size_t nmemb, size_t size, void qsort(void *base, size_t nmemb, size_t size,
int(*compar)(const void *, const void *)) { int(*compar)(const void *, const void *))
{
local_rb->qsort(base,nmemb,size,compar); local_rb->qsort(base,nmemb,size,compar);
} }
void xxx2wav_set_api(struct codec_api* rb)
{
local_rb = rb;
}
#endif /* CONFIG_HWCODEC == MASNONE */ #endif /* CONFIG_HWCODEC == MASNONE */