]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
zarchive: mostly compilation warning fixes
authorFrode Solheim <frode-code@fengestad.no>
Tue, 29 Jul 2014 21:58:41 +0000 (23:58 +0200)
committerFrode Solheim <frode-code@fengestad.no>
Tue, 29 Jul 2014 21:58:41 +0000 (23:58 +0200)
include/zarchive.h
zfile_archive.cpp

index c4458a8a18d00967d3c06efd119e802258e71de7..c79ecd0d45ba60e8eb2997f62e69adab5e2d7817 100644 (file)
@@ -84,19 +84,21 @@ struct zarchive_info
        struct mytimeval tv;
 };
 
-#define ArchiveFormat7Zip '7z  '
-#define ArchiveFormatRAR 'rar '
-#define ArchiveFormatZIP 'zip '
-#define ArchiveFormatLHA 'lha '
-#define ArchiveFormatLZX 'lzx '
-#define ArchiveFormatPLAIN '----'
-#define ArchiveFormatDIR 'DIR '
-#define ArchiveFormatAA 'aa  ' // method only
-#define ArchiveFormatADF 'DOS '
-#define ArchiveFormatRDB 'RDSK'
-#define ArchiveFormatMBR 'MBR '
-#define ArchiveFormatFAT 'FAT '
-#define ArchiveFormatTAR 'tar '
+#define MCC(a,b,c,d) (((a)<<24) | ((b)<<16) | ((c)<<8) | (d))
+
+#define ArchiveFormat7Zip  MCC('7', 'z', ' ', ' ')
+#define ArchiveFormatRAR   MCC('r', 'a', 'r', ' ')
+#define ArchiveFormatZIP   MCC('z', 'i', 'p', ' ')
+#define ArchiveFormatLHA   MCC('l', 'h', 'a', ' ')
+#define ArchiveFormatLZX   MCC('l', 'z', 'x', ' ')
+#define ArchiveFormatPLAIN MCC('-', '-', '-', '-')
+#define ArchiveFormatDIR   MCC('D', 'I', 'R', ' ')
+#define ArchiveFormatAA    MCC('a', 'a', ' ', ' ') // method only
+#define ArchiveFormatADF   MCC('D', 'O', 'S', ' ')
+#define ArchiveFormatRDB   MCC('R', 'D', 'S', 'K')
+#define ArchiveFormatMBR   MCC('M', 'B', 'R', ' ')
+#define ArchiveFormatFAT   MCC('F', 'A', 'T', ' ')
+#define ArchiveFormatTAR   MCC('t', 'a', 'r', ' ')
 
 #define PEEK_BYTES 1024
 #define FILE_PEEK 1
index 0b87b607838296eec245b4bf0c53c232bdd3a769..3f26ddbf92946154361f7282f25895a1d8fc3011 100644 (file)
@@ -26,7 +26,7 @@
 
 #define unpack_log write_log
 #undef unpack_log
-#define unpack_log
+#define unpack_log(fmt, ...)
 
 
 static time_t fromdostime (uae_u32 dd)
@@ -1164,6 +1164,7 @@ static uae_u32 gwx (uae_u8 *p)
 static const int secs_per_day = 24 * 60 * 60;
 static const int diff = (8 * 365 + 2) * (24 * 60 * 60);
 static const int diff2 = (-8 * 365 - 2) * (24 * 60 * 60);
+
 static time_t put_time (long days, long mins, long ticks)
 {
        time_t t;
@@ -1259,7 +1260,6 @@ static void recursesfs (struct znode *zn, int root, TCHAR *name, int sfs2)
        struct zvolume *zv = zn->volume;
        struct adfhandle *adf = (struct adfhandle*)zv->handle;
        TCHAR name2[MAX_DPATH];
-       int bs = adf->blocksize;
        int block;
        uae_u8 *p, *s;
        struct zarchive_info zai;
@@ -1368,7 +1368,7 @@ struct zvolume *archive_directory_adf (struct znode *parent, struct zfile *z)
                goto fail;
        adf->dostype = gl (adf, 0);
 
-       if ((adf->dostype & 0xffffff00) == 'DOS\0') {
+       if ((adf->dostype & 0xffffff00) == MCC('D', 'O', 'S', '\0')) {
                int bs = adf->blocksize;
                int res;
 
@@ -1420,7 +1420,7 @@ struct zvolume *archive_directory_adf (struct znode *parent, struct zfile *z)
                name[0] = 0;
                recurseadf (&zv->root, adf->rootblock, name);
 
-       } else if ((adf->dostype & 0xffffff00) == 'SFS\0') {
+       } else if ((adf->dostype & 0xffffff00) == MCC('S', 'F', 'S', '\0')) {
 
                uae_u16 version, sfs2;
 
@@ -1433,14 +1433,14 @@ struct zvolume *archive_directory_adf (struct znode *parent, struct zfile *z)
                                adf->rootblock = gl (adf, 104);
                                if (!adf_read_block (adf, adf->rootblock))
                                        break;
-                               if (gl (adf, 0) != 'OBJC')
+                               if (gl (adf, 0) != MCC('O', 'B', 'J', 'C'))
                                        break;
                                if (sfs_checksum (adf->block, adf->blocksize, sfs2))
                                        break;
                                adf->rootblock = gl (adf, 40);
                                if (!adf_read_block (adf, adf->rootblock))
                                        break;
-                               if (gl (adf, 0) != 'OBJC')
+                               if (gl (adf, 0) != MCC('O', 'B', 'J', 'C'))
                                        break;
                                if (sfs_checksum (adf->block, adf->blocksize, sfs2))
                                        break;
@@ -1551,7 +1551,7 @@ static struct zfile *archive_access_adf (struct znode *zn)
        if (!z)
                return NULL;
 
-       if ((adf->dostype & 0xffffff00) == 'DOS\0') {
+       if ((adf->dostype & 0xffffff00) == MCC('D', 'O', 'S', '\0')) {
 
                ffs = adf->dostype & 1;
                root = zn->offset;
@@ -1577,7 +1577,7 @@ static struct zfile *archive_access_adf (struct znode *zn)
                                break;
                        root = gl (adf, bs - 2 * 4);
                }
-       } else if ((adf->dostype & 0xffffff00) == 'SFS\0') {
+       } else if ((adf->dostype & 0xffffff00) == MCC('S', 'F', 'S', '\0')) {
 
                struct sfsblock *sfsblocks;
                int sfsblockcnt, sfsmaxblockcnt, i;
@@ -1738,7 +1738,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z)
        zfile_fseek (z, 0, SEEK_SET);
        p = buf;
        zfile_fread (buf, 1, 512, z);
-       zai.name = _T("rdb_dump.dat");
+       zai.name = my_strdup(_T("rdb_dump.dat"));
        bs = rl (p + 16);
        zai.size = rl (p + 140) * bs;
        zai.comment = NULL;
@@ -1904,7 +1904,7 @@ static int getcluster (struct zfile *z, int cluster, int fatstart, int fatbits)
        return fat;
 }
 
-static void fatdirectory (struct zfile *z, struct zvolume *zv, TCHAR *name, int startblock, int entries, int sectorspercluster, int fatstart, int dataregion, int fatbits)
+static void fatdirectory (struct zfile *z, struct zvolume *zv, const TCHAR *name, int startblock, int entries, int sectorspercluster, int fatstart, int dataregion, int fatbits)
 {
        struct zarchive_info zai;
        struct znode *znnew;