shithub: orca

Download patch

ref: c505180ba4445a04e11837edbc879515e8f2131c
parent: f48f3792a636d7a5f29e2a3c2ec52a6399ffc482
author: cancel <cancel@cancel.fm>
date: Wed Dec 19 19:34:54 EST 2018

Fix warnings in some gcc versions

--- a/term_util.h
+++ b/term_util.h
@@ -47,7 +47,7 @@
 } Term_attr;
 
 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);
 }
 
--- a/tui_main.c
+++ b/tui_main.c
@@ -104,7 +104,7 @@
 
 static attr_t term_attrs_of_cell(Glyph g, Mark m) {
   Glyph_class gclass = glyph_class_of(g);
-  int attr = (attr_t)A_normal;
+  attr_t attr = A_normal;
   switch (gclass) {
   case Glyph_class_unknown:
     attr = A_bold | fg_bg(C_red, C_natural);
@@ -141,7 +141,7 @@
   if (m & Mark_flag_haste_input) {
     attr = A_bold | fg_bg(C_cyan, C_natural);
   }
-  return (attr_t)attr;
+  return attr;
 }
 
 typedef enum {
@@ -203,7 +203,7 @@
     return;
   if (draw_y >= draw_h || draw_x >= draw_w)
     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) {
     Usz cdraw_y = cursor_y - offset_y + (Usz)draw_y;
     Usz cdraw_x = cursor_x - offset_x + (Usz)draw_x;
@@ -215,7 +215,7 @@
       } else {
         displayed = beneath;
       }
-      chtype ch = (chtype)(displayed | curs_attr);
+      chtype ch = (chtype)displayed | curs_attr;
       wmove(win, (int)cdraw_y, (int)cdraw_x);
       waddchnstr(win, &ch, 1);
     }