Addressed compiler warnings.

Moved local declarations before code. Changed comments to c-style.
This commit is contained in:
Bart House
2018-11-20 10:43:35 -08:00
parent 616e946393
commit fcb28cd2e5

View File

@@ -12,6 +12,10 @@ void
curses_update_inv(void)
{
WINDOW *win = curses_get_nhwin(INV_WIN);
boolean border;
int x = 0;
int y = 0;
attr_t attr = A_UNDERLINE;
/* Check if the inventory window is enabled in first place */
if (!win) {
@@ -25,11 +29,9 @@ curses_update_inv(void)
return;
}
boolean border = curses_window_has_border(INV_WIN);
border = curses_window_has_border(INV_WIN);
/* Figure out drawing area */
int x = 0;
int y = 0;
if (border) {
x++;
y++;
@@ -39,7 +41,6 @@ curses_update_inv(void)
werase(win);
wmove(win, y, x);
attr_t attr = A_UNDERLINE;
wattron(win, attr);
wprintw(win, "Inventory:");
wattroff(win, attr);
@@ -62,6 +63,7 @@ curses_add_inv(int y, int glyph, CHAR_P accelerator, attr_t attr,
const char *str)
{
WINDOW *win = curses_get_nhwin(INV_WIN);
int color = NO_COLOR;
/* Figure out where to draw the line */
int x = 0;
@@ -78,7 +80,7 @@ curses_add_inv(int y, int glyph, CHAR_P accelerator, attr_t attr,
wattroff(win, bold);
wprintw(win, ") ");
}
#if 0 // FIXME: MENU GLYPHS
#if 0 /* FIXME: MENU GLYPHS */
if (accelerator && glyph != NO_GLYPH && iflags.use_menu_glyphs) {
unsigned dummy = 0; /* Not used */
int color = 0;
@@ -91,21 +93,19 @@ curses_add_inv(int y, int glyph, CHAR_P accelerator, attr_t attr,
wattroff(win, glyphclr);
}
#endif
int color = NO_COLOR;
if (accelerator && /* Don't colorize categories */
iflags.use_menu_color) {
boolean menu_color = FALSE;
char str_mutable[BUFSZ];
Strcpy(str_mutable, str);
attr = 0;
get_menu_coloring(str_mutable, &color, &attr);
get_menu_coloring(str_mutable, &color, (int *) &attr);
attr = curses_convert_attr(attr);
}
if (color == NO_COLOR) color = NONE;
curses_toggle_color_attr(win, color, attr, ON);
//wattron(win, attr);
/* wattron(win, attr); */
wprintw(win, "%s", str);
//wattroff(win, attr);
/* wattroff(win, attr); */
curses_toggle_color_attr(win, color, attr, OFF);
wclrtoeol(win);
}