Ticket #3598: mc-3598-0029-widget-buttonbar.c-cleanup-Wcast-qual-warning.patch

File mc-3598-0029-widget-buttonbar.c-cleanup-Wcast-qual-warning.patch, 1.9 KB (added by and, 8 years ago)
  • lib/widget/buttonbar.c

    From a3c05733c59a749d31cb6cb720f2718eb9f44933 Mon Sep 17 00:00:00 2001
    From: Andreas Mohr <and@gmx.li>
    Date: Sat, 20 Feb 2016 16:02:05 +0000
    Subject: [PATCH] widget/buttonbar.c: cleanup -Wcast-qual warning
    
    buttonbar.c: In function 'buttonbar_set_label':
    ../../lib/widget/widget-common.h:13:20: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
     #define WIDGET(x) ((Widget *)(x))
                        ^
    buttonbar.c:280:40: note: in expansion of macro 'WIDGET'
             bb->labels[idx - 1].receiver = WIDGET (receiver);
                                            ^
    
    Signed-off-by: Andreas Mohr <and@gmx.li>
    ---
     lib/widget/buttonbar.c | 2 +-
     lib/widget/buttonbar.h | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/lib/widget/buttonbar.c b/lib/widget/buttonbar.c
    index f879969..3049991 100644
    a b buttonbar_new (gboolean visible) 
    262262 
    263263void 
    264264buttonbar_set_label (WButtonBar * bb, int idx, const char *text, 
    265                      const struct global_keymap_t *keymap, const Widget * receiver) 
     265                     const struct global_keymap_t *keymap, Widget * receiver) 
    266266{ 
    267267    if ((bb != NULL) && (idx >= 1) && (idx <= BUTTONBAR_LABELS_NUM)) 
    268268    { 
  • lib/widget/buttonbar.h

    diff --git a/lib/widget/buttonbar.h b/lib/widget/buttonbar.h
    index 0efce71..011866e 100644
    a b struct global_keymap_t; 
    4242 
    4343WButtonBar *buttonbar_new (gboolean visible); 
    4444void buttonbar_set_label (WButtonBar * bb, int idx, const char *text, 
    45                           const struct global_keymap_t *keymap, const Widget * receiver); 
     45                          const struct global_keymap_t *keymap, Widget * receiver); 
    4646WButtonBar *find_buttonbar (const WDialog * h); 
    4747 
    4848/*** inline functions ****************************************************************************/