From 1abe24d5246c5a5bb78ff7f1db5b5772b1b7c70e Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Tue, 22 Dec 2020 15:12:20 +0000
Subject: [PATCH] (group.c) Fix -Wcast-qual warning
group.c:199:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
^
group.c:231:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
^
group.c:263:21: warning: cast from 'const struct Widget *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
^
Found by Clang-11
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/widget/group.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/widget/group.c b/lib/widget/group.c
index f8e318bd9..96d2f2770 100644
a
|
b
|
group_default_find (const Widget * w, const Widget * what) |
196 | 196 | { |
197 | 197 | GList *iter; |
198 | 198 | |
199 | | for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
| 199 | for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
200 | 200 | { |
201 | 201 | w0 = widget_find (WIDGET (iter->data), what); |
202 | 202 | if (w0 != NULL) |
… |
… |
group_default_find_by_type (const Widget * w, widget_cb_fn cb) |
228 | 228 | { |
229 | 229 | GList *iter; |
230 | 230 | |
231 | | for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
| 231 | for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
232 | 232 | { |
233 | 233 | w0 = widget_find_by_type (WIDGET (iter->data), cb); |
234 | 234 | if (w0 != NULL) |
… |
… |
group_default_find_by_id (const Widget * w, unsigned long id) |
260 | 260 | { |
261 | 261 | GList *iter; |
262 | 262 | |
263 | | for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
| 263 | for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter)) |
264 | 264 | { |
265 | 265 | w0 = widget_find_by_id (WIDGET (iter->data), id); |
266 | 266 | if (w0 != NULL) |