From 01a010fd19a64f150ea95f223b1fd209c378ae57 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sun, 18 Mar 2007 09:50:53 +0000 Subject: Fix several printf-style warnings in logf builds. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12830 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/alac.c | 2 +- apps/codecs/flac.c | 2 +- apps/codecs/shorten.c | 2 +- apps/tagcache.c | 22 +++++++++++----------- apps/tagtree.c | 14 +++++++------- firmware/common/dircache.c | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c index ca62538a66..bedd2dd581 100644 --- a/apps/codecs/alac.c +++ b/apps/codecs/alac.c @@ -136,7 +136,7 @@ enum codec_status codec_main(void) retval = CODEC_OK; done: - LOGF("ALAC: Decoded %d samples\n",samplesdone); + LOGF("ALAC: Decoded %ld samples\n",samplesdone); if (ci->request_next_track()) goto next_track; diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c index 00e0a1f242..2eb0deb9f5 100644 --- a/apps/codecs/flac.c +++ b/apps/codecs/flac.c @@ -506,7 +506,7 @@ enum codec_status codec_main(void) retval = CODEC_OK; done: - LOGF("FLAC: Decoded %d samples\n",samplesdone); + LOGF("FLAC: Decoded %ld samples\n",samplesdone); if (ci->request_next_track()) goto next_track; diff --git a/apps/codecs/shorten.c b/apps/codecs/shorten.c index 004a4070bd..4b803675f9 100644 --- a/apps/codecs/shorten.c +++ b/apps/codecs/shorten.c @@ -130,7 +130,7 @@ seek_start: bytesleft, ci->yield); if (res == FN_ERROR) { - LOGF("Shorten: shorten_decode_frames error (%d)\n", samplesdone); + LOGF("Shorten: shorten_decode_frames error (%ld)\n", samplesdone); break; } else { /* Insert decoded samples in pcmbuf */ diff --git a/apps/tagcache.c b/apps/tagcache.c index 0ddf2b0228..3a8e73599b 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1568,7 +1568,7 @@ static void add_tagcache(char *path) if (path_length > TAG_MAXLEN) { /* Path can't be shortened. */ - logf("Too long path: %s"); + logf("Too long path: %s", path); return ; } @@ -1974,7 +1974,7 @@ static bool build_numeric_indices(struct tagcache_header *h, int tmpfd) } entries_processed += count; - logf("%d/%d entries processed", entries_processed, h->entry_count); + logf("%d/%ld entries processed", entries_processed, h->entry_count); } close(masterfd); @@ -2019,7 +2019,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) fd = open_tag_fd(&tch, index_type, true); if (fd >= 0) { - logf("tch.datasize=%d", tch.datasize); + logf("tch.datasize=%ld", tch.datasize); lookup_buffer_depth = 1 + /* First part */ commit_entry_count + /* Second part */ (tch.datasize / TAGFILE_ENTRY_CHUNK_LENGTH); @@ -2031,8 +2031,8 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) /* Second part */ 0; } - logf("lookup_buffer_depth=%d", lookup_buffer_depth); - logf("commit_entry_count=%d", commit_entry_count); + logf("lookup_buffer_depth=%ld", lookup_buffer_depth); + logf("commit_entry_count=%ld", commit_entry_count); /* Allocate buffer for all index entries from both old and new * tag files. */ @@ -2322,7 +2322,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) if (idxbuf[j].tag_seek[index_type] < 0) { - logf("update error: %d/%d", i+j, tcmh.tch.entry_count); + logf("update error: %d/%ld", i+j, tcmh.tch.entry_count); error = true; goto error_exit; } @@ -2405,7 +2405,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) entry.tag_length[index_type]) { logf("read fail #8"); - logf("offset=0x%02x", entry.tag_offset[index_type]); + logf("offset=0x%02lx", entry.tag_offset[index_type]); logf("length=0x%02x", entry.tag_length[index_type]); error = true; break ; @@ -2459,7 +2459,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) if (index_type != tag_filename) h->datasize += tch.datasize; - logf("s:%d/%d/%d", index_type, tch.datasize, h->datasize); + logf("s:%d/%ld/%ld", index_type, tch.datasize, h->datasize); error_exit: close(fd); @@ -2564,7 +2564,7 @@ static bool commit(void) return false; } - logf("commit %d entries...", tch.entry_count); + logf("commit %ld entries...", tch.entry_count); /* Mark DB dirty so it will stay disabled if commit fails. */ current_tcmh.dirty = true; @@ -3050,7 +3050,7 @@ static bool delete_entry(long idx_id) char buf[TAG_MAXLEN+32]; int in_use[TAG_COUNT]; - logf("delete_entry(): %d", idx_id); + logf("delete_entry(): %ld", idx_id); #ifdef HAVE_TC_RAMCACHE /* At first mark the entry removed from ram cache. */ @@ -3482,7 +3482,7 @@ static bool load_tagcache(void) { logf("too big tagcache #2"); logf("tl: %d", fe->tag_length); - logf("bl: %d", bytesleft); + logf("bl: %ld", bytesleft); close(fd); return false; } diff --git a/apps/tagtree.c b/apps/tagtree.c index fadeeb52e1..33c36b7b83 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -645,7 +645,7 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track) lastplayed = tagcache_increase_serial(); if (lastplayed < 0) { - logf("incorrect tc serial:%d", lastplayed); + logf("incorrect tc serial:%ld", lastplayed); tagcache_search_finish(&tcs); return; } @@ -654,8 +654,8 @@ static void tagtree_unbuffer_event(struct mp3entry *id3, bool last_track) playtime += MIN(id3->length, id3->elapsed + 15 * 1000); logf("ube:%s", id3->path); - logf("-> %d/%d/%d", last_track, playcount, playtime); - logf("-> %d/%d/%d", id3->elapsed, id3->length, MIN(id3->length, id3->elapsed + 15 * 1000)); + logf("-> %d/%ld/%ld", last_track, playcount, playtime); + logf("-> %ld/%ld/%ld", id3->elapsed, id3->length, MIN(id3->length, id3->elapsed + 15 * 1000)); /* lastplayed not yet supported. */ @@ -750,7 +750,7 @@ static int parse_line(int n, const char *buf, void *parameters) case var_include: if (get_token_str(data, sizeof(data)) < 0) { - logf("%include empty"); + logf("%%include empty"); return 0; } @@ -772,12 +772,12 @@ static int parse_line(int n, const char *buf, void *parameters) memset(menu, 0, sizeof(struct root_menu)); if (get_token_str(menu->id, sizeof(menu->id)) < 0) { - logf("%menu_start id empty"); + logf("%%menu_start id empty"); return 0; } if (get_token_str(menu->title, sizeof(menu->title)) < 0) { - logf("%menu_start title empty"); + logf("%%menu_start title empty"); return 0; } logf("menu: %s", menu->title); @@ -792,7 +792,7 @@ static int parse_line(int n, const char *buf, void *parameters) if (get_token_str(data, sizeof(data)) < 0) { - logf("%root_menu empty"); + logf("%%root_menu empty"); return 0; } diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index f78fa2d0cf..023f00f848 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -461,7 +461,7 @@ int dircache_load(void) dircache_size = maindata.size; allocated_size = dircache_size + DIRCACHE_RESERVE; reserve_used = 0; - logf("Done, %d KiB used", dircache_size / 1024); + logf("Done, %ld KiB used", dircache_size / 1024); dircache_initialized = true; memset(fd_bindings, 0, sizeof(fd_bindings)); @@ -564,7 +564,7 @@ static int dircache_do_rebuild(void) } cpu_boost(false); - logf("Done, %d KiB used", dircache_size / 1024); + logf("Done, %ld KiB used", dircache_size / 1024); dircache_initialized = true; dircache_initializing = false; -- cgit v1.2.3