From 93db934e3574974938016c9192383fbaab5be183 Mon Sep 17 00:00:00 2001 From: gevaerts Date: Fri, 14 May 2010 22:19:45 +0000 Subject: [PATCH] Fix various size_t related warnings and errors git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26035 a1c6a512-1295-4272-9138-f99709370657 --- apps/buffering.c | 4 ++-- apps/plugins/mpegplayer/audio_thread.c | 2 +- apps/plugins/mpegplayer/disk_buf.c | 4 ++-- apps/plugins/mpegplayer/mpeg_parser.c | 14 +++++++------- apps/plugins/mpegplayer/pcm_output.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/buffering.c b/apps/buffering.c index f194e2b82..451fa661e 100644 --- a/apps/buffering.c +++ b/apps/buffering.c @@ -685,8 +685,8 @@ static bool buffer_handle(int handle_id) /* stop buffering data for now and post-pone buffering the rest */ stop = true; DEBUGF( "%s(): Preventing handle corruption: h1.id:%d h2.id:%d" - " copy_n:%lu overlap:%ld h1.filerem:%lu\n", __func__, - h->id, h->next->id, (unsigned long)copy_n, (long)overlap, + " copy_n:%zu overlap:%ld h1.filerem:%lu\n", __func__, + h->id, h->next->id, (unsigned long)copy_n, overlap, (unsigned long)h->filerem); copy_n -= overlap; } diff --git a/apps/plugins/mpegplayer/audio_thread.c b/apps/plugins/mpegplayer/audio_thread.c index c9252f589..e80239096 100644 --- a/apps/plugins/mpegplayer/audio_thread.c +++ b/apps/plugins/mpegplayer/audio_thread.c @@ -279,7 +279,7 @@ static int audio_sync(struct audio_thread_data *td, { if (audio_buffer(str, STREAM_PM_RANDOM_ACCESS) == STREAM_DATA_END) { - DEBUGF("audio_sync:STR_DATA_END\n aqu:%ld swl:%ld swr:%ld\n", + DEBUGF("audio_sync:STR_DATA_END\n aqu:%zd swl:%ld swr:%ld\n", audio_queue.used, str->hdr.win_left, str->hdr.win_right); if (audio_queue.used <= MAD_BUFFER_GUARD) goto sync_data_end; diff --git a/apps/plugins/mpegplayer/disk_buf.c b/apps/plugins/mpegplayer/disk_buf.c index 398c205fc..07b68af96 100644 --- a/apps/plugins/mpegplayer/disk_buf.c +++ b/apps/plugins/mpegplayer/disk_buf.c @@ -662,7 +662,7 @@ ssize_t disk_buf_read(void *buffer, size_t size) return size; } -off_t disk_buf_lseek(off_t offset, int whence) +ssize_t disk_buf_lseek(off_t offset, int whence) { disk_buf_lock(); @@ -881,7 +881,7 @@ bool disk_buf_init(void) DEBUGF("disk_buf info:\n" " page count: %d\n" - " size: %ld\n", + " size: %zd\n", disk_buf.pgcount, disk_buf.size); rb->memset(disk_buf.cache, 0xff, diff --git a/apps/plugins/mpegplayer/mpeg_parser.c b/apps/plugins/mpegplayer/mpeg_parser.c index e14c51337..5c0fedfd5 100644 --- a/apps/plugins/mpegplayer/mpeg_parser.c +++ b/apps/plugins/mpegplayer/mpeg_parser.c @@ -366,7 +366,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) pos = pos_new; DEBUGF("Seeking stream 0x%02x\n", id); - DEBUGF("$$ tl:%u t:%u ct:?? tr:%u\n pl:%ld pn:%ld pr:%ld\n", + DEBUGF("$$ tl:%u t:%u ct:?? tr:%u\n pl:%zd pn:%zd pr:%zd\n", (unsigned)time_left, (unsigned)time, (unsigned)time_right, pos_left, pos_new, pos_right); @@ -425,7 +425,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) state = STATE2; /* Last scan was early */ sk.dir = SSCAN_REVERSE; - DEBUGF(">> tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", + DEBUGF(">> tl:%u t:%u ct:%u tr:%u\n pl:%zd pn:%zd pr:%zd\n", (unsigned)time_left, (unsigned)time, (unsigned)currpts, (unsigned)time_right, pos_left, pos_new, pos_right); } @@ -453,14 +453,14 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) state = STATE3; /* Last scan was late */ sk.dir = SSCAN_REVERSE; - DEBUGF("<< tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", + DEBUGF("<< tl:%u t:%u ct:%u tr:%u\n pl:%zd pn:%zd pr:%zd\n", (unsigned)time_left, (unsigned)time, (unsigned)currpts, (unsigned)time_right, pos_left, pos_new, pos_right); } else { /* Exact match - it happens */ - DEBUGF("|| tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", + DEBUGF("|| tl:%u t:%u ct:%u tr:%u\n pl:%zd pn:%zd pr:%zd\n", (unsigned)time_left, (unsigned)time, (unsigned)currpts, (unsigned)time_right, pos_left, pos_new, pos_right); pts = currpts; @@ -492,7 +492,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) * will find it. */ pos_new = pos_left; sk.dir = SSCAN_FORWARD; - DEBUGF("?? tl:%u t:%u ct:%u tr:%u\n pl:%ld pn:%ld pr:%ld\n", + DEBUGF("?? tl:%u t:%u ct:%u tr:%u\n pl:%zd pn:%zd pr:%zd\n", (unsigned)time_left, (unsigned)time, (unsigned)currpts, (unsigned)time_right, pos_left, pos_new, pos_right); state = STATE1; @@ -521,7 +521,7 @@ static off_t mpeg_parser_seek_PTS(uint32_t time, unsigned id) sk.dir = SSCAN_FORWARD; uint32_t nextpts = mpeg_parser_scan_pts(&sk, id); - DEBUGF("Seek pos:%ld pts:%u t:%u next pts:%u \n", + DEBUGF("Seek pos:%zd pts:%u t:%u next pts:%u \n", pos, (unsigned)pts, (unsigned)time, (unsigned)nextpts); if (pts <= time && time < nextpts) @@ -608,7 +608,7 @@ try_again: str_parser.parms.sd.sk.len = 1024*1024; str_parser.parms.sd.sk.dir = SSCAN_FORWARD; - DEBUGF("thumb pos:%ld len:%ld\n", str_parser.parms.sd.sk.pos, + DEBUGF("thumb pos:%ld len:%zd\n", str_parser.parms.sd.sk.pos, str_parser.parms.sd.sk.len); result = str_send_msg(&video_str, STREAM_SYNC, diff --git a/apps/plugins/mpegplayer/pcm_output.c b/apps/plugins/mpegplayer/pcm_output.c index a5d8f86e5..cd6c45f71 100644 --- a/apps/plugins/mpegplayer/pcm_output.c +++ b/apps/plugins/mpegplayer/pcm_output.c @@ -99,7 +99,7 @@ static void get_more(unsigned char **start, size_t *size) /* Just show a warning about this - will never happen * without a bug in the audio thread code or a clobbered * buffer */ - DEBUGF("get_more: invalid size (%ld)\n", (long)sz); + DEBUGF("get_more: invalid size (%zd)\n", sz); } if (offset < -100*CLOCK_RATE/1000) -- 2.11.4.GIT