From 1487d05c92654c5258ceb170352f65ec6bb5f80b Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 3 Apr 2024 12:15:51 -0400 Subject: [PATCH] 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 --- src/wizcmds.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/wizcmds.c b/src/wizcmds.c index 455c6b60d..8a5ff1060 100644 --- a/src/wizcmds.c +++ b/src/wizcmds.c @@ -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);