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