unused parameter warning and an invalid index

Changes to be committed:
	modified:   win/tty/wintty.c
This commit is contained in:
nhmall
2015-11-11 09:57:05 -05:00
parent 38080e921f
commit ecd277cec2

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 wintty.c $NHDT-Date: 1447234979 2015/11/11 09:42:59 $ $NHDT-Branch: master $:$NHDT-Revision: 1.112 $ */ /* NetHack 3.6 wintty.c $NHDT-Date: 1447253778 2015/11/11 14:56:18 $ $NHDT-Branch: master $:$NHDT-Revision: 1.113 $ */
/* Copyright (c) David Cohrs, 1991 */ /* Copyright (c) David Cohrs, 1991 */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -3022,7 +3022,8 @@ void
tty_print_glyph(window, x, y, glyph, bkglyph) tty_print_glyph(window, x, y, glyph, bkglyph)
winid window; winid window;
xchar x, y; xchar x, y;
int glyph, bkglyph; int glyph;
int bkglyph UNUSED;
{ {
int ch; int ch;
boolean reverse_on = FALSE; boolean reverse_on = FALSE;
@@ -3312,22 +3313,22 @@ genericptr_t ptr;
long cond, *condptr = (long *) ptr; long cond, *condptr = (long *) ptr;
register int i; register int i;
char *text = (char *) ptr; char *text = (char *) ptr;
/* Mapping BL attributes to tty attributes /* Mapping BL attributes to tty attributes
* BL_HILITE_NONE -1 + 3 = 2 (statusattr[2]) * BL_HILITE_NONE -1 + 3 = 2 (statusattr[2])
* BL_HILITE_INVERSE -2 + 3 = 1 (statusattr[1]) * BL_HILITE_INVERSE -2 + 3 = 1 (statusattr[1])
* BL_HILITE_BOLD -3 + 3 = 0 (statusattr[0]) * BL_HILITE_BOLD -3 + 3 = 0 (statusattr[0])
*/ */
int statusattr[] = {ATR_BOLD, ATR_INVERSE, ATR_NONE}; int statusattr[] = {ATR_BOLD, ATR_INVERSE, ATR_NONE};
int attridx = 0; int attridx = 0;
long value = -1L; long value = -1L;
static boolean beenhere = FALSE; static boolean beenhere = FALSE;
enum statusfields fieldorder[2][15] = { enum statusfields fieldorder[2][15] = {
{ BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN, { BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN,
BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH,
BL_FLUSH }, BL_FLUSH },
{ BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, { BL_LEVELDESC, BL_GOLD, BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX,
BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER, BL_AC, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_HUNGER,
BL_CAP, BL_CONDITION, BL_FLUSH } BL_CAP, BL_CONDITION, BL_FLUSH }
}; };
if (fldidx != BL_FLUSH) { if (fldidx != BL_FLUSH) {
@@ -3356,14 +3357,13 @@ genericptr_t ptr;
default: default:
value = atol(text); value = atol(text);
Sprintf(status_vals[fldidx], Sprintf(status_vals[fldidx],
status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] : status_fieldfmt[fldidx] ? status_fieldfmt[fldidx] :
"%s", text); "%s", text);
break; break;
} }
}
#ifdef STATUS_HILITES #ifdef STATUS_HILITES
switch (tty_status_hilites[fldidx].behavior) { switch (tty_status_hilites[fldidx].behavior) {
case BL_TH_NONE: case BL_TH_NONE:
tty_status_colors[fldidx] = NO_COLOR; tty_status_colors[fldidx] = NO_COLOR;
break; break;
@@ -3378,23 +3378,23 @@ genericptr_t ptr;
break; break;
case BL_TH_VAL_PERCENTAGE: case BL_TH_VAL_PERCENTAGE:
{ {
int pct_th = 0; int pct_th = 0;
if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) { if (tty_status_hilites[fldidx].thresholdtype != ANY_INT) {
impossible( impossible(
"tty_status_update: unsupported percentage threshold type %d", "tty_status_update: unsupported percentage threshold type %d",
tty_status_hilites[fldidx].thresholdtype); tty_status_hilites[fldidx].thresholdtype);
break; break;
} }
pct_th = tty_status_hilites[fldidx].threshold.a_int; pct_th = tty_status_hilites[fldidx].threshold.a_int;
tty_status_colors[fldidx] = (percent >= pct_th) tty_status_colors[fldidx] = (percent >= pct_th)
? tty_status_hilites[fldidx].over ? tty_status_hilites[fldidx].over
: tty_status_hilites[fldidx].under; : tty_status_hilites[fldidx].under;
} }
break; break;
case BL_TH_VAL_ABSOLUTE: case BL_TH_VAL_ABSOLUTE:
{ {
int c = NO_COLOR; int c = NO_COLOR;
int o = tty_status_hilites[fldidx].over; int o = tty_status_hilites[fldidx].over;
int u = tty_status_hilites[fldidx].under; int u = tty_status_hilites[fldidx].under;
@@ -3417,15 +3417,16 @@ genericptr_t ptr;
break; break;
default: default:
impossible( impossible(
"tty_status_update: unsupported absolute threshold type %d\n", "tty_status_update: unsupported absolute threshold type %d\n",
tty_status_hilites[fldidx].thresholdtype); tty_status_hilites[fldidx].thresholdtype);
break; break;
} }
tty_status_colors[fldidx] = c; tty_status_colors[fldidx] = c;
} }
break; break;
} }
#endif /* STATUS_HILITES */ #endif /* STATUS_HILITES */
}
/* For now, this version copied from the genl_ version currently /* For now, this version copied from the genl_ version currently
* updates everything on the display, everytime * updates everything on the display, everytime