Ticket #3598: mc-3598-0000-widget-common-introduce-CWIDGET-helper.patch

File mc-3598-0000-widget-common-introduce-CWIDGET-helper.patch, 1.1 KB (added by and, 8 years ago)
  • lib/widget/widget-common.h

    From c239eea487fda3286c5dffe8b8bfe4eabcc8f6a4 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 20 Feb 2016 14:29:21 +0000
    Subject: [PATCH] widget-common: introduce CWIDGET helper
    
    introduce CWIDGET helper for cleanup -Wcast-qual compiler warnings
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/widget/widget-common.h | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h
    index 0398a1e..55f1547 100644
    a b  
    1111/*** typedefs(not structures) and defined constants **********************************************/ 
    1212 
    1313#define WIDGET(x) ((Widget *)(x)) 
     14#define CWIDGET(x) ((const Widget *)(x)) 
    1415 
    15 #define widget_move(w, _y, _x) tty_gotoyx (WIDGET(w)->y + (_y), WIDGET(w)->x + (_x)) 
     16#define widget_move(w, _y, _x) tty_gotoyx (CWIDGET(w)->y + (_y), CWIDGET(w)->x + (_x)) 
    1617/* Sets/clear the specified flag in the options field */ 
    1718#define widget_want_cursor(w,i) widget_set_options(w, W_WANT_CURSOR, i) 
    1819#define widget_want_hotkey(w,i) widget_set_options(w, W_WANT_HOTKEY, i)