summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-12-02 21:20:30 +0000
committerThomas Martitz <kugel@rockbox.org>2010-12-02 21:20:30 +0000
commit921ac8d6dde6df60cce9346232762794fb9efa05 (patch)
tree7f33290eb2d388aa7ed49e4a4d362da1abb8492f
parent589d2110dc6d7d1104554062ac5f01246c7f8acf (diff)
downloadrockbox-921ac8d6dde6df60cce9346232762794fb9efa05.tar.gz
rockbox-921ac8d6dde6df60cce9346232762794fb9efa05.zip
Change the gcc options for sdl builds to allow for gnu99 features, it needs some fixes in other places. Fixes test_mem compilation failure on cygwin.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28723 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/doom/z_zone.c2
-rw-r--r--apps/plugins/mp3_encoder.c2
-rw-r--r--apps/plugins/test_disk.c2
-rw-r--r--apps/plugins/test_mem.c4
-rw-r--r--firmware/libc/sscanf.c17
-rw-r--r--firmware/target/hosted/sdl/thread-sdl.c4
-rwxr-xr-xtools/configure3
7 files changed, 11 insertions, 23 deletions
diff --git a/apps/plugins/doom/z_zone.c b/apps/plugins/doom/z_zone.c
index 1d0ac5b7c8..adf17a7ee0 100644
--- a/apps/plugins/doom/z_zone.c
+++ b/apps/plugins/doom/z_zone.c
@@ -248,7 +248,7 @@ void Z_Init(void)
248 248
249 zonebase_size=size; 249 zonebase_size=size;
250 250
251 printf("Z_Init: Allocated %dKb zone memory\n", (long unsigned)size >> 10); 251 printf("Z_Init: Allocated %uldKb zone memory\n", (long unsigned)(size >> 10));
252 252
253 // Align on cache boundary 253 // Align on cache boundary
254 254
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index c0b0252e14..bdfb4d8cdd 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -903,7 +903,7 @@ int read_samples(uint32_t *buffer, int num_samples)
903 return samples; 903 return samples;
904} 904}
905 905
906inline uint32_t myswap32(uint32_t val) 906static inline uint32_t myswap32(uint32_t val)
907{ 907{
908 const uint8_t* v = (const uint8_t*)&val; 908 const uint8_t* v = (const uint8_t*)&val;
909 909
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index afb25da8d8..dd0758aec9 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -434,7 +434,7 @@ enum plugin_status plugin_start(const void* parameter)
434 434
435 audiobuf = rb->plugin_get_audio_buffer(&audiobuflen); 435 audiobuf = rb->plugin_get_audio_buffer(&audiobuflen);
436 /* align start and length to 32 bit */ 436 /* align start and length to 32 bit */
437 align = (-(int)audiobuf) & 3; 437 align = (-(intptr_t)audiobuf) & 3;
438 audiobuf += align; 438 audiobuf += align;
439 audiobuflen = (audiobuflen - align) & ~3; 439 audiobuflen = (audiobuflen - align) & ~3;
440 440
diff --git a/apps/plugins/test_mem.c b/apps/plugins/test_mem.c
index 0d9729f96b..2530982ca5 100644
--- a/apps/plugins/test_mem.c
+++ b/apps/plugins/test_mem.c
@@ -188,7 +188,9 @@ enum plugin_status plugin_start(const void* parameter)
188{ 188{
189 (void)parameter; 189 (void)parameter;
190 bool done = false; 190 bool done = false;
191#ifdef HAVE_ADJUSTABLE_CPU_FREQ
191 bool boost = false; 192 bool boost = false;
193#endif
192 int count = 0; 194 int count = 0;
193 195
194#ifdef HAVE_LCD_BITMAP 196#ifdef HAVE_LCD_BITMAP
@@ -204,7 +206,7 @@ enum plugin_status plugin_start(const void* parameter)
204 line = 0; 206 line = 0;
205 int ret; 207 int ret;
206 rb->screens[0]->clear_display(); 208 rb->screens[0]->clear_display();
207#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 209#ifdef HAVE_ADJUSTABLE_CPU_FREQ
208 TEST_MEM_PRINTF("%s", boost?"boosted":"unboosted"); 210 TEST_MEM_PRINTF("%s", boost?"boosted":"unboosted");
209 TEST_MEM_PRINTF("clock: %d Hz", *rb->cpu_frequency); 211 TEST_MEM_PRINTF("clock: %d Hz", *rb->cpu_frequency);
210#endif 212#endif
diff --git a/firmware/libc/sscanf.c b/firmware/libc/sscanf.c
index 5fbe81f3e0..5bb08d8268 100644
--- a/firmware/libc/sscanf.c
+++ b/firmware/libc/sscanf.c
@@ -1,22 +1,7 @@
1#include <stdarg.h> 1#include <stdarg.h>
2#include <string.h> 2#include <string.h>
3#include <stdbool.h> 3#include <stdbool.h>
4 4#include <ctype.h>
5static inline bool isspace(char c)
6{
7 return (c == ' ') || (c == '\t') || (c == '\n');
8}
9
10static inline bool isdigit(char c)
11{
12 return (c >= '0') && (c <= '9');
13}
14
15static inline bool isxdigit(char c)
16{
17 return ((c >= '0') && (c <= '9'))
18 || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'));
19}
20 5
21static int parse_dec(int (*peek)(void *userp), 6static int parse_dec(int (*peek)(void *userp),
22 void (*pop)(void *userp), 7 void (*pop)(void *userp),
diff --git a/firmware/target/hosted/sdl/thread-sdl.c b/firmware/target/hosted/sdl/thread-sdl.c
index 1a683911d7..83f1d1960d 100644
--- a/firmware/target/hosted/sdl/thread-sdl.c
+++ b/firmware/target/hosted/sdl/thread-sdl.c
@@ -632,8 +632,8 @@ void thread_exit(void)
632 remove_thread(THREAD_ID_CURRENT); 632 remove_thread(THREAD_ID_CURRENT);
633 /* This should never and must never be reached - if it is, the 633 /* This should never and must never be reached - if it is, the
634 * state is corrupted */ 634 * state is corrupted */
635 THREAD_PANICF("thread_exit->K:*R", 635 THREAD_PANICF("thread_exit->K:*R (ID: %d)",
636 thread_id_entry(THREAD_ID_CURRENT)); 636 thread_id_entry(THREAD_ID_CURRENT)->id);
637 while (1); 637 while (1);
638} 638}
639 639
diff --git a/tools/configure b/tools/configure
index b8d99d7aca..b8cabe79d0 100755
--- a/tools/configure
+++ b/tools/configure
@@ -202,7 +202,8 @@ simcc () {
202 202
203 app_type=$1 203 app_type=$1
204 winbuild="" 204 winbuild=""
205 GCCOPTS='-W -Wall -g -fno-builtin' 205 GCCOPTS=`echo $CCOPTS | sed -e s/-ffreestanding// -e s/-nostdlib// -e s/-Wundef// -e s/-O//`
206 GCCOPTS="$GCCOPTS -fno-builtin -g"
206 GCCOPTIMIZE='' 207 GCCOPTIMIZE=''
207 LDOPTS='-lm' # button-sdl.c uses sqrt() 208 LDOPTS='-lm' # button-sdl.c uses sqrt()
208 209