Ticket #3547: mc-3547-widget_options_t-Cleanup-Wassign-enum-warnings.patch

File mc-3547-widget_options_t-Cleanup-Wassign-enum-warnings.patch, 11.0 KB (added by and, 8 years ago)
  • lib/widget/quick.h

    From 1a29ec78a0d15f599ff59442bdacc2b2343232d7 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 28 Feb 2016 22:39:27 +0000
    Subject: [PATCH] (widget_options_t) Cleanup -Wassign-enum warnings
    
    warning looks like:
    
    wtools.c:213:13: warning: integer constant not in range of enumerated type 'widget_options_t' [-Wassign-enum]
                QUICK_LABELED_INPUT (p_text, input_label_above, def_text, histname, &my_str,
                ^
    ../../lib/widget/quick.h:65:16: note: expanded from macro 'QUICK_LABELED_INPUT'
        .options = 0,                                                               \
                   ^
    boxes.c:489:17: warning: integer constant not in range of enumerated type 'widget_options_t' [-Wassign-enum]
                    QUICK_START_GROUPBOX (N_("File operations")),
                    ^
    ../../lib/widget/quick.h:115:16: note: expanded from macro 'QUICK_START_GROUPBOX'
        .options = 0,                                                               \
                   ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/widget/quick.h         | 28 ++++++++++++++--------------
     lib/widget/widget-common.h |  1 +
     2 files changed, 15 insertions(+), 14 deletions(-)
    
    diff --git a/lib/widget/quick.h b/lib/widget/quick.h
    index 73482d6..f53529d 100644
    a b  
    1212#define QUICK_CHECKBOX(txt, st, id_)                                            \ 
    1313{                                                                               \ 
    1414    .widget_type = quick_checkbox,                                              \ 
    15     .options = 0,                                                               \ 
     15    .options = W_NONE,                                                          \ 
    1616    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    1717    .id = id_,                                                                  \ 
    1818    .u = {                                                                      \ 
     
    2626#define QUICK_BUTTON(txt, act, cb, id_)                                         \ 
    2727{                                                                               \ 
    2828    .widget_type = quick_button,                                                \ 
    29     .options = 0,                                                               \ 
     29    .options = W_NONE,                                                          \ 
    3030    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    3131    .id = id_,                                                                  \ 
    3232    .u = {                                                                      \ 
     
    4141#define QUICK_INPUT(txt, hname, res, id_, is_passwd_, strip_passwd_, completion_flags_) \ 
    4242{                                                                               \ 
    4343    .widget_type = quick_input,                                                 \ 
    44     .options = 0,                                                               \ 
     44    .options = W_NONE,                                                          \ 
    4545    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    4646    .id = id_,                                                                  \ 
    4747    .u = {                                                                      \ 
     
    6262#define QUICK_LABELED_INPUT(label_, label_loc, txt, hname, res, id_, is_passwd_, strip_passwd_, completion_flags_) \ 
    6363{                                                                               \ 
    6464    .widget_type = quick_input,                                                 \ 
    65     .options = 0,                                                               \ 
     65    .options = W_NONE,                                                          \ 
    6666    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    6767    .id = id_,                                                                  \ 
    6868    .u = {                                                                      \ 
     
    8383#define QUICK_LABEL(txt, id_)                                                   \ 
    8484{                                                                               \ 
    8585    .widget_type = quick_label,                                                 \ 
    86     .options = 0,                                                               \ 
     86    .options = W_NONE,                                                          \ 
    8787    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    8888    .id = id_,                                                                  \ 
    8989    .u = {                                                                      \ 
     
    9797#define QUICK_RADIO(cnt, items_, val, id_)                                      \ 
    9898{                                                                               \ 
    9999    .widget_type = quick_radio,                                                 \ 
    100     .options = 0,                                                               \ 
     100    .options = W_NONE,                                                          \ 
    101101    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    102102    .id = id_,                                                                  \ 
    103103    .u = {                                                                      \ 
     
    112112#define QUICK_START_GROUPBOX(t)                                                 \ 
    113113{                                                                               \ 
    114114    .widget_type = quick_start_groupbox,                                        \ 
    115     .options = 0,                                                               \ 
     115    .options = W_NONE,                                                          \ 
    116116    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    117117    .id = NULL,                                                                 \ 
    118118    .u = {                                                                      \ 
     
    125125#define QUICK_STOP_GROUPBOX                                                     \ 
    126126{                                                                               \ 
    127127    .widget_type = quick_stop_groupbox,                                         \ 
    128     .options = 0,                                                               \ 
     128    .options = W_NONE,                                                          \ 
    129129    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    130130    .id = NULL,                                                                 \ 
    131131    .u = {                                                                      \ 
     
    140140#define QUICK_SEPARATOR(line_)                                                  \ 
    141141{                                                                               \ 
    142142    .widget_type = quick_separator,                                             \ 
    143     .options = 0,                                                               \ 
     143    .options = W_NONE,                                                          \ 
    144144    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    145145    .id = NULL,                                                                 \ 
    146146    .u = {                                                                      \ 
     
    154154#define QUICK_START_COLUMNS                                                     \ 
    155155{                                                                               \ 
    156156    .widget_type = quick_start_columns,                                         \ 
    157     .options = 0,                                                               \ 
     157    .options = W_NONE,                                                          \ 
    158158    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    159159    .id = NULL,                                                                 \ 
    160160    .u = {                                                                      \ 
     
    169169#define QUICK_NEXT_COLUMN                                                       \ 
    170170{                                                                               \ 
    171171    .widget_type = quick_next_column,                                           \ 
    172     .options = 0,                                                               \ 
     172    .options = W_NONE,                                                          \ 
    173173    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    174174    .id = NULL,                                                                 \ 
    175175    .u = {                                                                      \ 
     
    184184#define QUICK_STOP_COLUMNS                                                      \ 
    185185{                                                                               \ 
    186186    .widget_type = quick_stop_columns,                                          \ 
    187     .options = 0,                                                               \ 
     187    .options = W_NONE,                                                          \ 
    188188    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    189189    .id = NULL,                                                                 \ 
    190190    .u = {                                                                      \ 
     
    199199#define QUICK_START_BUTTONS(space_, line_)                                      \ 
    200200{                                                                               \ 
    201201    .widget_type = quick_buttons,                                               \ 
    202     .options = 0,                                                               \ 
     202    .options = W_NONE,                                                          \ 
    203203    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    204204    .id = NULL,                                                                 \ 
    205205    .u = {                                                                      \ 
     
    218218#define QUICK_END                                                               \ 
    219219{                                                                               \ 
    220220    .widget_type = quick_end,                                                   \ 
    221     .options = 0,                                                               \ 
     221    .options = W_NONE,                                                          \ 
    222222    .pos_flags = WPOS_KEEP_DEFAULT,                                             \ 
    223223    .id = NULL,                                                                 \ 
    224224    .u = {                                                                      \ 
  • lib/widget/widget-common.h

    diff --git a/lib/widget/widget-common.h b/lib/widget/widget-common.h
    index 0398a1e..e9c92ac 100644
    a b typedef enum 
    6060/* Widget options */ 
    6161typedef enum 
    6262{ 
     63    W_NONE = (1 << 0), 
    6364    W_WANT_HOTKEY = (1 << 1), 
    6465    W_WANT_CURSOR = (1 << 2), 
    6566    W_WANT_IDLE = (1 << 3),