resolve 3 warnings during DOS cross-compile

wizcmds.c: In function 'wiz_custom':
wizcmds.c:1845:40: warning: format '%d' expects argument of type 'int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Wformat=]
 1845 |         Sprintf(bufa, "%s: colorcount=%d %s", wizcustom, iflags.colorcount,
      |                                       ~^                 ~~~~~~~~~~~~~~~~~
      |                                        |                       |
      |                                        int                     uint32_t {aka long unsigned int}
      |                                       %ld
wizcmds.c: In function 'wizcustom_callback':
wizcmds.c:1895:32: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1895 |             Sprintf(bufc, "%011x", cgm->customcolor);
      |                            ~~~~^   ~~~~~~~~~~~~~~~~
      |                                |      |
      |                                |      uint32 {aka long unsigned int}
      |                                unsigned int
      |                            %011lx
wizcmds.c:1899:37: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32' {aka 'long unsigned int'} [-Wformat=]
 1899 |                 Sprintf(bufu, "U+%04x", cgm->u->utf32ch);
      |                                  ~~~^   ~~~~~~~~~~~~~~~
      |                                     |         |
      |                                     |         uint32 {aka long unsigned int}
      |                                     unsigned int
      |                                  %04lx
This commit is contained in:
nhmall
2024-04-03 12:15:51 -04:00
parent defb5d5f80
commit 1487d05c92

View File

@@ -1842,7 +1842,8 @@ wiz_custom(void)
add_menu_heading(win,
" glyph glyph identifier "
" sym clr customcolor unicode utf8");
Sprintf(bufa, "%s: colorcount=%d %s", wizcustom, iflags.colorcount,
Sprintf(bufa, "%s: colorcount=%ld %s", wizcustom,
(long) iflags.colorcount,
gs.symset[PRIMARYSET].name ? gs.symset[PRIMARYSET].name
: "default");
if (gc.currentgraphics == PRIMARYSET && gs.symset[PRIMARYSET].name)
@@ -1892,11 +1893,11 @@ wizcustom_callback(winid win, int glyphnum, char *id)
Sprintf(bufa, "[%04d] %-44s", glyphnum, id);
Sprintf(bufb, "'\\%03d' %02d",
gs.showsyms[cgm->sym.symidx], cgm->sym.color);
Sprintf(bufc, "%011x", cgm->customcolor);
Sprintf(bufc, "%011lx", (unsigned long) cgm->customcolor);
bufu[0] = '\0';
#ifdef ENHANCED_SYMBOLS
if (cgm->u && cgm->u->utf8str) {
Sprintf(bufu, "U+%04x", cgm->u->utf32ch);
Sprintf(bufu, "U+%04lx", (unsigned long) cgm->u->utf32ch);
cp = cgm->u->utf8str;
while (*cp) {
Sprintf(bufd, " <%d>", (int) *cp);