]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Warning fixes.
authorToni Wilen <twilen@winuae.net>
Fri, 29 Apr 2022 18:17:21 +0000 (21:17 +0300)
committerToni Wilen <twilen@winuae.net>
Fri, 29 Apr 2022 18:17:21 +0000 (21:17 +0300)
13 files changed:
archivers/chd/astring.cpp
archivers/lha/crcio.cpp
archivers/lha/header.cpp
archivers/lha/huf.cpp
archivers/lha/shuf.cpp
archivers/lha/uae_lha.cpp
archivers/lzx/unlzx.cpp
archivers/mp2/kjmp2.cpp
archivers/zip/ioapi.cpp
archivers/zip/unzip.cpp
genblitter.cpp
mame/mameglue.h
moduleripper.cpp

index e04dbd2ed799c4670a2d8cc9fd98531edfab16ca..1139892eed82a669f80e4fe7f33e4bac86d18874 100644 (file)
@@ -53,7 +53,7 @@ bool astring::ensure_room(int length)
        // swap in the new buffer and free the old one
        char *oldbuf = (m_text == m_smallbuf) ? NULL : m_text;
        m_text = strcpy(newbuf, m_text);
-       m_len = strlen(m_text);
+       m_len = uaestrlen(m_text);
        m_alloclen = alloclen;
        delete[] oldbuf;
 
index 3d1b2672e5905e80601324125a7e9942291fe77a..70a33f52beac8bf0e3e9e1932c6b160697a97c87 100644 (file)
@@ -152,7 +152,7 @@ putbits(n, x)                       /* Write rightmost n bits of x */
 int
 fread_crc(unsigned char *p, int n, struct zfile *fp)
 {
-       n = zfile_fread(p, 1, n, fp);
+       n = (int)zfile_fread(p, 1, n, fp);
 
        calccrc(p, n);
        return n;
index 69def2004aadc2fe90dc47dcb5e418a36f5f904e..7cb93a3404da8688977274028e1eb03c469d9ed3 100644 (file)
@@ -18,7 +18,7 @@ static char    *get_ptr;
 /* ------------------------------------------------------------------------ */
 int calc_sum(char *p, int len)
 {
-       register int    sum;
+       int    sum;
 
        for (sum = 0; len; len--)
                sum += *p++;
@@ -67,7 +67,7 @@ static void put_longword(long v)
 /* ------------------------------------------------------------------------ */
 static void msdos_to_unix_filename(char *name, int len)
 {
-       register int    i;
+       int    i;
 
 #ifdef MULTIBYTE_CHAR
        for (i = 0; i < len; i++) {
@@ -92,7 +92,7 @@ static void msdos_to_unix_filename(char *name, int len)
 /* ------------------------------------------------------------------------ */
 static void generic_to_unix_filename(char *name, int len)
 {
-       register int    i;
+       int    i;
        boolean         lower_case_used = FALSE;
 
 #ifdef MULTIBYTE_CHAR
@@ -133,7 +133,7 @@ static void generic_to_unix_filename(char *name, int len)
 static void
 macos_to_unix_filename(char *name, int len)
 {
-       register int    i;
+       int    i;
 
        for (i = 0; i < len; i++) {
                if (name[i] == ':')
@@ -147,7 +147,7 @@ macos_to_unix_filename(char *name, int len)
 static void
 unix_to_generic_filename(char *name, int len)
 {
-       register int    i;
+       int    i;
 
        for (i = 0; i < len; i++) {
                if (name[i] == '/')
@@ -539,7 +539,7 @@ boolean get_header(struct zfile *fp, LzHeader *hdr)
                                    hdr->extend_type == EXTEND_HUMAN ||
                                    hdr->extend_type == EXTEND_AMIGAOS ||
                                    hdr->extend_type == EXTEND_GENERIC)
-                                       hdr->attribute = get_word ();
+                                       hdr->attribute = (unsigned char)get_word ();
                                break;
                        case 0x50:
                                /*
@@ -585,8 +585,8 @@ boolean get_header(struct zfile *fp, LzHeader *hdr)
                        }
                }
                if (hdr->header_level != 2 && get_ptr - ptr != 2) {
-                       hdr->packed_size -= get_ptr - ptr - 2;
-                       hdr->header_size += get_ptr - ptr - 2;
+                       hdr->packed_size -= (long)(get_ptr - ptr - 2);
+                       hdr->header_size += (unsigned char)(get_ptr - ptr - 2);
                }
        }
 
@@ -654,7 +654,7 @@ void init_header(char *name, struct stat *v_stat, LzHeader *hdr)
        hdr->attribute = GENERIC_ATTRIBUTE;
        hdr->header_level = header_level;
        strcpy(hdr->name, name);
-       len = strlen(name);
+       len = uaestrlen(name);
        hdr->crc = 0x0000;
        hdr->extend_type = EXTEND_UNIX;
        hdr->unix_last_modified_stamp = v_stat->st_mtime;
index dec8868c4dab1729f8426ba99ffbed82b7e3c455..cb996f4e2eced5f66d629aa67b25abcef2b6c1de 100644 (file)
@@ -317,9 +317,9 @@ static void read_pt_len(short nn, short nbit, short i_special)
 {
        int           i, c, n;
 
-       n = getbits(nbit);
+       n = getbits((unsigned char)nbit);
        if (n == 0) {
-               c = getbits(nbit);
+               c = getbits((unsigned char)nbit);
                for (i = 0; i < nn; i++)
                        pt_len[i] = 0;
                for (i = 0; i < 256; i++)
index e9102cfc788548b96c91fa6005cf75e0d8c75951..8b7ef3e2b171e371995b3464a186d9ee4882978b 100644 (file)
@@ -113,7 +113,7 @@ static void read_tree_p(void)
 
        i = 0;
        while (i < NP) {
-               pt_len[i] = getbits(LENFIELD);
+               pt_len[i] = (unsigned char)getbits(LENFIELD);
                if (++i == 3 && pt_len[0] == 1 && pt_len[1] == 1 && pt_len[2] == 1) {
 #ifdef SUPPORT_LH7
                        c = getbits(MAX_DICBIT - 7);
index acc9d64fcc898c0cf93570d2a9d46493d01148be..c1aa2f275fe4bb34e80323d80fec2ddd125453b5 100644 (file)
@@ -84,7 +84,7 @@ struct zfile *archive_access_lha (struct znode *zn)
     lhinterface.dicbit = 13;   /* method + 8; -lh5- */
     lhinterface.infile = zf;
     lhinterface.outfile = out;
-    lhinterface.original = zn->size;
+    lhinterface.original = (unsigned long)zn->size;
     lhinterface.packed = zn->packedsize;
 
     switch (zn->method) {
index f32d84f87cc75abe49883666e1dd42eced67fdc0..7b5abb0514bd80210e3e701489a102802465f924 100644 (file)
@@ -493,13 +493,13 @@ static int read_literal_table(struct lzxdata *d)
       }
       symbol = table_four[d->literal_len[pos] + 17 - symbol];
       while((pos < max_symbol) && (count--))
-       d->literal_len[pos++] = symbol;
+       d->literal_len[pos++] = (unsigned char)symbol;
       break;
      }
      default:
      {
       symbol = table_four[d->literal_len[pos] + 17 - symbol];
-      d->literal_len[pos++] = symbol;
+      d->literal_len[pos++] = (unsigned char)symbol;
       break;
      }
     }
@@ -576,7 +576,7 @@ static void decrunch(struct lzxdata *d)
   }
   if(symbol < 256)
   {
-   *d->destination++ = symbol;
+   *d->destination++ = (unsigned char)symbol;
   }
   else
   {
@@ -656,12 +656,12 @@ struct zfile *archive_access_lzx (struct znode *zn)
                if (!zt || zt->offset != 0)
                        break;
                znfirst = zt;
-               unpsize += znfirst->size;
+               unpsize += (unsigned int)znfirst->size;
     }
     /* find last file in compressed block */
     znlast = zn;
     while (znlast) {
-               unpsize += znlast->size;
+               unpsize += (unsigned int)znlast->size;
                if (znlast->offset != 0)
                        break;
                znlast = znlast->next;
@@ -765,7 +765,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
  do
  {
   abort = 1; /* assume an error */
-  actual = zfile_fread(archive_header, 1, 31, in_file);
+  actual = (int)zfile_fread(archive_header, 1, 31, in_file);
   if(!zfile_ferror(in_file))
   {
    if(actual) /* 0 is normal and means EOF */
@@ -780,7 +780,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
      archive_header[26] = 0;
      crc_calc(&d, archive_header, 31);
      temp = archive_header[30]; /* filename length */
-     actual = zfile_fread(header_filename, 1, temp, in_file);
+     actual = (int)zfile_fread(header_filename, 1, temp, in_file);
      if(!zfile_ferror(in_file))
      {
       if(actual == temp)
@@ -788,7 +788,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file)
        header_filename[temp] = 0;
        crc_calc(&d, (unsigned char*)header_filename, temp);
        temp = archive_header[14]; /* comment length */
-       actual = zfile_fread(header_comment, 1, temp, in_file);
+       actual = (int)zfile_fread(header_comment, 1, temp, in_file);
        if(!zfile_ferror(in_file))
        {
        if(actual == temp)
index bd943fd4da9f54ebd9c1eb2b08c9451613d14426..6c8d0cfac5a868b929bb2c8e355cdf5a4a8adc12 100644 (file)
@@ -283,7 +283,7 @@ static const struct quantizer_spec* FASTCALL read_allocation(int sb, int b2_tabl
 
 static void FASTCALL read_samples(const struct quantizer_spec *q, int scalefactor, int *sample) {
     int idx, adj, scale;
-    register int val;
+    int val;
     if (!q) {
         // no bits allocated for this subband
         sample[0] = sample[1] = sample[2] = 0;
index 9734d49af70ee3d86e9f2bcf2423fecedf7b2d1f..3b17b2458fbc8dbb7b3393a7a718cecfe77717d6 100644 (file)
@@ -205,7 +205,7 @@ static long ZCALLBACK fseek64_file_func (voidpf  opaque, voidpf stream, ZPOS64_T
     }
     ret = 0;
 
-    if(FSEEKO_FUNC((FILE *)stream, offset, fseek_origin) != 0)
+    if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0)
                         ret = -1;
 
     return ret;
index 81281c7e23220bf20e12d28f9a63ce3bb1872a5e..b9d77682fb170f8a34a49a32b96a4fdf9ee9c7c5 100644 (file)
@@ -138,7 +138,7 @@ typedef     struct
 local int unzlocal_getByte(struct zfile *fin,int *pi)
 {
     unsigned char c;
-       int err = zfile_fread(&c, 1, 1, fin);
+       int err = (int)zfile_fread(&c, 1, 1, fin);
     if (err==1)
     {
        *pi = (int)c;
index 49c93e6f2765c85d7f875615b06e5a9dbbfe75aa..816780259ba11974925ec3730a84bf0dbe6a52ea 100644 (file)
@@ -58,16 +58,19 @@ static void generate_func(void)
                printf("uae_u32 dstd=0;\n");
                printf("uaecptr dstp = 0;\n");
                printf("for (j = 0; j < b->vblitsize; j++) {\n");
-               printf("\tfor (i = 0; i < b->hblitsize; i++) {\n\t\tuae_u32 bltadat, srca;\n\n");
-               if (c_is_on) printf("\t\tif (ptc) { srcc = chipmem_wget_indirect (ptc); ptc += 2; }\n");
-               if (b_is_on) printf("\t\tif (ptb) {\n\t\t\tuae_u32 bltbdat = b->bltbdat = chipmem_wget_indirect (ptb); ptb += 2;\n");
+               printf("\tfor (i = 0; i < b->hblitsize; i++) {\n");
+               if (a_is_on) {
+                       printf("\t\tuae_u32 bltadat, srca;\n");
+               }
+               if (c_is_on) printf("\t\tif (ptc) { srcc = chipmem_wget_indirect(ptc); ptc += 2; }\n");
+               if (b_is_on) printf("\t\tif (ptb) {\n\t\t\tuae_u32 bltbdat = b->bltbdat = chipmem_wget_indirect(ptb); ptb += 2;\n");
                if (b_is_on) printf("\t\t\tsrcb = (((uae_u32)b->bltbold << 16) | bltbdat) >> bshift;\n");
                if (b_is_on) printf("\t\t\tb->bltbold = bltbdat;\n\t\t}\n");
-               if (a_is_on) printf("\t\tif (pta) { bltadat = b->bltadat = chipmem_wget_indirect (pta); pta += 2; } else { bltadat = b->bltadat; }\n");
+               if (a_is_on) printf("\t\tif (pta) { bltadat = b->bltadat = chipmem_wget_indirect(pta); pta += 2; } else { bltadat = b->bltadat; }\n");
                if (a_is_on) printf("\t\tbltadat &= blit_masktable[i];\n");
                if (a_is_on) printf("\t\tsrca = (((uae_u32)b->bltaold << 16) | bltadat) >> ashift;\n");
                if (a_is_on) printf("\t\tb->bltaold = bltadat;\n");
-               printf("\t\tif (dstp) chipmem_wput_indirect (dstp, dstd);\n");
+               printf("\t\tif (dstp) chipmem_wput_indirect(dstp, dstd);\n");
                printf("\t\tdstd = (%s) & 0xFFFF;\n", blitops[blttbl[i]].s);
                printf("\t\ttotald |= dstd;\n");
                printf("\t\tif (ptd) { dstp = ptd; ptd += 2; }\n");
@@ -79,7 +82,7 @@ static void generate_func(void)
                printf("}\n");
                if (b_is_on) printf("b->bltbhold = srcb;\n");
                if (c_is_on) printf("b->bltcdat = srcc;\n");
-               printf("\t\tif (dstp) chipmem_wput_indirect (dstp, dstd);\n");
+               printf("\t\tif (dstp) chipmem_wput_indirect(dstp, dstd);\n");
                printf("if (totald != 0) b->blitzero = 0;\n");
                printf("}\n");
 
@@ -94,16 +97,19 @@ static void generate_func(void)
                printf("uae_u32 dstd = 0;\n");
                printf("uaecptr dstp = 0;\n");
                printf("for (j = 0; j < b->vblitsize; j++) {\n");
-               printf("\tfor (i = 0; i < b->hblitsize; i++) {\n\t\tuae_u32 bltadat, srca;\n");
-               if (c_is_on) printf("\t\tif (ptc) { srcc = chipmem_wget_indirect (ptc); ptc -= 2; }\n");
-               if (b_is_on) printf("\t\tif (ptb) {\n\t\t\tuae_u32 bltbdat = b->bltbdat = chipmem_wget_indirect (ptb); ptb -= 2;\n");
+               printf("\tfor (i = 0; i < b->hblitsize; i++) {\n");
+               if (a_is_on) {
+                       printf("\t\tuae_u32 bltadat, srca;\n");
+               }
+               if (c_is_on) printf("\t\tif (ptc) { srcc = chipmem_wget_indirect(ptc); ptc -= 2; }\n");
+               if (b_is_on) printf("\t\tif (ptb) {\n\t\t\tuae_u32 bltbdat = b->bltbdat = chipmem_wget_indirect(ptb); ptb -= 2;\n");
                if (b_is_on) printf("\t\t\tsrcb = ((bltbdat << 16) | b->bltbold) >> bshift;\n");
                if (b_is_on) printf("\t\t\tb->bltbold = bltbdat;\n\t\t}\n");
-               if (a_is_on) printf("\t\tif (pta) { bltadat = b->bltadat = chipmem_wget_indirect (pta); pta -= 2; } else { bltadat = b->bltadat; }\n");
+               if (a_is_on) printf("\t\tif (pta) { bltadat = b->bltadat = chipmem_wget_indirect(pta); pta -= 2; } else { bltadat = b->bltadat; }\n");
                if (a_is_on) printf("\t\tbltadat &= blit_masktable[i];\n");
                if (a_is_on) printf("\t\tsrca = (((uae_u32)bltadat << 16) | b->bltaold) >> ashift;\n");
                if (a_is_on) printf("\t\tb->bltaold = bltadat;\n");
-               printf("\t\tif (dstp) chipmem_wput_indirect (dstp, dstd);\n");
+               printf("\t\tif (dstp) chipmem_wput_indirect(dstp, dstd);\n");
                printf("\t\tdstd = (%s) & 0xFFFF;\n", blitops[blttbl[i]].s);
                printf("\t\ttotald |= dstd;\n");
                printf("\t\tif (ptd) { dstp = ptd; ptd -= 2; }\n");
@@ -115,7 +121,7 @@ static void generate_func(void)
                printf("}\n");
                if (b_is_on) printf("b->bltbhold = srcb;\n");
                if (c_is_on) printf("b->bltcdat = srcc;\n");
-               printf("\t\tif (dstp) chipmem_wput_indirect (dstp, dstd);\n");
+               printf("\t\tif (dstp) chipmem_wput_indirect(dstp, dstd);\n");
                printf("if (totald != 0) b->blitzero = 0;\n");
                printf("}\n");
     }
index 96621e2fe71d81458f3c87a569aa9b9e0ad222f4..988845a911a7da66d6b0e60d4ac612a0b7b20231 100644 (file)
@@ -25,7 +25,9 @@ extern void activate_debugger(void);
 typedef unsigned long offs_t;
 
 #define FALSE 0
+#ifndef TRUE
 #define TRUE 1
+#endif
 
 #define TIMER_CALLBACK_MEMBER(x) int x(void *p, int param, int param2)
 extern void standard_irq_callback(int);
index cdf926ba10a80f18f53a21611b6c50ca42f6f149..a14af12b99ba026891cf38d750cc39e41820632e 100644 (file)
@@ -91,7 +91,7 @@ static void namesplit(TCHAR *s)
 {
        int l;
 
-       l = _tcslen(s) - 1;
+       l = uaetcslen(s) - 1;
        while (l >= 0) {
                if (s[l] == '.')
                        s[l] = 0;
@@ -102,7 +102,7 @@ static void namesplit(TCHAR *s)
                l--;
        }
        if (l > 0)
-               memmove(s, s + l, (_tcslen(s + l) + 1) * sizeof (TCHAR));
+               memmove(s, s + l, (uaetcslen(s + l) + 1) * sizeof (TCHAR));
 }
 
 static void moduleripper_filename(const char *aname, TCHAR *out, bool fullpath)