Fixed a bunch of compile warnings

This commit is contained in:
Rob Pearce 2023-10-11 12:56:18 +11:00
parent 17461f9c24
commit ec6a86a0b2
3 changed files with 93 additions and 93 deletions

2
god.c
View File

@ -1872,7 +1872,7 @@ void godstone_pickup_effects(lifeform_t *god, lifeform_t *opposegod, object_t *o
wprintw(mainwin, "forgiven.\"\n");
break;
case R_GODNATURE:
wprintw(mainwin, "\"%s! You hold the Godstone of Rage!\n\n", toupper(player->race->name[0]), (player->race->name + 1));
wprintw(mainwin, "\"%c%s! You hold the Godstone of Rage!\n\n", toupper(player->race->name[0]), (player->race->name + 1));
wprintw(mainwin, "Long have I sought this ancient artifact - it is from this stone that the\n");
wprintw(mainwin, "insane God of Fire draws his destructive power.\n");
wprintw(mainwin, "If you can just deliver this stone to me, Klikirak's reign could be ended!\n\n");

28
io.c
View File

@ -587,7 +587,7 @@ char askchar(char *prompt, char *validchars, char *def, int showchars, int mayca
}
strcat(buf, "? ");
mvwprintw(msgwin, 0, 0, buf);
mvwprintw(msgwin, 0, 0, "%s", buf);
_wr(msgwin);
cset(1);
@ -1301,7 +1301,7 @@ char *askstring(char *prompt, char punc, char *retbuf, int retbuflen, char *def)
asprintf(&ending, "%c ",punc);
strcat(buf, ending);
free(ending);
mvwprintw(msgwin, 0, 0, buf);
mvwprintw(msgwin, 0, 0, "%s", buf);
_wr(msgwin);
echo();
wgetnstr(msgwin, retbuf, retbuflen);
@ -4328,7 +4328,7 @@ void describegod(lifeform_t *god) {
// title
snprintf(buf, BUFLEN, "God::%s %s",godname, goddesc);
wattron(mainwin, A_BOLD);
mvwprintw(mainwin, 0, 0, buf);
mvwprintw(mainwin, 0, 0, "%s", buf);
wattroff(mainwin, A_BOLD);
wmove(mainwin, 2, 0);
@ -4357,7 +4357,7 @@ void describejob(enum JOB jid) {
// title
snprintf(buf, BUFLEN, "%s",j->name);
capitalise(buf);
mvwprintw(mainwin, 0, 0, buf);
mvwprintw(mainwin, 0, 0, "%s", buf);
wmove(mainwin, 2, 0);
@ -4387,7 +4387,7 @@ void describeob(object_t *o) {
getobname(o, buf,o->amt);
}
wattron(mainwin, A_BOLD);
mvwprintw(mainwin, 0, 0, buf);
mvwprintw(mainwin, 0, 0, "%s", buf);
wattroff(mainwin, A_BOLD);
wmove(mainwin, 2, 0);
@ -4486,7 +4486,7 @@ void describespell(objecttype_t *ot) {
// title
snprintf(buf, BUFLEN, "%s",ot->name);
capitalise(buf);
mvwprintw(mainwin, 0, 0, buf);
mvwprintw(mainwin, 0, 0, "%s", buf);
wmove(mainwin, 2, 0);
@ -10139,7 +10139,7 @@ void doheading(WINDOW *win, int *y, int x, char *what) {
wmove(win, *y, x);
textwithcol(win, what); (*y)++;
setcol(win, C_WHITE);
mvwprintw(win, *y, x, underline); (*y)++;
mvwprintw(win, *y, x, "%s", underline); (*y)++;
unsetcol(win, C_WHITE);
free(underline);
}
@ -11881,7 +11881,7 @@ void drawstatus(void) {
wattron(statwin, A_BOLD); wprintw(statwin, "AR:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d ", getarmourrating(player, NULL, NULL, NULL, NULL));
wprintw(statwin, buf);
wprintw(statwin, "%s", buf);
wattron(statwin, A_BOLD); wprintw(statwin, "EV:"); wattroff(statwin, A_BOLD);
wprintw(statwin, "%d ", getevasion(player));
@ -11889,16 +11889,16 @@ void drawstatus(void) {
wattron(statwin, A_BOLD); wprintw(statwin, "$:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d ", countmoney(player->pack));
wprintw(statwin, buf);
wprintw(statwin, "%s", buf);
wattron(statwin, A_BOLD); wprintw(statwin, "Xp:"); wattroff(statwin, A_BOLD);
snprintf(buf, BUFLEN, "%d", player->level);
wprintw(statwin, buf);
wprintw(statwin, "%s", buf);
if (lfhasflag(player, F_HASNEWLEVEL)) {
wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD);
setcol(statwin, C_LIGHTGREEN);
wprintw(statwin, "LevUp",xpleft);
wprintw(statwin, "LevUp");
unsetcol(statwin, C_LIGHTGREEN);
} else {
wattron(statwin, A_BOLD); wprintw(statwin, "/"); wattroff(statwin, A_BOLD);
@ -13666,11 +13666,11 @@ void showlfstats(lifeform_t *lf, int showall) {
}
setcol(mainwin, C_GREEN);
snprintf(buf, BUFLEN, "%-12s", ot->name);
mvwprintw(mainwin, y, 0, buf);
mvwprintw(mainwin, y, 0, "%s", buf);
unsetcol(mainwin, C_GREEN);
snprintf(buf, BUFLEN, "%s%s", ot->desc, eb2);
wprintw(mainwin, buf);
wprintw(mainwin, "%s", buf);
if (downline(&y, h, headinglines, &nextoffset)) {
nextoffset += offset;
@ -15050,7 +15050,7 @@ void showlfstats(lifeform_t *lf, int showall) {
getflagsourcetext(f,source);
effectline(&stopnow, &count, offset, &nextoffset, headinglines, mainwin, &y, &x, 0, "%s %s protected from missiles by a cyclonic shield", you(lf), is(lf));
if (isplayer(lf)) {
wprintw(mainwin, " (power %d).%s",roman(f->val[0]),source);
wprintw(mainwin, " (power %s).%s",roman(f->val[0]),source);
} else {
wprintw(mainwin, ".%s",source);
}

18
shops.c
View File

@ -228,7 +228,7 @@ void shop(lifeform_t *lf, object_t *vm) {
cls();
mvwprintw(mainwin, 0, 0, toptext);
mvwprintw(mainwin, 0, 0, "%s", toptext);
y = 2;
centre(mainwin,C_WHITE, y, noprefix(shopname));
y += 2;
@ -435,11 +435,11 @@ enum SHOPRETURN shopdetectcurse(lifeform_t *lf, object_t *vm, int starty, char *
if (cost) {
mvwprintw(mainwin, y, 0, "It will cost $%d to perform an divination on your items.", cost);
} else {
mvwprintw(mainwin, y, 0, "For a fellow worshipper, we will perform divinations on your items for free.", cost);
mvwprintw(mainwin, y, 0, "%s", "For a fellow worshipper, we will perform divinations on your items for free.");
}
y += 2;
if (countmoney(lf->pack) < cost) {
mvwprintw(mainwin, y, 0, "Unfortunately, you cannot afford this.", cost);
mvwprintw(mainwin, y, 0, "%s", "Unfortunately, you cannot afford this.");
y += 2;
possible = B_FALSE;
}
@ -655,7 +655,7 @@ enum SHOPRETURN shopbless(lifeform_t *lf, object_t *vm, int starty, char *toptex
mvwprintw(mainwin, y, 0, "So long as their aura is known, we can bestow a blessing on most items."); y += 2;
if (remcursecost == 0) {
mvwprintw(mainwin, y, 0, "Curse removal - FREE",remcursecost); y++;
mvwprintw(mainwin, y, 0, "Curse removal - FREE"); y++;
} else {
mvwprintw(mainwin, y, 0, "Curse removal - $%d each",remcursecost); y++;
}
@ -737,11 +737,11 @@ enum SHOPRETURN shopid(lifeform_t *lf, object_t *vm, int starty, char *toptext,
*nid = 0;
mvwprintw(mainwin, y, 0, "We can help inspect your items for a small fee."); y += 2;
mvwprintw(mainwin, y, 0, "%s", "We can help inspect your items for a small fee."); y += 2;
mvwprintw(mainwin, y, 0, "For just $%d per item we can reveal their general purpose,", cost); y++;
mvwprintw(mainwin, y, 0, "however please note that we are unable to detect magical"); y++;
mvwprintw(mainwin, y, 0, "enchantments or blessings.", cost); y += 2;
mvwprintw(mainwin, y, 0, "Identify items [y/n]? ", countmoney(lf->pack));
mvwprintw(mainwin, y, 0, "%s", "however please note that we are unable to detect magical"); y++;
mvwprintw(mainwin, y, 0, "%s", "enchantments or blessings."); y += 2;
mvwprintw(mainwin, y, 0, "%s", "Identify items [y/n]? ");
ch = getch();
if (ch != 'y') {
@ -1334,7 +1334,7 @@ enum SHOPRETURN shopsell(lifeform_t *lf, object_t *vm, int starty, char *toptext
*nsold = 0;
mvwprintw(mainwin, y, 0, "We offer good prices for quality items."); y += 2;
mvwprintw(mainwin, y, 0, "Sell items [y/n]? ", countmoney(lf->pack));
mvwprintw(mainwin, y, 0, "Sell items [y/n]? ");
ch = getch();
if (ch != 'y') {