summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2007-03-17 09:02:53 +0000
committerJens Arnold <amiconn@rockbox.org>2007-03-17 09:02:53 +0000
commit79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d (patch)
treed5c3fbab0ec01d2b0ca7d5278f15cf45f79b0763
parent1329d7d3fde426a290c03ee92b1c701dde49851c (diff)
downloadrockbox-79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d.tar.gz
rockbox-79c8a8cbbec5f1f0f7766d2b72ce12d51b3b849d.zip
Let GCC check arguments of some more printf-style functions, also for plugins and codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12815 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs.h11
-rw-r--r--apps/gui/splash.h6
-rw-r--r--apps/plugin.h11
-rw-r--r--apps/plugins/battery_bench.c2
-rw-r--r--apps/plugins/doom/d_deh.c16
-rw-r--r--apps/plugins/iriver_flash.c4
-rw-r--r--apps/plugins/jpeg.c2
-rw-r--r--apps/plugins/midi/synth.c2
-rw-r--r--apps/plugins/mp3_encoder.c4
-rw-r--r--apps/plugins/rockbox_flash.c2
-rw-r--r--apps/plugins/rockboy/menu.c8
-rw-r--r--apps/plugins/rockpaint.c2
-rw-r--r--apps/plugins/search.c2
-rw-r--r--apps/plugins/test_disk.c10
-rw-r--r--apps/plugins/text_editor.c2
-rw-r--r--apps/plugins/video.c4
-rw-r--r--apps/plugins/wav2wv.c2
-rw-r--r--firmware/export/debug.h7
-rw-r--r--firmware/export/logf.h2
-rw-r--r--firmware/include/sprintf.h5
20 files changed, 55 insertions, 49 deletions
diff --git a/apps/codecs.h b/apps/codecs.h
index 7c7224ec80..5dfadcc29d 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -166,7 +166,7 @@ struct codec_api {
166 /* Configure different codec buffer parameters. */ 166 /* Configure different codec buffer parameters. */
167 void (*configure)(int setting, intptr_t value); 167 void (*configure)(int setting, intptr_t value);
168 168
169 void (*splash)(int ticks, const unsigned char *fmt, ...); 169 void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
170 170
171 /* file */ 171 /* file */
172 int (*PREFIX(open))(const char* pathname, int flags); 172 int (*PREFIX(open))(const char* pathname, int flags);
@@ -180,7 +180,7 @@ struct codec_api {
180 int (*PREFIX(ftruncate))(int fd, off_t length); 180 int (*PREFIX(ftruncate))(int fd, off_t length);
181 int (*PREFIX(fsync))(int fd); 181 int (*PREFIX(fsync))(int fd);
182 182
183 int (*fdprintf)(int fd, const char *fmt, ...); 183 int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
184 int (*read_line)(int fd, char* buffer, int buffer_size); 184 int (*read_line)(int fd, char* buffer, int buffer_size);
185 bool (*settings_parseline)(char* line, char** name, char** value); 185 bool (*settings_parseline)(char* line, char** name, char** value);
186#ifndef SIMULATOR 186#ifndef SIMULATOR
@@ -218,7 +218,8 @@ struct codec_api {
218#endif 218#endif
219 219
220 /* strings and memory */ 220 /* strings and memory */
221 int (*snprintf)(char *buf, size_t size, const char *fmt, ...); 221 int (*snprintf)(char *buf, size_t size, const char *fmt, ...)
222 ATTRIBUTE_PRINTF(3, 4);
222 char* (*strcpy)(char *dst, const char *src); 223 char* (*strcpy)(char *dst, const char *src);
223 char* (*strncpy)(char *dst, const char *src, size_t length); 224 char* (*strncpy)(char *dst, const char *src, size_t length);
224 size_t (*strlen)(const char *str); 225 size_t (*strlen)(const char *str);
@@ -278,10 +279,10 @@ struct codec_api {
278 bool signd); 279 bool signd);
279 280
280#if defined(DEBUG) || defined(SIMULATOR) 281#if defined(DEBUG) || defined(SIMULATOR)
281 void (*debugf)(const char *fmt, ...); 282 void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
282#endif 283#endif
283#ifdef ROCKBOX_HAS_LOGF 284#ifdef ROCKBOX_HAS_LOGF
284 void (*logf)(const char *fmt, ...); 285 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
285#endif 286#endif
286 struct user_settings* global_settings; 287 struct user_settings* global_settings;
287 bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); 288 bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first);
diff --git a/apps/gui/splash.h b/apps/gui/splash.h
index 589be95033..206674d9d0 100644
--- a/apps/gui/splash.h
+++ b/apps/gui/splash.h
@@ -19,6 +19,7 @@
19 19
20#ifndef _GUI_SPLASH_H_ 20#ifndef _GUI_SPLASH_H_
21#define _GUI_SPLASH_H_ 21#define _GUI_SPLASH_H_
22#include <_ansi.h>
22#include "screen_access.h" 23#include "screen_access.h"
23 24
24/* 25/*
@@ -28,13 +29,14 @@
28 * - fmt : what to say *printf style 29 * - fmt : what to say *printf style
29 */ 30 */
30extern void gui_splash(struct screen * screen, int ticks, 31extern void gui_splash(struct screen * screen, int ticks,
31 const char *fmt, ...); 32 const char *fmt, ...) ATTRIBUTE_PRINTF(3, 4);
32 33
33/* 34/*
34 * Puts a splash message centered on all the screens for a given period 35 * Puts a splash message centered on all the screens for a given period
35 * - ticks : how long the splash is displayed (in rb ticks) 36 * - ticks : how long the splash is displayed (in rb ticks)
36 * - fmt : what to say *printf style 37 * - fmt : what to say *printf style
37 */ 38 */
38extern void gui_syncsplash(int ticks, const unsigned char *fmt, ...); 39extern void gui_syncsplash(int ticks, const char *fmt, ...)
40 ATTRIBUTE_PRINTF(2, 3);
39 41
40#endif /* _GUI_ICON_H_ */ 42#endif /* _GUI_ICON_H_ */
diff --git a/apps/plugin.h b/apps/plugin.h
index c0e04a2068..e3c086ef5e 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -205,7 +205,7 @@ struct plugin_api {
205 void (*backlight_on)(void); 205 void (*backlight_on)(void);
206 void (*backlight_off)(void); 206 void (*backlight_off)(void);
207 void (*backlight_set_timeout)(int index); 207 void (*backlight_set_timeout)(int index);
208 void (*splash)(int ticks, const unsigned char *fmt, ...); 208 void (*splash)(int ticks, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
209 209
210#ifdef HAVE_REMOTE_LCD 210#ifdef HAVE_REMOTE_LCD
211 /* remote lcd */ 211 /* remote lcd */
@@ -296,7 +296,7 @@ struct plugin_api {
296 int (*PREFIX(rename))(const char* path, const char* newname); 296 int (*PREFIX(rename))(const char* path, const char* newname);
297 int (*PREFIX(ftruncate))(int fd, off_t length); 297 int (*PREFIX(ftruncate))(int fd, off_t length);
298 off_t (*PREFIX(filesize))(int fd); 298 off_t (*PREFIX(filesize))(int fd);
299 int (*fdprintf)(int fd, const char *fmt, ...); 299 int (*fdprintf)(int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
300 int (*read_line)(int fd, char* buffer, int buffer_size); 300 int (*read_line)(int fd, char* buffer, int buffer_size);
301 bool (*settings_parseline)(char* line, char** name, char** value); 301 bool (*settings_parseline)(char* line, char** name, char** value);
302#ifndef SIMULATOR 302#ifndef SIMULATOR
@@ -369,7 +369,8 @@ struct plugin_api {
369#endif 369#endif
370 370
371 /* strings and memory */ 371 /* strings and memory */
372 int (*snprintf)(char *buf, size_t size, const char *fmt, ...); 372 int (*snprintf)(char *buf, size_t size, const char *fmt, ...)
373 ATTRIBUTE_PRINTF(3, 4);
373 int (*vsnprintf)(char *buf, int size, const char *fmt, va_list ap); 374 int (*vsnprintf)(char *buf, int size, const char *fmt, va_list ap);
374 char* (*strcpy)(char *dst, const char *src); 375 char* (*strcpy)(char *dst, const char *src);
375 char* (*strncpy)(char *dst, const char *src, size_t length); 376 char* (*strncpy)(char *dst, const char *src, size_t length);
@@ -519,10 +520,10 @@ struct plugin_api {
519 void* (*plugin_get_audio_buffer)(int* buffer_size); 520 void* (*plugin_get_audio_buffer)(int* buffer_size);
520 void (*plugin_tsr)(bool (*exit_callback)(bool reenter)); 521 void (*plugin_tsr)(bool (*exit_callback)(bool reenter));
521#if defined(DEBUG) || defined(SIMULATOR) 522#if defined(DEBUG) || defined(SIMULATOR)
522 void (*debugf)(const char *fmt, ...); 523 void (*debugf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
523#endif 524#endif
524#ifdef ROCKBOX_HAS_LOGF 525#ifdef ROCKBOX_HAS_LOGF
525 void (*logf)(const char *fmt, ...); 526 void (*logf)(const char *fmt, ...) ATTRIBUTE_PRINTF(1, 2);
526#endif 527#endif
527 struct user_settings* global_settings; 528 struct user_settings* global_settings;
528 bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); 529 bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first);
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index a4da7f4bb5..53dd5be4c0 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -459,7 +459,7 @@ int main(void)
459#endif 459#endif
460 "\n" 460 "\n"
461 ,BATTERY_LOG,rb->global_settings->battery_capacity, 461 ,BATTERY_LOG,rb->global_settings->battery_capacity,
462 BUF_SIZE / sizeof(struct batt_info)); 462 BUF_SIZE / (unsigned)sizeof(struct batt_info));
463 rb->close(fd); 463 rb->close(fd);
464 } 464 }
465 else 465 else
diff --git a/apps/plugins/doom/d_deh.c b/apps/plugins/doom/d_deh.c
index a5aee07848..c1e136f467 100644
--- a/apps/plugins/doom/d_deh.c
+++ b/apps/plugins/doom/d_deh.c
@@ -1918,25 +1918,25 @@ void deh_procFrame(DEHFILE *fpin, int fpout, char *line)
1918 } 1918 }
1919 if (!strcasecmp(key,deh_state[0])) // Sprite number 1919 if (!strcasecmp(key,deh_state[0])) // Sprite number
1920 { 1920 {
1921 if (fpout) fdprintf(fpout," - sprite = %d\n",value); 1921 if (fpout) fdprintf(fpout," - sprite = %ld\n",(long)value);
1922 states[indexnum].sprite = (spritenum_t)value; 1922 states[indexnum].sprite = (spritenum_t)value;
1923 } 1923 }
1924 else 1924 else
1925 if (!strcasecmp(key,deh_state[1])) // Sprite subnumber 1925 if (!strcasecmp(key,deh_state[1])) // Sprite subnumber
1926 { 1926 {
1927 if (fpout) fdprintf(fpout," - frame = %d\n",value); 1927 if (fpout) fdprintf(fpout," - frame = %ld\n",(long)value);
1928 states[indexnum].frame = (long)value; // long 1928 states[indexnum].frame = (long)value; // long
1929 } 1929 }
1930 else 1930 else
1931 if (!strcasecmp(key,deh_state[2])) // Duration 1931 if (!strcasecmp(key,deh_state[2])) // Duration
1932 { 1932 {
1933 if (fpout) fdprintf(fpout," - tics = %d\n",value); 1933 if (fpout) fdprintf(fpout," - tics = %ld\n",(long)value);
1934 states[indexnum].tics = (long)value; // long 1934 states[indexnum].tics = (long)value; // long
1935 } 1935 }
1936 else 1936 else
1937 if (!strcasecmp(key,deh_state[3])) // Next frame 1937 if (!strcasecmp(key,deh_state[3])) // Next frame
1938 { 1938 {
1939 if (fpout) fdprintf(fpout," - nextstate = %d\n",value); 1939 if (fpout) fdprintf(fpout," - nextstate = %ld\n",(long)value);
1940 states[indexnum].nextstate = (statenum_t)value; 1940 states[indexnum].nextstate = (statenum_t)value;
1941 } 1941 }
1942 else 1942 else
@@ -1948,13 +1948,13 @@ void deh_procFrame(DEHFILE *fpin, int fpout, char *line)
1948 else 1948 else
1949 if (!strcasecmp(key,deh_state[5])) // Unknown 1 1949 if (!strcasecmp(key,deh_state[5])) // Unknown 1
1950 { 1950 {
1951 if (fpout) fdprintf(fpout," - misc1 = %d\n",value); 1951 if (fpout) fdprintf(fpout," - misc1 = %ld\n",(long)value);
1952 states[indexnum].misc1 = (long)value; // long 1952 states[indexnum].misc1 = (long)value; // long
1953 } 1953 }
1954 else 1954 else
1955 if (!strcasecmp(key,deh_state[6])) // Unknown 2 1955 if (!strcasecmp(key,deh_state[6])) // Unknown 2
1956 { 1956 {
1957 if (fpout) fdprintf(fpout," - misc2 = %d\n",value); 1957 if (fpout) fdprintf(fpout," - misc2 = %ld\n",(long)value);
1958 states[indexnum].misc2 = (long)value; // long 1958 states[indexnum].misc2 = (long)value; // long
1959 } 1959 }
1960 else 1960 else
@@ -2017,8 +2017,8 @@ void deh_procPointer(DEHFILE *fpin, int fpout, char *line) // done
2017 if (!strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block) 2017 if (!strcasecmp(key,deh_state[4])) // Codep frame (not set in Frame deh block)
2018 { 2018 {
2019 states[indexnum].action = deh_codeptr[value]; 2019 states[indexnum].action = deh_codeptr[value];
2020 if (fpout) fdprintf(fpout," - applied from codeptr[%d] to states[%d]\n", 2020 if (fpout) fdprintf(fpout," - applied from codeptr[%ld] to states[%d]\n",
2021 value,indexnum); 2021 (long)value,indexnum);
2022 // Write BEX-oriented line to match: 2022 // Write BEX-oriented line to match:
2023 for (i=0;i<NUMSTATES;i++) 2023 for (i=0;i<NUMSTATES;i++)
2024 { 2024 {
diff --git a/apps/plugins/iriver_flash.c b/apps/plugins/iriver_flash.c
index 3d2ae7dcd5..4a6002f3df 100644
--- a/apps/plugins/iriver_flash.c
+++ b/apps/plugins/iriver_flash.c
@@ -418,10 +418,10 @@ int flash_rockbox(const char *filename, int section)
418 if (section == SECT_ROMIMAGE) 418 if (section == SECT_ROMIMAGE)
419 { 419 {
420 uint32_t *p32 = (uint32_t *)audiobuf; 420 uint32_t *p32 = (uint32_t *)audiobuf;
421 421
422 if (pos+sizeof(struct flash_header) != *p32) 422 if (pos+sizeof(struct flash_header) != *p32)
423 { 423 {
424 rb->snprintf(buf, sizeof(buf), "Incorrect relocation: 0x%08x/0x%08x", 424 rb->snprintf(buf, sizeof(buf), "Incorrect relocation: 0x%08lx/0x%08lx",
425 *p32, pos+sizeof(struct flash_header)); 425 *p32, pos+sizeof(struct flash_header));
426 rb->splash(HZ*10, buf); 426 rb->splash(HZ*10, buf);
427 return -1; 427 return -1;
diff --git a/apps/plugins/jpeg.c b/apps/plugins/jpeg.c
index 900e6df72a..dbe7270d18 100644
--- a/apps/plugins/jpeg.c
+++ b/apps/plugins/jpeg.c
@@ -2565,7 +2565,7 @@ struct t_disp* get_image(struct jpeg* p_jpg, int ds)
2565 2565
2566 if(!running_slideshow) 2566 if(!running_slideshow)
2567 { 2567 {
2568 rb->snprintf(print, sizeof(print), " %d.%02d sec ", time/HZ, time%HZ); 2568 rb->snprintf(print, sizeof(print), " %ld.%02ld sec ", time/HZ, time%HZ);
2569 rb->lcd_getstringsize(print, &w, &h); /* centered in progress bar */ 2569 rb->lcd_getstringsize(print, &w, &h); /* centered in progress bar */
2570 rb->lcd_putsxy((LCD_WIDTH - w)/2, LCD_HEIGHT - h, print); 2570 rb->lcd_putsxy((LCD_WIDTH - w)/2, LCD_HEIGHT - h, print);
2571 rb->lcd_update(); 2571 rb->lcd_update();
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index 78aaab18f4..a3a3d608e7 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -124,7 +124,7 @@ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig)
124 124
125 /* Scan our config file and load the right patches as needed */ 125 /* Scan our config file and load the right patches as needed */
126 int c = 0; 126 int c = 0;
127 rb->snprintf(name, 40, ""); 127 name[0] = '\0';
128 printf("\nLoading instruments"); 128 printf("\nLoading instruments");
129 for(a=0; a<128; a++) 129 for(a=0; a<128; a++)
130 { 130 {
diff --git a/apps/plugins/mp3_encoder.c b/apps/plugins/mp3_encoder.c
index 8f4b9bdda6..5f852c43f4 100644
--- a/apps/plugins/mp3_encoder.c
+++ b/apps/plugins/mp3_encoder.c
@@ -2466,10 +2466,10 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2466 } 2466 }
2467 2467
2468 rb->lcd_clear_display(); 2468 rb->lcd_clear_display();
2469 rb->snprintf(stg, 30, " Conversion: %d.%02ds ", tim/100, tim%100); 2469 rb->snprintf(stg, 30, " Conversion: %ld.%02lds ", tim/100, tim%100);
2470 rb->lcd_putsxy(0, 30, stg); 2470 rb->lcd_putsxy(0, 30, stg);
2471 tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */ 2471 tim = frames * SAMP_PER_FRAME * 100 / 44100; /* unit=.01s */
2472 rb->snprintf(stg, 30, " WAV-Length: %d.%02ds ", tim/100, tim%100); 2472 rb->snprintf(stg, 30, " WAV-Length: %ld.%02lds ", tim/100, tim%100);
2473 rb->lcd_putsxy(0, 20, stg); 2473 rb->lcd_putsxy(0, 20, stg);
2474 rb->lcd_update(); 2474 rb->lcd_update();
2475 rb->sleep(5*HZ); 2475 rb->sleep(5*HZ);
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
index fbdfdbd7ee..deccb47bb9 100644
--- a/apps/plugins/rockbox_flash.c
+++ b/apps/plugins/rockbox_flash.c
@@ -693,7 +693,7 @@ void DoUserDialog(char* filename)
693 crc = CheckBootloader(); 693 crc = CheckBootloader();
694 if (crc) /* outdated version found */ 694 if (crc) /* outdated version found */
695 { 695 {
696 rb->snprintf(buf, sizeof(buf), "(check=0x%08x)", crc); 696 rb->snprintf(buf, sizeof(buf), "(check=0x%08lx)", crc);
697 rb->lcd_puts(0, 0, buf); 697 rb->lcd_puts(0, 0, buf);
698 rb->lcd_puts(0, 1, "Hint: You're not "); 698 rb->lcd_puts(0, 1, "Hint: You're not ");
699 rb->lcd_puts(0, 2, "using the latest "); 699 rb->lcd_puts(0, 2, "using the latest ");
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index abacd2c831..a3d64d60d0 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -167,7 +167,7 @@ static void build_slot_path(char *buf, size_t bufsiz, size_t slot_id) {
167 munge_name(name_buf, strlen(name_buf)); 167 munge_name(name_buf, strlen(name_buf));
168 168
169 /* glom the whole mess together */ 169 /* glom the whole mess together */
170 snprintf(buf, bufsiz, "%s/%s-%d.rbs", STATE_DIR, name_buf, slot_id + 1); 170 snprintf(buf, bufsiz, "%s/%s-%ld.rbs", STATE_DIR, name_buf, slot_id + 1);
171} 171}
172 172
173/* 173/*
@@ -263,17 +263,17 @@ static void slot_info(char *info_buf, size_t info_bufsiz, size_t slot_id) {
263 if (read(fd, buf, 20) > 0) 263 if (read(fd, buf, 20) > 0)
264 { 264 {
265 buf[20] = '\0'; 265 buf[20] = '\0';
266 snprintf(info_buf, info_bufsiz, "%d. %s", slot_id + 1, buf); 266 snprintf(info_buf, info_bufsiz, "%ld. %s", slot_id + 1, buf);
267 } 267 }
268 else 268 else
269 snprintf(info_buf, info_bufsiz, "%d. ERROR", slot_id + 1); 269 snprintf(info_buf, info_bufsiz, "%ld. ERROR", slot_id + 1);
270 270
271 close(fd); 271 close(fd);
272 } 272 }
273 else 273 else
274 { 274 {
275 /* if we couldn't open the file, then the slot is empty */ 275 /* if we couldn't open the file, then the slot is empty */
276 snprintf(info_buf, info_bufsiz, "%d. %s", slot_id + 1, "<Empty>"); 276 snprintf(info_buf, info_bufsiz, "%ld. %s", slot_id + 1, "<Empty>");
277 } 277 }
278} 278}
279 279
diff --git a/apps/plugins/rockpaint.c b/apps/plugins/rockpaint.c
index 34d9847042..68a3e5f595 100644
--- a/apps/plugins/rockpaint.c
+++ b/apps/plugins/rockpaint.c
@@ -2958,7 +2958,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
2958 } 2958 }
2959 else 2959 else
2960 { 2960 {
2961 rb->splash( 1*HZ, "Image loaded (%s)", parameter ); 2961 rb->splash( 1*HZ, "Image loaded (%s)", (char *)parameter );
2962 restore_screen(); 2962 restore_screen();
2963 rb->strcpy( filename, parameter ); 2963 rb->strcpy( filename, parameter );
2964 } 2964 }
diff --git a/apps/plugins/search.c b/apps/plugins/search.c
index 6d4cfd2d78..26669f2b83 100644
--- a/apps/plugins/search.c
+++ b/apps/plugins/search.c
@@ -168,7 +168,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
168 if(p) 168 if(p)
169 *p = 0; 169 *p = 0;
170 170
171 rb->snprintf(resultfile, MAX_PATH, "%s/search_result.m3u", path, p+1); 171 rb->snprintf(resultfile, MAX_PATH, "%s/search_result.m3u", path);
172 ok = search_init(parameter); 172 ok = search_init(parameter);
173 if (!ok) { 173 if (!ok) {
174 return PLUGIN_ERROR; 174 return PLUGIN_ERROR;
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c
index 91fc3bb405..e302a621cb 100644
--- a/apps/plugins/test_disk.c
+++ b/apps/plugins/test_disk.c
@@ -207,7 +207,7 @@ static bool test_speed(void)
207 goto error; 207 goto error;
208 } 208 }
209 time = *rb->current_tick - time; 209 time = *rb->current_tick - time;
210 rb->snprintf(text_buf, sizeof text_buf, "Create: %d KByte/s", 210 rb->snprintf(text_buf, sizeof text_buf, "Create: %ld KByte/s",
211 (25 * buf_len / time) >> 8); 211 (25 * buf_len / time) >> 8);
212 log_lcd(text_buf, true); 212 log_lcd(text_buf, true);
213 rb->close(fd); 213 rb->close(fd);
@@ -226,7 +226,7 @@ static bool test_speed(void)
226 goto error; 226 goto error;
227 } 227 }
228 time = *rb->current_tick - time; 228 time = *rb->current_tick - time;
229 rb->snprintf(text_buf, sizeof text_buf, "Write A: %d KByte/s", 229 rb->snprintf(text_buf, sizeof text_buf, "Write A: %ld KByte/s",
230 (25 * buf_len / time) >> 8); 230 (25 * buf_len / time) >> 8);
231 log_lcd(text_buf, true); 231 log_lcd(text_buf, true);
232 rb->close(fd); 232 rb->close(fd);
@@ -245,7 +245,7 @@ static bool test_speed(void)
245 goto error; 245 goto error;
246 } 246 }
247 time = *rb->current_tick - time; 247 time = *rb->current_tick - time;
248 rb->snprintf(text_buf, sizeof text_buf, "Write U: %d KByte/s", 248 rb->snprintf(text_buf, sizeof text_buf, "Write U: %ld KByte/s",
249 (25 * buf_len / time) >> 8); 249 (25 * buf_len / time) >> 8);
250 log_lcd(text_buf, true); 250 log_lcd(text_buf, true);
251 rb->close(fd); 251 rb->close(fd);
@@ -264,7 +264,7 @@ static bool test_speed(void)
264 goto error; 264 goto error;
265 } 265 }
266 time = *rb->current_tick - time; 266 time = *rb->current_tick - time;
267 rb->snprintf(text_buf, sizeof text_buf, "Read A: %d KByte/s", 267 rb->snprintf(text_buf, sizeof text_buf, "Read A: %ld KByte/s",
268 (25 * buf_len / time) >> 8); 268 (25 * buf_len / time) >> 8);
269 log_lcd(text_buf, true); 269 log_lcd(text_buf, true);
270 rb->close(fd); 270 rb->close(fd);
@@ -283,7 +283,7 @@ static bool test_speed(void)
283 goto error; 283 goto error;
284 } 284 }
285 time = *rb->current_tick - time; 285 time = *rb->current_tick - time;
286 rb->snprintf(text_buf, sizeof text_buf, "Read U: %d KByte/s", 286 rb->snprintf(text_buf, sizeof text_buf, "Read U: %ld KByte/s",
287 (25 * buf_len / time) >> 8); 287 (25 * buf_len / time) >> 8);
288 log_lcd(text_buf, true); 288 log_lcd(text_buf, true);
289 rb->close(fd); 289 rb->close(fd);
diff --git a/apps/plugins/text_editor.c b/apps/plugins/text_editor.c
index 8040d00f22..9917d03242 100644
--- a/apps/plugins/text_editor.c
+++ b/apps/plugins/text_editor.c
@@ -123,7 +123,7 @@ char *list_get_name_cb(int selected_item,void* data,char* buf)
123 { 123 {
124 char t = b[MAX_PATH-10]; 124 char t = b[MAX_PATH-10];
125 b[MAX_PATH-10] = '\0'; 125 b[MAX_PATH-10] = '\0';
126 rb->snprintf(buf,MAX_PATH,"%s ...\0",b); 126 rb->snprintf(buf,MAX_PATH,"%s ...",b);
127 b[MAX_PATH-10] = t; 127 b[MAX_PATH-10] = t;
128 } 128 }
129 else rb->strcpy(buf,b); 129 else rb->strcpy(buf,b);
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
index c2f64bbfa6..3700c233fe 100644
--- a/apps/plugins/video.c
+++ b/apps/plugins/video.c
@@ -962,9 +962,9 @@ int main(char* filename)
962 rb->lcd_puts(0, 2, gPrint); 962 rb->lcd_puts(0, 2, gPrint);
963 rb->snprintf(gPrint, sizeof(gPrint), "%d MinVideo bytes", gStats.minVideoAvail); 963 rb->snprintf(gPrint, sizeof(gPrint), "%d MinVideo bytes", gStats.minVideoAvail);
964 rb->lcd_puts(0, 3, gPrint); 964 rb->lcd_puts(0, 3, gPrint);
965 rb->snprintf(gPrint, sizeof(gPrint), "MinSpinup %d.%02d", gStats.minSpinup/HZ, gStats.minSpinup%HZ); 965 rb->snprintf(gPrint, sizeof(gPrint), "MinSpinup %ld.%02ld", gStats.minSpinup/HZ, gStats.minSpinup%HZ);
966 rb->lcd_puts(0, 4, gPrint); 966 rb->lcd_puts(0, 4, gPrint);
967 rb->snprintf(gPrint, sizeof(gPrint), "MaxSpinup %d.%02d", gStats.maxSpinup/HZ, gStats.maxSpinup%HZ); 967 rb->snprintf(gPrint, sizeof(gPrint), "MaxSpinup %ld.%02ld", gStats.maxSpinup/HZ, gStats.maxSpinup%HZ);
968 rb->lcd_puts(0, 5, gPrint); 968 rb->lcd_puts(0, 5, gPrint);
969 rb->snprintf(gPrint, sizeof(gPrint), "LowWater: %d", gBuf.low_water); 969 rb->snprintf(gPrint, sizeof(gPrint), "LowWater: %d", gBuf.low_water);
970 rb->lcd_puts(0, 6, gPrint); 970 rb->lcd_puts(0, 6, gPrint);
diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c
index 07b1d225f8..69ccfa52a5 100644
--- a/apps/plugins/wav2wv.c
+++ b/apps/plugins/wav2wv.c
@@ -80,7 +80,7 @@ static void wvupdate (int32_t start_tick,
80 compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 + 80 compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 +
81 (bytes_read/2)) / bytes_read); 81 (bytes_read/2)) / bytes_read);
82 82
83 rb->snprintf(buf, 32, "elapsed time: %d secs", (elapsed_ticks + (HZ/2)) / HZ); 83 rb->snprintf(buf, 32, "elapsed time: %ld secs", (elapsed_ticks + (HZ/2)) / HZ);
84 rb->lcd_puts(0, 2, (unsigned char *)buf); 84 rb->lcd_puts(0, 2, (unsigned char *)buf);
85 85
86 rb->snprintf(buf, 32, "progress: %d%%", progress); 86 rb->snprintf(buf, 32, "progress: %d%%", progress);
diff --git a/firmware/export/debug.h b/firmware/export/debug.h
index ce556d6418..ef56ea6092 100644
--- a/firmware/export/debug.h
+++ b/firmware/export/debug.h
@@ -19,9 +19,12 @@
19#ifndef DEBUG_H 19#ifndef DEBUG_H
20#define DEBUG_H 20#define DEBUG_H
21 21
22#include <_ansi.h>
23
22extern void debug_init(void); 24extern void debug_init(void);
23extern void debugf(const char* fmt,...); 25extern void debugf(const char* fmt,...) ATTRIBUTE_PRINTF(1, 2);
24extern void ldebugf(const char* file, int line, const char *fmt, ...); 26extern void ldebugf(const char* file, int line, const char *fmt, ...)
27 ATTRIBUTE_PRINTF(3, 4);
25 28
26#ifdef __GNUC__ 29#ifdef __GNUC__
27 30
diff --git a/firmware/export/logf.h b/firmware/export/logf.h
index 35cb7127e4..145c5c5169 100644
--- a/firmware/export/logf.h
+++ b/firmware/export/logf.h
@@ -34,7 +34,7 @@ extern bool logfwrap;
34#endif /* __PCTOOL__ */ 34#endif /* __PCTOOL__ */
35 35
36#define logf _logf 36#define logf _logf
37void _logf(const char *format, ...); 37void _logf(const char *format, ...) ATTRIBUTE_PRINTF(1, 2);
38 38
39#else /* !ROCKBOX_HAS_LOGF */ 39#else /* !ROCKBOX_HAS_LOGF */
40/* built without logf() support enabled */ 40/* built without logf() support enabled */
diff --git a/firmware/include/sprintf.h b/firmware/include/sprintf.h
index 9f2ea7b404..74fa44bbf3 100644
--- a/firmware/include/sprintf.h
+++ b/firmware/include/sprintf.h
@@ -25,10 +25,9 @@
25#include <_ansi.h> 25#include <_ansi.h>
26 26
27int snprintf (char *buf, size_t size, const char *fmt, ...) 27int snprintf (char *buf, size_t size, const char *fmt, ...)
28 ATTRIBUTE_PRINTF(3, 4); 28 ATTRIBUTE_PRINTF(3, 4);
29 29
30int vsnprintf (char *buf, int size, const char *fmt, va_list ap); 30int vsnprintf (char *buf, int size, const char *fmt, va_list ap);
31int fdprintf (int fd, const char *fmt, ...) 31int fdprintf (int fd, const char *fmt, ...) ATTRIBUTE_PRINTF(2, 3);
32 ATTRIBUTE_PRINTF(2, 3);
33 32
34#endif /* __SPRINTF_H__ */ 33#endif /* __SPRINTF_H__ */