From 643254d461a4177efc2838aeea669c5de66bca97 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 20 Feb 2016 15:09:10 +0000
Subject: [PATCH] widget/dialog.c: cleanup -Wcast-qual warning
In file included from ../../lib/widget.h:18:0,
from dialog.c:43:
dialog.c: In function 'dlg_find_widget_callback':
../../lib/widget/widget-common.h:13:20: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
#define WIDGET(x) ((Widget *)(x))
^
dialog.c:202:23: note: in expansion of macro 'WIDGET'
const Widget *w = WIDGET (a);
^
dialog.c:203:22: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
widget_cb_fn f = (widget_cb_fn) b;
^
In file included from ../../lib/widget.h:18:0,
from dialog.c:43:
dialog.c: In function 'dlg_find_widget_by_id':
../../lib/widget/widget-common.h:13:20: warning: cast discards 'const' qualifier from pointer target type [-Wcast-qual]
#define WIDGET(x) ((Widget *)(x))
^
dialog.c:582:17: note: in expansion of macro 'WIDGET'
Widget *w = WIDGET (a);
^
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/widget/dialog.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c
index a53c046..19f9688 100644
a
|
b
|
dlg_unfocus (WDialog * h) |
199 | 199 | static int |
200 | 200 | dlg_find_widget_callback (const void *a, const void *b) |
201 | 201 | { |
202 | | const Widget *w = WIDGET (a); |
203 | | widget_cb_fn f = (widget_cb_fn) b; |
| 202 | const Widget *w = CWIDGET (a); |
| 203 | const widget_cb_fn f = b; |
204 | 204 | |
205 | 205 | return (w->callback == f) ? 0 : 1; |
206 | 206 | } |
… |
… |
frontend_dlg_run (WDialog * h) |
579 | 579 | static int |
580 | 580 | dlg_find_widget_by_id (gconstpointer a, gconstpointer b) |
581 | 581 | { |
582 | | Widget *w = WIDGET (a); |
| 582 | const Widget *w = CWIDGET (a); |
583 | 583 | unsigned long id = GPOINTER_TO_UINT (b); |
584 | 584 | |
585 | 585 | return w->id == id ? 0 : 1; |