Ticket #3598: mc-3598-0023-editor-edit_dialogs.c-cleanup-Wcast-qual-warning.patch

File mc-3598-0023-editor-edit_dialogs.c-cleanup-Wcast-qual-warning.patch, 3.0 KB (added by and, 8 years ago)
  • src/editor/editcmd_dialogs.c

    From 1bc9da328a145b8b134f131149995d6d9728df59 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 20 Feb 2016 13:23:14 +0000
    Subject: [PATCH] editor/edit_dialogs.c: cleanup -Wcast-qual warning
    
    editcmd_dialogs.c:109:44: warning: to be safe all intermediate pointers in cast from 'gchar ** {aka char **}' to 'const char **' must be 'const' qualified [-Wcast-qual]
                     QUICK_RADIO (num_of_types, (const char **) list_of_types,
                                                ^
    editcmd_dialogs.c:209:44: warning: to be safe all intermediate pointers in cast from 'gchar ** {aka char **}' to 'const char **' must be 'const' qualified [-Wcast-qual]
                     QUICK_RADIO (num_of_types, (const char **) list_of_types,
                                                ^
    editcmd_dialogs.c: In function 'editcmd_dialog_completion_show':
    ../../lib/widget/widget-common.h:13:20: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
     #define WIDGET(x) ((Widget *)(x))
                         ^
     editcmd_dialogs.c:349:24: note: in expansion of macro 'WIDGET'
          const Widget *we = WIDGET (edit)
                             ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editcmd_dialogs.c | 6 +++---
     1 file changed, 3 insertions(+), 3 deletions(-)
    
    diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c
    index ed436f8..eb53b1a 100644
    a b editcmd_dialog_search_show (WEdit * edit) 
    106106                                 INPUT_COMPLETE_NONE), 
    107107            QUICK_SEPARATOR (TRUE), 
    108108            QUICK_START_COLUMNS, 
    109                 QUICK_RADIO (num_of_types, (const char **) list_of_types, 
     109                QUICK_RADIO (num_of_types, (const char **)(void *) list_of_types, 
    110110                             (int *) &edit_search_options.type, NULL), 
    111111            QUICK_NEXT_COLUMN, 
    112112                QUICK_CHECKBOX (N_("Cas&e sensitive"), &edit_search_options.case_sens, NULL), 
    editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const cha 
    206206                                 "replace", replace_text, NULL, FALSE, FALSE, INPUT_COMPLETE_NONE), 
    207207            QUICK_SEPARATOR (TRUE), 
    208208            QUICK_START_COLUMNS, 
    209                 QUICK_RADIO (num_of_types, (const char **) list_of_types, 
     209                QUICK_RADIO (num_of_types, (const char **)(void *) list_of_types, 
    210210                             (int *) &edit_search_options.type, NULL), 
    211211            QUICK_NEXT_COLUMN, 
    212212                QUICK_CHECKBOX (N_("Cas&e sensitive"), &edit_search_options.case_sens, NULL), 
    editcmd_dialog_raw_key_query (const char *heading, const char *query, gboolean c 
    346346char * 
    347347editcmd_dialog_completion_show (const WEdit * edit, int max_len, GString ** compl, int num_compl) 
    348348{ 
    349     const Widget *we = WIDGET (edit); 
     349    const Widget *we = CWIDGET (edit); 
    350350    int start_x, start_y, offset, i; 
    351351    char *curr = NULL; 
    352352    WDialog *compl_dlg;