From e3407a923f171ab884651c233d33035b64a64a78 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 26 Jun 2026 12:30:36 -0400 Subject: [PATCH] address some compiler complaints --- include/optlist.h | 4 ++++ src/cmd.c | 3 ++- src/makemon.c | 2 +- src/mon.c | 6 +++--- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/optlist.h b/include/optlist.h index 67ace7b32..a8c93ecd1 100644 --- a/include/optlist.h +++ b/include/optlist.h @@ -363,11 +363,15 @@ static int optfn_##a(int, int, boolean, char *, char *); NHOPTB(herecmd_menu, Advanced, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.herecmd_menu, Term_False, "show commands available in this location") +#if 0 +/* there is no optfn_hicolor() defined in options.c presently + and that is required for NHOPTC */ #if defined(MAC68K) NHOPTC(hicolor, Advanced, 15, opt_in, set_in_config, No, Yes, No, No, NoAlias, "same as palette, only order is reversed") #endif +#endif /* 0 */ NHOPTB(hilite_pet, Map, 0, opt_in, set_in_game, Off, Yes, No, No, NoAlias, &iflags.wc_hilite_pet, Term_False, "use highlight for pets") diff --git a/src/cmd.c b/src/cmd.c index 882a371ca..77fcdc6b8 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -2493,7 +2493,8 @@ handler_change_autocompletions(void) if (strlen(ec->ef_txt) < 2) continue; - Sprintf(buf, "%s", ec->ef_txt); + /* switched to Snprintf to eliminate -Wformat-overflow warning */ + Snprintf(buf, sizeof buf, "%s", ec->ef_txt); for (j = 0; j < n; ++j) { if (ec == &extcmdlist[(picks[j].item.a_int - 1)]) { diff --git a/src/makemon.c b/src/makemon.c index 18fb3bff1..d0c540e92 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -1681,7 +1681,7 @@ rndmonst_adj(int minadj, int maxadj) if (montooweak(mndx, minmlev) || montoostrong(mndx, maxmlev)) continue; - if (upper && !isupper(monsym(ptr))) + if (upper && !isupper((int) monsym(ptr))) continue; if (elemlevel && wrong_elem_type(ptr)) continue; diff --git a/src/mon.c b/src/mon.c index 3e86cb730..f04e2418c 100644 --- a/src/mon.c +++ b/src/mon.c @@ -4868,7 +4868,7 @@ pick_animal(void) /* rogue level should use monsters represented by uppercase letters only, but since chameleons aren't generated there (not uppercase!) we don't perform a lot of retries */ - if (Is_rogue_level(&u.uz) && !isupper(monsym(&mons[res]))) + if (Is_rogue_level(&u.uz) && !isupper((int) monsym(&mons[res]))) res = ga.animal_list[rn2(ga.animal_list_count)]; return res; } @@ -5224,7 +5224,7 @@ select_newcham_form(struct monst *mon) } while (--tryct > 0 && !validspecmon(mon, mndx) /* try harder to select uppercase monster on rogue level */ && (tryct > 40 && Is_rogue_level(&u.uz) - && !isupper(monsym(&mons[mndx])))); + && !isupper((int) monsym(&mons[mndx])))); } return mndx; } @@ -5334,7 +5334,7 @@ newcham( /* for the first several tries we require upper-case on the rogue level (after that, we take whatever we get) */ if (tryct > 15 && Is_rogue_level(&u.uz) - && mdat && !isupper(monsym(mdat))) + && mdat && !isupper((int) monsym(mdat))) mdat = 0; if (mdat) break;