]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
compiler warning cleanups.
authorToni Wilen <twilen@winuae.net>
Mon, 28 Jul 2014 16:45:15 +0000 (19:45 +0300)
committerToni Wilen <twilen@winuae.net>
Mon, 28 Jul 2014 16:45:15 +0000 (19:45 +0300)
archivers/dms/pfile.cpp
archivers/zip/unzip.cpp
archivers/zip/unzip.h
enforcer.cpp
isofs.cpp

index ef064746611eeceffbc13a0287f16918ace77eb0..87f93b909bc09ad2fdef55aff44ab4591ce76867 100644 (file)
@@ -54,7 +54,7 @@ static void log_error(int track)
        write_log (_T("DMS: Ignored error on track %d!\n"), track);
 }
 
-static void addextra(TCHAR *name, struct zfile **extra, uae_u8 *p, int size)
+static void addextra(const TCHAR *name, struct zfile **extra, uae_u8 *p, int size)
 {
        int i;
        struct zfile *zf = NULL;
@@ -244,7 +244,6 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
                else {
                        Init_Decrunchers();
                        for (;;) {
-                               int ok = 0;
                                ret = Process_Track(fi,fo,b1,b2,cmd,opt,geninfo,extra);
                                if (ret == DMS_FILE_END)
                                        break;
@@ -252,6 +251,7 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o
                                        continue;
                                break;
 #if 0
+                               int ok = 0;
                                while (!ok) {
                                        uae_u8 b1[THLEN];
 
index c8a77a588fff8ee621d9560016022ab9580b7ee7..62ce21687b3df897d58763209a60bf92e8f13c07 100644 (file)
@@ -501,11 +501,12 @@ local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
 
 
        /* we check the magic */
-       if (err==UNZ_OK)
+       if (err==UNZ_OK) {
                if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
                        err=UNZ_ERRNO;
                else if (uMagic!=0x02014b50)
                        err=UNZ_BADZIPFILE;
+       }
 
        if (unzlocal_getShort(s->file,&file_info.version) != UNZ_OK)
                err=UNZ_ERRNO;
@@ -581,11 +582,12 @@ local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
                else
                        uSizeRead = extraFieldBufferSize;
 
-               if (lSeek!=0)
+               if (lSeek!=0) {
                        if (zfile_fseek(s->file,lSeek,SEEK_CUR)==0)
                                lSeek=0;
                        else
                                err=UNZ_ERRNO;
+               }
                if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0))
                        if (zfile_fread(extraField,(uInt)uSizeRead,1,s->file)!=1)
                                err=UNZ_ERRNO;
@@ -606,11 +608,12 @@ local int unzlocal_GetCurrentFileInfoInternal (unzFile file,
                else
                        uSizeRead = commentBufferSize;
 
-               if (lSeek!=0)
+               if (lSeek!=0) {
                        if (zfile_fseek(s->file,lSeek,SEEK_CUR)==0)
                                lSeek=0;
                        else
                                err=UNZ_ERRNO;
+               }
                if ((file_info.size_file_comment>0) && (commentBufferSize>0))
                        if (zfile_fread(szComment,(uInt)uSizeRead,1,s->file)!=1)
                                err=UNZ_ERRNO;
@@ -773,11 +776,12 @@ local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, uInt *piSizeVar,
                return UNZ_ERRNO;
 
 
-       if (err==UNZ_OK)
+       if (err==UNZ_OK) {
                if (unzlocal_getLong(s->file,&uMagic) != UNZ_OK)
                        err=UNZ_ERRNO;
                else if (uMagic!=0x04034b50)
                        err=UNZ_BADZIPFILE;
+       }
 
        if (unzlocal_getShort(s->file,&uData) != UNZ_OK)
                err=UNZ_ERRNO;
@@ -884,7 +888,7 @@ extern int ZEXPORT unzOpenCurrentFile (unzFile file)
 
        if ((s->cur_file_info.compression_method!=0) &&
        (s->cur_file_info.compression_method!=Z_DEFLATED)) {
-               write_log (_T("ZIP: unknown compression method %d\n"), s->cur_file_info.compression_method);
+               write_log (_T("ZIP: unknown compression method %lld\n"), s->cur_file_info.compression_method);
                err=UNZ_BADZIPFILE;
        }
        Store = s->cur_file_info.compression_method==0;
@@ -958,7 +962,7 @@ extern int ZEXPORT unzReadCurrentFile  (unzFile file, voidp buf, unsigned int le
                return UNZ_PARAMERROR;
 
 
-       if ((pfile_in_zip_read_info->read_buffer == NULL))
+       if (pfile_in_zip_read_info->read_buffer == NULL)
                return UNZ_END_OF_LIST_OF_FILE;
        if (len==0)
                return 0;
@@ -1205,7 +1209,6 @@ extern int ZEXPORT unzCloseCurrentFile (unzFile file)
 */
 extern int ZEXPORT unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
 {
-       int err=UNZ_OK;
        unz_s* s;
        uLong uReadThis ;
        if (file==NULL)
index 73882a2cee130b14e4d298138dc687f6291b21a8..45bc04b5cade516be3bb5661ca15fd60e23555ec 100644 (file)
@@ -49,6 +49,10 @@ extern "C" {
 #include "zlib.h"
 #endif
 
+#ifndef OF
+#define OF(args) args
+#endif
+
 typedef int (ZEXPORT *INFLATEINIT2)(z_streamp strm, int windowBits, const char *version, int stream_size);
 typedef int (ZEXPORT *INFLATEINIT)(z_streamp strm, const char *version, int stream_size);
 typedef int (ZEXPORT *INFLATEEND)(z_streamp strm);
index af5107e50c0d20f26184a3219852d3ee1e9086ec..3efa25640a88b2e46a92302c7805d11aea8478f0 100644 (file)
@@ -19,7 +19,7 @@
 #include "xwin.h"
 #include "enforcer.h"
 
-#if defined(AHI)
+#ifdef AHI
 
 #if defined(JIT)
 #define special_mem_r special_mem |= S_READ
@@ -169,7 +169,7 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc)
                                        } else {
                                                native_name = my_strdup (_T("Unknown"));
                                        }
-                                       _stprintf (buf, _T("----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n"), pc, native_name, hunk, offset);
+                                       _stprintf (buf, _T("----> %08x - \"%s\" Hunk %04lx Offset %08x\n"), pc, native_name, hunk, offset);
                                        xfree (native_name);
                                        return 1;
                                }
@@ -207,7 +207,7 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc)
                                uae_u32 offset = pc - (get_long (node + 8) << 2);
                                uaecptr mod = get_long (node + 20);
                                native_name = au ((char*)amiga2native (mod + 24, 100));
-                               _stprintf (buf, _T("----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n"), pc, native_name, hunk, offset);
+                               _stprintf (buf, _T("----> %08x - \"%s\" Hunk %04x Offset %08x\n"), pc, native_name, hunk, offset);
                                xfree (native_name);
                                return 1;
                        }
@@ -259,18 +259,18 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
        _tcscpy (enforcer_buf_ptr, _T("Enforcer Hit! Bad program\n"));
        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
 
-       _stprintf (buf, _T("Illegal %s: %08lx"), addressmode, addr);
-       _stprintf (enforcer_buf_ptr, _T("%-48sPC: %0lx\n"), buf, pc);
+       _stprintf (buf, _T("Illegal %s: %08x"), addressmode, addr);
+       _stprintf (enforcer_buf_ptr, _T("%-48sPC: %0x\n"), buf, pc);
        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
 
        /* Data registers */
-       _stprintf (enforcer_buf_ptr, _T("Data: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
+       _stprintf (enforcer_buf_ptr, _T("Data: %08x %08x %08x %08x %08x %08x %08x %08x\n"),
                m68k_dreg (regs, 0), m68k_dreg (regs, 1), m68k_dreg (regs, 2), m68k_dreg (regs, 3),
                m68k_dreg (regs, 4), m68k_dreg (regs, 5), m68k_dreg (regs, 6), m68k_dreg (regs, 7));
        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
 
        /* Address registers */
-       _stprintf (enforcer_buf_ptr, _T("Addr: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"),
+       _stprintf (enforcer_buf_ptr, _T("Addr: %08x %08x %08x %08x %08x %08x %08x %08x\n"),
                m68k_areg (regs, 0), m68k_areg (regs, 1), m68k_areg (regs, 2), m68k_areg (regs, 3),
                m68k_areg (regs, 4), m68k_areg (regs, 5), m68k_areg (regs, 6), m68k_areg (regs, 7));
        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
@@ -283,7 +283,7 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
                        _tcscpy (enforcer_buf_ptr, _T("Stck:"));
                        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
                }
-               _stprintf (enforcer_buf_ptr, _T(" %08lx"),get_long (a7));
+               _stprintf (enforcer_buf_ptr, _T(" %08x"),get_long (a7));
                enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
 
                if (i%8 == 7)
@@ -384,7 +384,7 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
                }
 
                sm68k_disasm (buf, instrcode, bestpc, NULL);
-               _stprintf (lines[i], _T("%08lx :   %-20s %s\n"), bestpc, instrcode, buf);
+               _stprintf (lines[i], _T("%08x :   %-20s %s\n"), bestpc, instrcode, buf);
                temppc = bestpc;
        }
 
@@ -398,19 +398,19 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
        temppc = pc;
        for (i = 0; i < (INSTRUCTIONLINES + 1) / 2; i++) {
                sm68k_disasm (buf, instrcode, temppc, &nextpc);
-               _stprintf (enforcer_buf_ptr, _T("%08lx : %s %-20s %s\n"), temppc,
+               _stprintf (enforcer_buf_ptr, _T("%08x : %s %-20s %s\n"), temppc,
                        (i == 0 ? _T("*") : _T(" ")), instrcode, buf);
                enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
                temppc = nextpc;
        }
 
        if (!native_task_name)
-               native_task_name = _T("Unknown");
+               native_task_name = my_strdup(_T("Unknown"));
        _stprintf (enforcer_buf_ptr, _T("Name: \"%s\"\n\n"), native_task_name);
        enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
 
        console_out (enforcer_buf);
-       write_log (enforcer_buf);
+       write_log (_T("%s"), enforcer_buf);
        sleep_millis (5);
        doflashscreen ();
 
@@ -693,4 +693,4 @@ int enforcer_disable (void)
        return 1;
 }
 
-#endif
+#endif // AHI
index 93306d1b642cdb6b89c2270ef6b6158343cf7870..a064907e72e6f5cbf32de98176947edac4d561f9 100644 (file)
--- a/isofs.cpp
+++ b/isofs.cpp
@@ -1546,10 +1546,10 @@ static TCHAR *get_joliet_filename(struct iso_directory_record * de, struct inode
  */
 static int isofs_get_blocks(struct inode *inode, uae_u32 iblock, struct buffer_head *bh, unsigned long nblocks)
 {
-       unsigned long b_off = iblock;
+       unsigned int b_off = iblock;
        unsigned offset, sect_size;
        unsigned int firstext;
-       unsigned long nextblk, nextoff;
+       unsigned int nextblk, nextoff;
        int section, rv, error;
        struct iso_inode_info *ei = ISOFS_I(inode);