From 50a6ca39ad4ed01922aa4f755f0ca579788226cf Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 6 May 2010 21:04:40 +0000 Subject: Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes). This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/albumart.c | 3 +-- apps/recorder/icons.c | 1 - apps/recorder/jpeg_load.c | 18 +++++++++--------- apps/recorder/keyboard.c | 2 +- apps/recorder/peakmeter.c | 1 - apps/recorder/radio.c | 3 +-- apps/recorder/recording.c | 4 ++-- 7 files changed, 14 insertions(+), 18 deletions(-) (limited to 'apps/recorder') diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index be787538a3..5eca713542 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c @@ -19,8 +19,7 @@ * ****************************************************************************/ -#include -#include "sprintf.h" +#include "string-extra.h" #include "system.h" #include "albumart.h" #include "metadata.h" diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 0b48c125d1..e6c3926759 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -22,7 +22,6 @@ #include "lcd.h" #include "font.h" #include "kernel.h" -#include "sprintf.h" #include "rtc.h" #include "powermgmt.h" diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c index f75176dae1..1af65fab6c 100644 --- a/apps/recorder/jpeg_load.c +++ b/apps/recorder/jpeg_load.c @@ -856,7 +856,7 @@ static const struct idct_entry idct_tbl[] = { /* JPEG decoder implementation */ #ifdef JPEG_FROM_MEM -INLINE unsigned char *getc(struct jpeg* p_jpeg) +INLINE unsigned char *jpeg_getc(struct jpeg* p_jpeg) { if (LIKELY(p_jpeg->len)) { @@ -880,7 +880,7 @@ INLINE bool skip_bytes(struct jpeg* p_jpeg, int count) } } -INLINE void putc(struct jpeg* p_jpeg) +INLINE void jpeg_putc(struct jpeg* p_jpeg) { p_jpeg->len++; p_jpeg->data--; @@ -892,7 +892,7 @@ INLINE void fill_buf(struct jpeg* p_jpeg) p_jpeg->buf_index = 0; } -static unsigned char *getc(struct jpeg* p_jpeg) +static unsigned char *jpeg_getc(struct jpeg* p_jpeg) { if (UNLIKELY(p_jpeg->buf_left < 1)) fill_buf(p_jpeg); @@ -917,7 +917,7 @@ static bool skip_bytes(struct jpeg* p_jpeg, int count) return p_jpeg->buf_left >= 0 || skip_bytes_seek(p_jpeg); } -static void putc(struct jpeg* p_jpeg) +static void jpeg_putc(struct jpeg* p_jpeg) { p_jpeg->buf_left++; p_jpeg->buf_index--; @@ -933,14 +933,14 @@ do {\ #define e_getc(jpeg, code) \ ({ \ unsigned char *c; \ - if (UNLIKELY(!(c = getc(jpeg)))) \ + if (UNLIKELY(!(c = jpeg_getc(jpeg)))) \ return (code); \ *c; \ }) #define d_getc(jpeg, def) \ ({ \ - unsigned char *cp = getc(jpeg); \ + unsigned char *cp = jpeg_getc(jpeg); \ unsigned char c = LIKELY(cp) ? *cp : (def); \ c; \ }) @@ -958,7 +958,7 @@ static int process_markers(struct jpeg* p_jpeg) if (c != 0xFF) /* no marker? */ { JDEBUGF("Non-marker data\n"); - putc(p_jpeg); + jpeg_putc(p_jpeg); break; /* exit marker processing */ } @@ -969,7 +969,7 @@ static int process_markers(struct jpeg* p_jpeg) case 0xFF: /* Fill byte */ ret |= FILL_FF; case 0x00: /* Zero stuffed byte - entropy data */ - putc(p_jpeg); + jpeg_putc(p_jpeg); continue; case 0xC0: /* SOF Huff - Baseline DCT */ @@ -1669,7 +1669,7 @@ static void search_restart(struct jpeg *p_jpeg) return; } else - putc(p_jpeg); + jpeg_putc(p_jpeg); } } } diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index 3df3142897..f8b390d932 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c @@ -20,7 +20,7 @@ ****************************************************************************/ #include "kernel.h" #include "system.h" -#include +#include "string-extra.h" #include "font.h" #include "screens.h" #include "talk.h" diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 8f32a837a7..154f605898 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -29,7 +29,6 @@ #include "storage.h" #include "lcd.h" #include "scrollbar.h" -#include "sprintf.h" #include "button.h" #include "system.h" #include "font.h" diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c index 7cf91d62f7..7761f248ca 100644 --- a/apps/recorder/radio.c +++ b/apps/recorder/radio.c @@ -23,7 +23,6 @@ #include #include #include -#include "sprintf.h" #include "mas.h" #include "settings.h" #include "button.h" @@ -35,7 +34,7 @@ #include "file.h" #include "general.h" #include "errno.h" -#include "string.h" +#include "string-extra.h" #include "system.h" #include "radio.h" #include "menu.h" diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index fc527923db..0f1ff30cf5 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -1762,7 +1762,7 @@ bool recording_screen(bool no_source) draw attention */ /* Don't use language string unless agreed upon to make this method permanent - could do something in the statusbar */ - snprintf(buf, sizeof(buf), "Warning: %08X", + snprintf(buf, sizeof(buf), "Warning: %08lX", pcm_rec_get_warnings()); } else @@ -1771,7 +1771,7 @@ bool recording_screen(bool no_source) (global_settings.rec_split_method)) { dmb = dsize/1024/1024; - snprintf(buf, sizeof(buf), "%s %dMB", + snprintf(buf, sizeof(buf), "%s %luMB", str(LANG_SPLIT_SIZE), dmb); } else -- cgit v1.2.3