diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-03-17 10:50:58 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-03-17 10:50:58 +0000 |
commit | bd5c0ad7bb93a661ce284f427faab01513a1e28a (patch) | |
tree | 5700a37c5985937375a9c952dbaca9890afaf565 /apps/codecs | |
parent | 341b03a24229f16bba98f88832a07d37b834eb63 (diff) | |
download | rockbox-bd5c0ad7bb93a661ce284f427faab01513a1e28a.tar.gz rockbox-bd5c0ad7bb93a661ce284f427faab01513a1e28a.zip |
Cast some more to keep both 32 bit and 64 bit simulator platforms happy.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12819 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
-rw-r--r-- | apps/codecs/adx.c | 8 | ||||
-rw-r--r-- | apps/codecs/aiff.c | 5 | ||||
-rw-r--r-- | apps/codecs/libm4a/demux.c | 27 | ||||
-rw-r--r-- | apps/codecs/spc.c | 2 | ||||
-rw-r--r-- | apps/codecs/spc/Spc_Dsp.h | 6 | ||||
-rw-r--r-- | apps/codecs/wav.c | 7 |
6 files changed, 33 insertions, 22 deletions
diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c index d85269f999..bf339675c7 100644 --- a/apps/codecs/adx.c +++ b/apps/codecs/adx.c | |||
@@ -83,7 +83,7 @@ next_track: | |||
83 | } | 83 | } |
84 | bufsize = n; | 84 | bufsize = n; |
85 | bufoff = 0; | 85 | bufoff = 0; |
86 | DEBUGF("ADX: read size = %x\n",bufsize); | 86 | DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize); |
87 | 87 | ||
88 | /* Get file header for starting offset, channel count */ | 88 | /* Get file header for starting offset, channel count */ |
89 | 89 | ||
@@ -92,7 +92,7 @@ next_track: | |||
92 | 92 | ||
93 | /* useful for seeking and reporting current playback position */ | 93 | /* useful for seeking and reporting current playback position */ |
94 | avgbytespersec = ci->id3->frequency * 18 * channels / 32; | 94 | avgbytespersec = ci->id3->frequency * 18 * channels / 32; |
95 | DEBUGF("avgbytespersec=%ld\n",avgbytespersec); | 95 | DEBUGF("avgbytespersec=%ld\n",(unsigned long)avgbytespersec); |
96 | 96 | ||
97 | /* Get loop data */ | 97 | /* Get loop data */ |
98 | 98 | ||
@@ -232,14 +232,14 @@ next_track: | |||
232 | ci->seek_buffer(bufoff); | 232 | ci->seek_buffer(bufoff); |
233 | buf = ci->request_buffer(&n, ci->filesize-bufoff); | 233 | buf = ci->request_buffer(&n, ci->filesize-bufoff); |
234 | bufsize = n; | 234 | bufsize = n; |
235 | DEBUGF("ADX: read size = %x\n",bufsize); | 235 | DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize); |
236 | if ((off_t)bufsize < channels*18) { | 236 | if ((off_t)bufsize < channels*18) { |
237 | /* if we can't get a full frame, just request a single | 237 | /* if we can't get a full frame, just request a single |
238 | frame (should be able to fit it in the guard buffer) */ | 238 | frame (should be able to fit it in the guard buffer) */ |
239 | DEBUGF("ADX: requesting single frame at %lx\n",bufoff); | 239 | DEBUGF("ADX: requesting single frame at %lx\n",bufoff); |
240 | buf = ci->request_buffer(&n, channels*18); | 240 | buf = ci->request_buffer(&n, channels*18); |
241 | bufsize=n; | 241 | bufsize=n; |
242 | DEBUGF("ADX: read size = %x\n",bufsize); | 242 | DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize); |
243 | } | 243 | } |
244 | if (!buf) { | 244 | if (!buf) { |
245 | DEBUGF("ADX: couldn't get buffer at %lx size %lx\n", | 245 | DEBUGF("ADX: couldn't get buffer at %lx size %lx\n", |
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c index e154bce583..4fed9c0c9e 100644 --- a/apps/codecs/aiff.c +++ b/apps/codecs/aiff.c | |||
@@ -99,7 +99,8 @@ next_track: | |||
99 | i = ((buf[4]<<24)|(buf[5]<<16)|(buf[6]<<8)|buf[7]); | 99 | i = ((buf[4]<<24)|(buf[5]<<16)|(buf[6]<<8)|buf[7]); |
100 | if (memcmp(buf, "COMM", 4) == 0) { | 100 | if (memcmp(buf, "COMM", 4) == 0) { |
101 | if (i != 18) { | 101 | if (i != 18) { |
102 | DEBUGF("CODEC_ERROR: 'COMM' chunk size=%lu != 18\n", i); | 102 | DEBUGF("CODEC_ERROR: 'COMM' chunk size=%lu != 18\n", |
103 | (unsigned long)i); | ||
103 | i = CODEC_ERROR; | 104 | i = CODEC_ERROR; |
104 | goto done; | 105 | goto done; |
105 | } | 106 | } |
@@ -136,7 +137,7 @@ next_track: | |||
136 | i = 8 + offset2snd; /* advance to the beginning of data */ | 137 | i = 8 + offset2snd; /* advance to the beginning of data */ |
137 | } else { | 138 | } else { |
138 | DEBUGF("unsupported AIFF chunk: '%c%c%c%c', size=%lu\n", | 139 | DEBUGF("unsupported AIFF chunk: '%c%c%c%c', size=%lu\n", |
139 | buf[0], buf[1], buf[2], buf[3], i); | 140 | buf[0], buf[1], buf[2], buf[3], (unsigned long)i); |
140 | } | 141 | } |
141 | 142 | ||
142 | if (i & 0x01) /* odd chunk sizes must be padded */ | 143 | if (i & 0x01) /* odd chunk sizes must be padded */ |
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c index 29cbba7402..634bb4ffca 100644 --- a/apps/codecs/libm4a/demux.c +++ b/apps/codecs/libm4a/demux.c | |||
@@ -139,7 +139,8 @@ static bool read_chunk_esds(qtmovie_t *qtmovie, size_t chunk_len) | |||
139 | temp=stream_read_int32(qtmovie->stream);//0x15000414 ???? | 139 | temp=stream_read_int32(qtmovie->stream);//0x15000414 ???? |
140 | maxBitrate = stream_read_int32(qtmovie->stream); | 140 | maxBitrate = stream_read_int32(qtmovie->stream); |
141 | avgBitrate = stream_read_int32(qtmovie->stream); | 141 | avgBitrate = stream_read_int32(qtmovie->stream); |
142 | DEBUGF("audioType=%d, maxBitrate=%ld, avgBitrate=%ld\n",audioType,maxBitrate,avgBitrate); | 142 | DEBUGF("audioType=%d, maxBitrate=%ld, avgBitrate=%ld\n",audioType, |
143 | (long)maxBitrate,(long)avgBitrate); | ||
143 | 144 | ||
144 | /* get and verify DecSpecificInfoTag */ | 145 | /* get and verify DecSpecificInfoTag */ |
145 | if (stream_read_uint8(qtmovie->stream) != 0x05) | 146 | if (stream_read_uint8(qtmovie->stream) != 0x05) |
@@ -257,7 +258,8 @@ static bool read_chunk_stsd(qtmovie_t *qtmovie, size_t chunk_len) | |||
257 | sub_chunk_len = stream_read_uint32(qtmovie->stream); | 258 | sub_chunk_len = stream_read_uint32(qtmovie->stream); |
258 | if (sub_chunk_len <= 1 || sub_chunk_len > entry_remaining) | 259 | if (sub_chunk_len <= 1 || sub_chunk_len > entry_remaining) |
259 | { | 260 | { |
260 | DEBUGF("strange size (%u) for chunk inside mp4a\n", sub_chunk_len); | 261 | DEBUGF("strange size (%lu) for chunk inside mp4a\n", |
262 | (unsigned long)sub_chunk_len); | ||
261 | return false; | 263 | return false; |
262 | } | 264 | } |
263 | 265 | ||
@@ -281,7 +283,7 @@ static bool read_chunk_stsd(qtmovie_t *qtmovie, size_t chunk_len) | |||
281 | return false; | 283 | return false; |
282 | } | 284 | } |
283 | 285 | ||
284 | DEBUGF("entry_remaining=%ld\n",entry_remaining); | 286 | DEBUGF("entry_remaining=%ld\n",(long)entry_remaining); |
285 | stream_skip(qtmovie->stream,entry_remaining); | 287 | stream_skip(qtmovie->stream,entry_remaining); |
286 | 288 | ||
287 | } else { | 289 | } else { |
@@ -379,7 +381,7 @@ static bool read_chunk_stsz(qtmovie_t *qtmovie, size_t chunk_len) | |||
379 | 381 | ||
380 | if (v > 0x0000ffff) | 382 | if (v > 0x0000ffff) |
381 | { | 383 | { |
382 | DEBUGF("stsz[%d] > 65 kB (%ld)\n", i, v); | 384 | DEBUGF("stsz[%d] > 65 kB (%ld)\n", i, (long)v); |
383 | return false; | 385 | return false; |
384 | } | 386 | } |
385 | 387 | ||
@@ -488,7 +490,8 @@ static bool read_chunk_stbl(qtmovie_t *qtmovie, size_t chunk_len) | |||
488 | sub_chunk_len = stream_read_uint32(qtmovie->stream); | 490 | sub_chunk_len = stream_read_uint32(qtmovie->stream); |
489 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) | 491 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) |
490 | { | 492 | { |
491 | DEBUGF("strange size (%u) for chunk inside stbl\n", sub_chunk_len); | 493 | DEBUGF("strange size (%lu) for chunk inside stbl\n", |
494 | (unsigned long)sub_chunk_len); | ||
492 | return false; | 495 | return false; |
493 | } | 496 | } |
494 | 497 | ||
@@ -545,7 +548,7 @@ static bool read_chunk_minf(qtmovie_t *qtmovie, size_t chunk_len) | |||
545 | 548 | ||
546 | if ((i = stream_read_uint32(qtmovie->stream)) != 16) | 549 | if ((i = stream_read_uint32(qtmovie->stream)) != 16) |
547 | { | 550 | { |
548 | DEBUGF("unexpected size in media info: %ld\n",i); | 551 | DEBUGF("unexpected size in media info: %ld\n", (long)i); |
549 | stream_skip(qtmovie->stream, size_remaining-4); | 552 | stream_skip(qtmovie->stream, size_remaining-4); |
550 | return true; | 553 | return true; |
551 | } | 554 | } |
@@ -569,7 +572,8 @@ static bool read_chunk_minf(qtmovie_t *qtmovie, size_t chunk_len) | |||
569 | 572 | ||
570 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) | 573 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) |
571 | { | 574 | { |
572 | DEBUGF("strange size (%u) for chunk inside minf\n", sub_chunk_len); | 575 | DEBUGF("strange size (%lu) for chunk inside minf\n", |
576 | (unsigned long)sub_chunk_len); | ||
573 | return false; | 577 | return false; |
574 | } | 578 | } |
575 | 579 | ||
@@ -606,7 +610,8 @@ static bool read_chunk_mdia(qtmovie_t *qtmovie, size_t chunk_len) | |||
606 | sub_chunk_len = stream_read_uint32(qtmovie->stream); | 610 | sub_chunk_len = stream_read_uint32(qtmovie->stream); |
607 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) | 611 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) |
608 | { | 612 | { |
609 | DEBUGF("strange size (%u) for chunk inside mdia\n", sub_chunk_len); | 613 | DEBUGF("strange size (%lu) for chunk inside mdia\n", |
614 | (unsigned long)sub_chunk_len); | ||
610 | return false; | 615 | return false; |
611 | } | 616 | } |
612 | 617 | ||
@@ -644,7 +649,8 @@ static bool read_chunk_trak(qtmovie_t *qtmovie, size_t chunk_len) | |||
644 | sub_chunk_len = stream_read_uint32(qtmovie->stream); | 649 | sub_chunk_len = stream_read_uint32(qtmovie->stream); |
645 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) | 650 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) |
646 | { | 651 | { |
647 | DEBUGF("strange size (%u) for chunk inside trak\n", sub_chunk_len); | 652 | DEBUGF("strange size (%lu) for chunk inside trak\n", |
653 | (unsigned long)sub_chunk_len); | ||
648 | return false; | 654 | return false; |
649 | } | 655 | } |
650 | 656 | ||
@@ -682,7 +688,8 @@ static bool read_chunk_moov(qtmovie_t *qtmovie, size_t chunk_len) | |||
682 | sub_chunk_len = stream_read_uint32(qtmovie->stream); | 688 | sub_chunk_len = stream_read_uint32(qtmovie->stream); |
683 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) | 689 | if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining) |
684 | { | 690 | { |
685 | DEBUGF("strange size (%u) for chunk inside moov\n", sub_chunk_len); | 691 | DEBUGF("strange size (%lu) for chunk inside moov\n", |
692 | (unsigned long)sub_chunk_len); | ||
686 | return false; | 693 | return false; |
687 | } | 694 | } |
688 | 695 | ||
diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c index 61376a5770..6c791b46a1 100644 --- a/apps/codecs/spc.c +++ b/apps/codecs/spc.c | |||
@@ -859,7 +859,7 @@ enum codec_status codec_main(void) | |||
859 | return CODEC_ERROR; | 859 | return CODEC_ERROR; |
860 | } | 860 | } |
861 | 861 | ||
862 | DEBUGF("SPC: read size = 0x%x\n",buffersize); | 862 | DEBUGF("SPC: read size = 0x%lx\n",(unsigned long)buffersize); |
863 | do | 863 | do |
864 | { | 864 | { |
865 | SPC_Init(&spc_emu); | 865 | SPC_Init(&spc_emu); |
diff --git a/apps/codecs/spc/Spc_Dsp.h b/apps/codecs/spc/Spc_Dsp.h index 3f66919db2..d670b20c52 100644 --- a/apps/codecs/spc/Spc_Dsp.h +++ b/apps/codecs/spc/Spc_Dsp.h | |||
@@ -298,7 +298,8 @@ static void decode_brr( struct Spc_Dsp* this, unsigned start_addr, | |||
298 | if ( addr == loop_ptr ) | 298 | if ( addr == loop_ptr ) |
299 | { | 299 | { |
300 | loop_start = out; | 300 | loop_start = out; |
301 | DEBUGF( "loop at %08x (wave #%d)\n", addr - RAM, raw_voice->waveform ); | 301 | DEBUGF( "loop at %08lx (wave #%d)\n", |
302 | (unsigned long)(addr - RAM), raw_voice->waveform ); | ||
302 | } | 303 | } |
303 | 304 | ||
304 | /* header */ | 305 | /* header */ |
@@ -398,7 +399,8 @@ static void decode_brr( struct Spc_Dsp* this, unsigned start_addr, | |||
398 | } | 399 | } |
399 | } | 400 | } |
400 | 401 | ||
401 | DEBUGF( "end at %08x (wave #%d)\n", addr - RAM, raw_voice->waveform ); | 402 | DEBUGF( "end at %08lx (wave #%d)\n", |
403 | (unsigned long)(addr - RAM), raw_voice->waveform ); | ||
402 | 404 | ||
403 | /* add to cache */ | 405 | /* add to cache */ |
404 | this->wave_entry_old [this->oldsize++] = *wave_entry; | 406 | this->wave_entry_old [this->oldsize++] = *wave_entry; |
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index f45953a118..ae29bdedc7 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c | |||
@@ -276,7 +276,8 @@ next_track: | |||
276 | i = (buf[4]|(buf[5]<<8)|(buf[6]<<16)|(buf[7]<<24)); | 276 | i = (buf[4]|(buf[5]<<8)|(buf[6]<<16)|(buf[7]<<24)); |
277 | if (memcmp(buf, "fmt ", 4) == 0) { | 277 | if (memcmp(buf, "fmt ", 4) == 0) { |
278 | if (i < 16) { | 278 | if (i < 16) { |
279 | DEBUGF("CODEC_ERROR: 'fmt ' chunk size=%lu < 16\n", i); | 279 | DEBUGF("CODEC_ERROR: 'fmt ' chunk size=%lu < 16\n", |
280 | (unsigned long)i); | ||
280 | i = CODEC_ERROR; | 281 | i = CODEC_ERROR; |
281 | goto done; | 282 | goto done; |
282 | } | 283 | } |
@@ -298,7 +299,7 @@ next_track: | |||
298 | * we'll see later if we can't decode it */ | 299 | * we'll see later if we can't decode it */ |
299 | DEBUGF("CODEC_WARNING: non-PCM WAVE (formattag=0x%x) " | 300 | DEBUGF("CODEC_WARNING: non-PCM WAVE (formattag=0x%x) " |
300 | "doesn't have ext. fmt descr (chunksize=%ld<18).\n", | 301 | "doesn't have ext. fmt descr (chunksize=%ld<18).\n", |
301 | formattag, i); | 302 | formattag, (long)i); |
302 | } | 303 | } |
303 | size = buf[24]|(buf[25]<<8); | 304 | size = buf[24]|(buf[25]<<8); |
304 | if (formattag == WAVE_FORMAT_DVI_ADPCM) { | 305 | if (formattag == WAVE_FORMAT_DVI_ADPCM) { |
@@ -335,7 +336,7 @@ next_track: | |||
335 | totalsamples = (buf[8]|(buf[9]<<8)|(buf[10]<<16)|(buf[11]<<24)); | 336 | totalsamples = (buf[8]|(buf[9]<<8)|(buf[10]<<16)|(buf[11]<<24)); |
336 | } else { | 337 | } else { |
337 | DEBUGF("unknown WAVE chunk: '%c%c%c%c', size=%lu\n", | 338 | DEBUGF("unknown WAVE chunk: '%c%c%c%c', size=%lu\n", |
338 | buf[0], buf[1], buf[2], buf[3], i); | 339 | buf[0], buf[1], buf[2], buf[3], (unsigned long)i); |
339 | } | 340 | } |
340 | 341 | ||
341 | /* go to next chunk (even chunk sizes must be padded) */ | 342 | /* go to next chunk (even chunk sizes must be padded) */ |