Ticket #3547: mc-3547-src-editor-editwidget.c-Cleanup-some-compiler-warnin.patch

File mc-3547-src-editor-editwidget.c-Cleanup-some-compiler-warnin.patch, 1.6 KB (added by and, 6 years ago)
  • src/editor/editwidget.c

    From 5fa2eacccae2d4cca6c5c01d5e4a99dedc4cac24 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sun, 28 Feb 2016 21:47:22 +0000
    Subject: [PATCH] src/editor/editwidget.c: Cleanup some compiler warnings
    
    editwidget.c:808:12: warning: implicit conversion changes signedness: 'gboolean' (aka 'int') to 'cb_ret_t' [-Wsign-conversion]
        return ret;
        ~~~~~~ ^~~
    editwidget.c:857:71: warning: implicit conversion changes signedness: 'unsigned char' to 'char' [-Wsign-conversion]
                        char_for_insertion = convert_from_8bit_to_utf_c2 ((unsigned char) x_key);
                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^~~~~~~~~~~~~~~~~~~~~
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     src/editor/editwidget.c | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/editor/editwidget.c b/src/editor/editwidget.c
    index d6296e0..0fd3658 100644
    a b static cb_ret_t 
    711711edit_dialog_command_execute (WDialog * h, long command) 
    712712{ 
    713713    Widget *wh = WIDGET (h); 
    714     gboolean ret = MSG_HANDLED; 
     714    cb_ret_t ret = MSG_HANDLED; 
    715715 
    716716    switch (command) 
    717717    { 
    edit_translate_key (WEdit * edit, long x_key, int *cmd, int *ch) 
    854854                if (!edit->utf8) 
    855855                    char_for_insertion = c; 
    856856                else 
    857                     char_for_insertion = convert_from_8bit_to_utf_c2 ((unsigned char) x_key); 
     857                    char_for_insertion = convert_from_8bit_to_utf_c2 ((char) x_key); 
    858858                goto fin; 
    859859            } 
    860860        }