summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Holmgren <magnushol@gmail.com>2005-10-17 18:46:46 +0000
committerMagnus Holmgren <magnushol@gmail.com>2005-10-17 18:46:46 +0000
commit37011258d6b0bfc28f75473505160e8b2b71fdd2 (patch)
tree267a8e8b9987822b1d307a62f23cfb8e65ab5023
parent69ffcd5356cde94ec83417455081b701b7a6b633 (diff)
downloadrockbox-37011258d6b0bfc28f75473505160e8b2b71fdd2.tar.gz
rockbox-37011258d6b0bfc28f75473505160e8b2b71fdd2.zip
iriver: more codec library cleanup: remove codec_alloca and a some extraneous defines.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7637 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/Tremor/misc.h1
-rw-r--r--apps/codecs/codec.h8
-rw-r--r--apps/codecs/lib/codeclib.c9
-rw-r--r--apps/codecs/lib/codeclib.h15
4 files changed, 1 insertions, 32 deletions
diff --git a/apps/codecs/Tremor/misc.h b/apps/codecs/Tremor/misc.h
index feaa21f9ae..81903e1b95 100644
--- a/apps/codecs/Tremor/misc.h
+++ b/apps/codecs/Tremor/misc.h
@@ -30,7 +30,6 @@
30void *_vorbis_block_alloc(vorbis_block *vb,long bytes); 30void *_vorbis_block_alloc(vorbis_block *vb,long bytes);
31void _vorbis_block_ripcord(vorbis_block *vb); 31void _vorbis_block_ripcord(vorbis_block *vb);
32extern int _ilog(unsigned int v); 32extern int _ilog(unsigned int v);
33void* alloca(size_t size);
34 33
35#ifndef _V_WIDE_MATH 34#ifndef _V_WIDE_MATH
36#define _V_WIDE_MATH 35#define _V_WIDE_MATH
diff --git a/apps/codecs/codec.h b/apps/codecs/codec.h
index f954d1bc4d..daa7c19cd7 100644
--- a/apps/codecs/codec.h
+++ b/apps/codecs/codec.h
@@ -31,19 +31,13 @@
31#define calloc(x,y) codec_calloc(x,y) 31#define calloc(x,y) codec_calloc(x,y)
32#define realloc(x,y) codec_realloc(x,y) 32#define realloc(x,y) codec_realloc(x,y)
33#define free(x) codec_free(x) 33#define free(x) codec_free(x)
34#define alloca(x) __builtin_alloca(x)
34 35
35void* codec_malloc(size_t size); 36void* codec_malloc(size_t size);
36void* codec_calloc(size_t nmemb, size_t size); 37void* codec_calloc(size_t nmemb, size_t size);
37void* codec_realloc(void* ptr, size_t size); 38void* codec_realloc(void* ptr, size_t size);
38void codec_free(void* ptr); 39void codec_free(void* ptr);
39 40
40#if !defined(SIMULATOR)
41#define alloca __builtin_alloca
42#else
43#define alloca(x) codec_alloca(x)
44void* codec_alloca(size_t size);
45#endif
46
47#define abs(x) ((x)>0?(x):-(x)) 41#define abs(x) ((x)>0?(x):-(x))
48#define labs(x) abs(x) 42#define labs(x) abs(x)
49 43
diff --git a/apps/codecs/lib/codeclib.c b/apps/codecs/lib/codeclib.c
index b9858dd412..482c5a5af1 100644
--- a/apps/codecs/lib/codeclib.c
+++ b/apps/codecs/lib/codeclib.c
@@ -75,15 +75,6 @@ void* codec_calloc(size_t nmemb, size_t size)
75 return(x); 75 return(x);
76} 76}
77 77
78#if defined(SIMULATOR)
79void* codec_alloca(size_t size)
80{
81 void* x;
82 x = codec_malloc(size);
83 return(x);
84}
85#endif
86
87void codec_free(void* ptr) { 78void codec_free(void* ptr) {
88 (void)ptr; 79 (void)ptr;
89} 80}
diff --git a/apps/codecs/lib/codeclib.h b/apps/codecs/lib/codeclib.h
index b46b44bbce..8852b47043 100644
--- a/apps/codecs/lib/codeclib.h
+++ b/apps/codecs/lib/codeclib.h
@@ -32,26 +32,11 @@ extern unsigned char* filebuf; // The rest of the MP3 buffer
32 32
33/* Standard library functions that are used by the codecs follow here */ 33/* Standard library functions that are used by the codecs follow here */
34 34
35/* Get these functions 'out of the way' of the standard functions. Not doing
36 * so confuses the cygwin linker, and maybe others. These functions need to
37 * be implemented elsewhere */
38#define malloc(x) codec_malloc(x)
39#define calloc(x,y) codec_calloc(x,y)
40#define realloc(x,y) codec_realloc(x,y)
41#define free(x) codec_free(x)
42
43void* codec_malloc(size_t size); 35void* codec_malloc(size_t size);
44void* codec_calloc(size_t nmemb, size_t size); 36void* codec_calloc(size_t nmemb, size_t size);
45void* codec_realloc(void* ptr, size_t size); 37void* codec_realloc(void* ptr, size_t size);
46void codec_free(void* ptr); 38void codec_free(void* ptr);
47 39
48#if !defined(SIMULATOR)
49#define alloca __builtin_alloca
50#else
51#define alloca(x) codec_alloca(x)
52void* codec_alloca(size_t size);
53#endif
54
55void *memcpy(void *dest, const void *src, size_t n); 40void *memcpy(void *dest, const void *src, size_t n);
56void *memset(void *s, int c, size_t n); 41void *memset(void *s, int c, size_t n);
57int memcmp(const void *s1, const void *s2, size_t n); 42int memcmp(const void *s1, const void *s2, size_t n);