]> granicus.if.org Git - nethack/commitdiff
warning fix in msdos build
authornhmall <nhmall@nethack.org>
Sun, 9 Oct 2022 13:35:24 +0000 (09:35 -0400)
committernhmall <nhmall@nethack.org>
Sun, 9 Oct 2022 13:35:24 +0000 (09:35 -0400)
../sys/msdos/font.c:24:12: warning: declaration of 'flags' shadows a global declaration [-Wshadow]
   24 |     uint32 flags;
      |            ^~~~~
In file included from ../include/hack.h:285,
                 from ../sys/msdos/font.c:3:
../include/flag.h:422:29: note: shadowed declaration is here
  422 | extern NEARDATA struct flag flags;
      |                             ^~~~~
make[2]: Entering directory '/home/nhmall/git/NHsource/util'

sys/msdos/font.c

index d7fd72046f5a145476895e828157af4f00751b99..8a4471d51fd6a735988f3f2997a54f9fe2743c1f 100755 (executable)
@@ -21,7 +21,7 @@ load_font(const char *filename)
     uint32 magic;
     uint32 version;
     uint32 headersize;
-    uint32 flags;
+    uint32 fontflags;
     uint32 length;
     uint32 charsize;
     uint32 height;
@@ -43,7 +43,7 @@ load_font(const char *filename)
     if (version != 0) goto error;
     headersize = read_u32(header +  8);
     if (headersize < sizeof(header)) goto error;
-    flags      = read_u32(header + 12);
+    fontflags  = read_u32(header + 12);
     length     = read_u32(header + 16);
     charsize   = read_u32(header + 20);
     height     = read_u32(header + 24);
@@ -77,7 +77,7 @@ load_font(const char *filename)
         fseek(fp, charsize - memsize, SEEK_CUR);
     }
 
-    if (flags & 0x01) {
+    if (fontflags & 0x01) {
         /* Read the Unicode table */
         char buf[128], buf2[128+1];
         unsigned bufsize, strsize;