Browse Source

Fix warnings in some gcc versions

master
cancel 6 years ago
parent
commit
c505180ba4
  1. 2
      term_util.h
  2. 8
      tui_main.c

2
term_util.h

@ -47,7 +47,7 @@ typedef enum {
} Term_attr; } Term_attr;
ORCA_FORCE_INLINE ORCA_FORCE_INLINE
int fg_bg(Color_name fg, Color_name bg) { attr_t fg_bg(Color_name fg, Color_name bg) {
return COLOR_PAIR(1 + fg * Colors_count + bg); return COLOR_PAIR(1 + fg * Colors_count + bg);
} }

8
tui_main.c

@ -104,7 +104,7 @@ static bool is_valid_glyph(Glyph c) {
static attr_t term_attrs_of_cell(Glyph g, Mark m) { static attr_t term_attrs_of_cell(Glyph g, Mark m) {
Glyph_class gclass = glyph_class_of(g); Glyph_class gclass = glyph_class_of(g);
int attr = (attr_t)A_normal; attr_t attr = A_normal;
switch (gclass) { switch (gclass) {
case Glyph_class_unknown: case Glyph_class_unknown:
attr = A_bold | fg_bg(C_red, C_natural); attr = A_bold | fg_bg(C_red, C_natural);
@ -141,7 +141,7 @@ static attr_t term_attrs_of_cell(Glyph g, Mark m) {
if (m & Mark_flag_haste_input) { if (m & Mark_flag_haste_input) {
attr = A_bold | fg_bg(C_cyan, C_natural); attr = A_bold | fg_bg(C_cyan, C_natural);
} }
return (attr_t)attr; return attr;
} }
typedef enum { typedef enum {
@ -203,7 +203,7 @@ void draw_grid_cursor(WINDOW* win, int draw_y, int draw_x, int draw_h,
return; return;
if (draw_y >= draw_h || draw_x >= draw_w) if (draw_y >= draw_h || draw_x >= draw_w)
return; return;
int const curs_attr = A_reverse | A_bold | fg_bg(C_yellow, C_natural); attr_t const curs_attr = A_reverse | A_bold | fg_bg(C_yellow, C_natural);
if (offset_y <= cursor_y && offset_x <= cursor_x) { if (offset_y <= cursor_y && offset_x <= cursor_x) {
Usz cdraw_y = cursor_y - offset_y + (Usz)draw_y; Usz cdraw_y = cursor_y - offset_y + (Usz)draw_y;
Usz cdraw_x = cursor_x - offset_x + (Usz)draw_x; Usz cdraw_x = cursor_x - offset_x + (Usz)draw_x;
@ -215,7 +215,7 @@ void draw_grid_cursor(WINDOW* win, int draw_y, int draw_x, int draw_h,
} else { } else {
displayed = beneath; displayed = beneath;
} }
chtype ch = (chtype)(displayed | curs_attr); chtype ch = (chtype)displayed | curs_attr;
wmove(win, (int)cdraw_y, (int)cdraw_x); wmove(win, (int)cdraw_y, (int)cdraw_x);
waddchnstr(win, &ch, 1); waddchnstr(win, &ch, 1);
} }

Loading…
Cancel
Save