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
diff --git a/apps/codecs/adx.c b/apps/codecs/adx.c
index d85269f..bf33967 100644
--- a/apps/codecs/adx.c
+++ b/apps/codecs/adx.c
@@ -83,7 +83,7 @@
     }
     bufsize = n;
     bufoff = 0;
-    DEBUGF("ADX: read size = %x\n",bufsize);
+    DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize);
 
     /* Get file header for starting offset, channel count */
     
@@ -92,7 +92,7 @@
     
     /* useful for seeking and reporting current playback position */
     avgbytespersec = ci->id3->frequency * 18 * channels / 32;
-    DEBUGF("avgbytespersec=%ld\n",avgbytespersec);
+    DEBUGF("avgbytespersec=%ld\n",(unsigned long)avgbytespersec);
 
     /* Get loop data */
     
@@ -232,14 +232,14 @@
             ci->seek_buffer(bufoff);
             buf = ci->request_buffer(&n, ci->filesize-bufoff);
             bufsize = n;
-            DEBUGF("ADX: read size = %x\n",bufsize);
+            DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize);
             if ((off_t)bufsize < channels*18) {
                 /* if we can't get a full frame, just request a single
                    frame (should be able to fit it in the guard buffer) */
                 DEBUGF("ADX: requesting single frame at %lx\n",bufoff);
                 buf = ci->request_buffer(&n, channels*18);
                 bufsize=n;
-                DEBUGF("ADX: read size = %x\n",bufsize);
+                DEBUGF("ADX: read size = %lx\n",(unsigned long)bufsize);
             }
             if (!buf) {
                 DEBUGF("ADX: couldn't get buffer at %lx size %lx\n",
diff --git a/apps/codecs/aiff.c b/apps/codecs/aiff.c
index e154bce..4fed9c0 100644
--- a/apps/codecs/aiff.c
+++ b/apps/codecs/aiff.c
@@ -99,7 +99,8 @@
         i = ((buf[4]<<24)|(buf[5]<<16)|(buf[6]<<8)|buf[7]);
         if (memcmp(buf, "COMM", 4) == 0) {
             if (i != 18) {
-                DEBUGF("CODEC_ERROR: 'COMM' chunk size=%lu != 18\n", i);
+                DEBUGF("CODEC_ERROR: 'COMM' chunk size=%lu != 18\n",
+                       (unsigned long)i);
                 i = CODEC_ERROR;
                 goto done;
             }
@@ -136,7 +137,7 @@
             i = 8 + offset2snd; /* advance to the beginning of data */
         } else {
             DEBUGF("unsupported AIFF chunk: '%c%c%c%c', size=%lu\n",
-                   buf[0], buf[1], buf[2], buf[3], i);
+                   buf[0], buf[1], buf[2], buf[3], (unsigned long)i);
         }
 
         if (i & 0x01) /* odd chunk sizes must be padded */
diff --git a/apps/codecs/libm4a/demux.c b/apps/codecs/libm4a/demux.c
index 29cbba7..634bb4f 100644
--- a/apps/codecs/libm4a/demux.c
+++ b/apps/codecs/libm4a/demux.c
@@ -139,7 +139,8 @@
     temp=stream_read_int32(qtmovie->stream);//0x15000414 ????
     maxBitrate = stream_read_int32(qtmovie->stream);
     avgBitrate = stream_read_int32(qtmovie->stream);
-    DEBUGF("audioType=%d, maxBitrate=%ld, avgBitrate=%ld\n",audioType,maxBitrate,avgBitrate);
+    DEBUGF("audioType=%d, maxBitrate=%ld, avgBitrate=%ld\n",audioType,
+           (long)maxBitrate,(long)avgBitrate);
 
     /* get and verify DecSpecificInfoTag */
     if (stream_read_uint8(qtmovie->stream) != 0x05)
@@ -257,7 +258,8 @@
           sub_chunk_len = stream_read_uint32(qtmovie->stream);
           if (sub_chunk_len <= 1 || sub_chunk_len > entry_remaining)
           {
-              DEBUGF("strange size (%u) for chunk inside mp4a\n", sub_chunk_len);
+              DEBUGF("strange size (%lu) for chunk inside mp4a\n",
+                     (unsigned long)sub_chunk_len);
               return false;
           }
 
@@ -281,7 +283,7 @@
               return false;
           }
 
-          DEBUGF("entry_remaining=%ld\n",entry_remaining);
+          DEBUGF("entry_remaining=%ld\n",(long)entry_remaining);
           stream_skip(qtmovie->stream,entry_remaining);
 
         } else {
@@ -379,7 +381,7 @@
         
         if (v > 0x0000ffff)
         {
-            DEBUGF("stsz[%d] > 65 kB (%ld)\n", i, v);
+            DEBUGF("stsz[%d] > 65 kB (%ld)\n", i, (long)v);
             return false;
         }
         
@@ -488,7 +490,8 @@
         sub_chunk_len = stream_read_uint32(qtmovie->stream);
         if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
         {
-            DEBUGF("strange size (%u) for chunk inside stbl\n", sub_chunk_len);
+            DEBUGF("strange size (%lu) for chunk inside stbl\n",
+                   (unsigned long)sub_chunk_len);
             return false;
         }
 
@@ -545,7 +548,7 @@
 
     if ((i = stream_read_uint32(qtmovie->stream)) != 16)
     {
-        DEBUGF("unexpected size in media info: %ld\n",i);
+        DEBUGF("unexpected size in media info: %ld\n", (long)i);
         stream_skip(qtmovie->stream, size_remaining-4);
         return true;
     }
@@ -569,7 +572,8 @@
 
         if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
         {
-            DEBUGF("strange size (%u) for chunk inside minf\n", sub_chunk_len);
+            DEBUGF("strange size (%lu) for chunk inside minf\n",
+                   (unsigned long)sub_chunk_len);
             return false;
         }
 
@@ -606,7 +610,8 @@
         sub_chunk_len = stream_read_uint32(qtmovie->stream);
         if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
         {
-            DEBUGF("strange size (%u) for chunk inside mdia\n", sub_chunk_len);
+            DEBUGF("strange size (%lu) for chunk inside mdia\n",
+                   (unsigned long)sub_chunk_len);
             return false;
         }
 
@@ -644,7 +649,8 @@
         sub_chunk_len = stream_read_uint32(qtmovie->stream);
         if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
         {
-            DEBUGF("strange size (%u) for chunk inside trak\n", sub_chunk_len);
+            DEBUGF("strange size (%lu) for chunk inside trak\n",
+                   (unsigned long)sub_chunk_len);
             return false;
         }
 
@@ -682,7 +688,8 @@
         sub_chunk_len = stream_read_uint32(qtmovie->stream);
         if (sub_chunk_len <= 1 || sub_chunk_len > size_remaining)
         {
-            DEBUGF("strange size (%u) for chunk inside moov\n", sub_chunk_len);
+            DEBUGF("strange size (%lu) for chunk inside moov\n",
+                   (unsigned long)sub_chunk_len);
             return false;
         }
 
diff --git a/apps/codecs/spc.c b/apps/codecs/spc.c
index 61376a5..6c791b4 100644
--- a/apps/codecs/spc.c
+++ b/apps/codecs/spc.c
@@ -859,7 +859,7 @@
             return CODEC_ERROR;
         }
 
-        DEBUGF("SPC: read size = 0x%x\n",buffersize);
+        DEBUGF("SPC: read size = 0x%lx\n",(unsigned long)buffersize);
         do
         {
             SPC_Init(&spc_emu);
diff --git a/apps/codecs/spc/Spc_Dsp.h b/apps/codecs/spc/Spc_Dsp.h
index 3f66919..d670b20 100644
--- a/apps/codecs/spc/Spc_Dsp.h
+++ b/apps/codecs/spc/Spc_Dsp.h
@@ -298,7 +298,8 @@
             if ( addr == loop_ptr )
             {
                 loop_start = out;
-                DEBUGF( "loop at %08x (wave #%d)\n", addr - RAM, raw_voice->waveform );
+                DEBUGF( "loop at %08lx (wave #%d)\n",
+                        (unsigned long)(addr - RAM), raw_voice->waveform );
             }
             
             /* header */
@@ -398,7 +399,8 @@
             }
         }
         
-        DEBUGF( "end at %08x (wave #%d)\n", addr - RAM, raw_voice->waveform );
+        DEBUGF( "end at %08lx (wave #%d)\n",
+                (unsigned long)(addr - RAM), raw_voice->waveform );
         
         /* add to cache */
         this->wave_entry_old [this->oldsize++] = *wave_entry;
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c
index f45953a..ae29bde 100644
--- a/apps/codecs/wav.c
+++ b/apps/codecs/wav.c
@@ -276,7 +276,8 @@
         i = (buf[4]|(buf[5]<<8)|(buf[6]<<16)|(buf[7]<<24));
         if (memcmp(buf, "fmt ", 4) == 0) {
             if (i < 16) {
-                DEBUGF("CODEC_ERROR: 'fmt ' chunk size=%lu < 16\n", i);
+                DEBUGF("CODEC_ERROR: 'fmt ' chunk size=%lu < 16\n",
+                       (unsigned long)i);
                 i = CODEC_ERROR;
                 goto done;
             }
@@ -298,7 +299,7 @@
                      * we'll see later if we can't decode it */
                     DEBUGF("CODEC_WARNING: non-PCM WAVE (formattag=0x%x) "
                            "doesn't have ext. fmt descr (chunksize=%ld<18).\n",
-                           formattag, i);
+                           formattag, (long)i);
                 }
                 size = buf[24]|(buf[25]<<8);
                 if (formattag == WAVE_FORMAT_DVI_ADPCM) {
@@ -335,7 +336,7 @@
                 totalsamples = (buf[8]|(buf[9]<<8)|(buf[10]<<16)|(buf[11]<<24));
         } else {
             DEBUGF("unknown WAVE chunk: '%c%c%c%c', size=%lu\n",
-                   buf[0], buf[1], buf[2], buf[3], i);
+                   buf[0], buf[1], buf[2], buf[3], (unsigned long)i);
         }
 
         /* go to next chunk (even chunk sizes must be padded) */
diff --git a/apps/plugins/dict.c b/apps/plugins/dict.c
index 82c6afc..cdb7c94 100644
--- a/apps/plugins/dict.c
+++ b/apps/plugins/dict.c
@@ -179,7 +179,7 @@
     filesize = rb->filesize(fIndex); /* get filesize */
 
     DEBUGF("Filesize: %d bytes = %d words \n", filesize,
-           (filesize / sizeof(struct stWord)));
+           (filesize / (int)sizeof(struct stWord)));
 
     /* for the searching algorithm */
     high = filesize / sizeof( struct stWord );
diff --git a/apps/plugins/wav2wv.c b/apps/plugins/wav2wv.c
index 69ccfa5..34f0317 100644
--- a/apps/plugins/wav2wv.c
+++ b/apps/plugins/wav2wv.c
@@ -80,7 +80,8 @@
         compression = (int)(((int64_t)(bytes_read - bytes_written) * 100 +
             (bytes_read/2)) / bytes_read);
 
-    rb->snprintf(buf, 32, "elapsed time: %ld secs", (elapsed_ticks + (HZ/2)) / HZ);
+    rb->snprintf(buf, 32, "elapsed time: %ld secs",
+                 (long)(elapsed_ticks + (HZ/2)) / HZ);
     rb->lcd_puts(0, 2, (unsigned char *)buf);
 
     rb->snprintf(buf, 32, "progress: %d%%", progress);
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 45a9b72..74b9df6 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -221,7 +221,7 @@
     {
         DEBUGF("Resume index %X offset %lX\n",
                global_status.resume_index,
-               global_status.resume_offset);
+               (unsigned long)global_status.resume_offset);
         if (playlist_resume() != -1)
         {
             playlist_start(global_status.resume_index,
diff --git a/uisimulator/common/io.c b/uisimulator/common/io.c
index a91b709..b03dc01 100644
--- a/uisimulator/common/io.c
+++ b/uisimulator/common/io.c
@@ -331,8 +331,8 @@
     struct statfs fs;
 
     if (!statfs(".", &fs)) {
-        DEBUGF("statfs: bsize=%d blocks=%d free=%d\n",
-               fs.f_bsize, fs.f_blocks, fs.f_bfree);
+        DEBUGF("statfs: bsize=%d blocks=%ld free=%ld\n",
+               (int)fs.f_bsize, fs.f_blocks, fs.f_bfree);
         if (size)
             *size = fs.f_blocks * (fs.f_bsize / 1024);
         if (free)