Ticket #3955: mc-3955-editcmd_dialogs.c-cleanup-cast-align-warning.patch

File mc-3955-editcmd_dialogs.c-cleanup-cast-align-warning.patch, 1.7 KB (added by and, 4 months ago)
  • src/editor/editcmd_dialogs.c

    From 35f139d319388814bc570db6236e705cf19456c2 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 5 Jan 2019 18:53:53 +0000
    Subject: [PATCH] editcmd_dialogs.c: Cleanup -Wcast-align warning
    
    Found by Clang 6.0.1
    
    editcmd_dialogs.c:474:20: warning: cast from 'char *' to 'etags_hash_t *' (aka 'struct etags_hash_struct *') increases required alignment from 1 to 8 [-Wcast-align]
            curr_def = (etags_hash_t *) tmp_curr_def;
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editcmd_dialogs.c | 6 ++----
     1 file changed, 2 insertions(+), 4 deletions(-)
    
    diff --git a/src/editor/editcmd_dialogs.c b/src/editor/editcmd_dialogs.c
    index ed17afeb1..cf60b00d3 100644
    a b editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_l 
    414414 
    415415    int start_x, start_y, offset, i; 
    416416    char *curr = NULL; 
    417     etags_hash_t *curr_def = NULL; 
    418417    WDialog *def_dlg; 
    419418    WListbox *def_list; 
    420419    int def_dlg_h;              /* dialog height */ 
    editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_l 
    467466    /* pop up the dialog and apply the chosen completion */ 
    468467    if (dlg_run (def_dlg) == B_ENTER) 
    469468    { 
    470         char *tmp_curr_def = (char *) curr_def; 
     469        etags_hash_t *curr_def = NULL; 
    471470        int do_moveto = 0; 
    472471 
    473         listbox_get_current (def_list, &curr, (void **) &tmp_curr_def); 
    474         curr_def = (etags_hash_t *) tmp_curr_def; 
     472        listbox_get_current (def_list, &curr, (void **) &curr_def); 
    475473        if (edit->modified) 
    476474        { 
    477475            if (!edit_query_dialog2