From 29fceb26aef5a65592dc62f1d17a68fa8312205d Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Tue, 22 Dec 2020 16:19:33 +0000
Subject: [PATCH] (chattr.c) Fix -Wcast-qual warning
chattr.c:398:34: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
w = WIDGET (g_list_nth_data (GROUP (cb)->widgets, Id - cb->top));
^
../../lib/widget/group.h:16:29: note: expanded from macro 'GROUP'
#define GROUP(x) ((WGroup *)(x))
^
chattr.c:515:27: warning: cast from 'const struct WChattrBoxes *' to 'struct WGroup *' drops const qualifier [-Wcast-qual]
for (i = cb->top, l = GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l))
^
../../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>
---
src/filemanager/chattr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/filemanager/chattr.c b/src/filemanager/chattr.c
index a8afaa33d..1b5121aa4 100644
a
|
b
|
chattr_toggle_select (const WChattrBoxes * cb, int Id) |
395 | 395 | Widget *w; |
396 | 396 | |
397 | 397 | /* find checkbox */ |
398 | | w = WIDGET (g_list_nth_data (GROUP (cb)->widgets, Id - cb->top)); |
| 398 | w = WIDGET (g_list_nth_data (CONST_GROUP (cb)->widgets, Id - cb->top)); |
399 | 399 | |
400 | 400 | check_attr[Id].selected = !check_attr[Id].selected; |
401 | 401 | |
… |
… |
checkboxes_save_state (const WChattrBoxes * cb) |
512 | 512 | int i; |
513 | 513 | GList *l; |
514 | 514 | |
515 | | for (i = cb->top, l = GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l)) |
| 515 | for (i = cb->top, l = CONST_GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l)) |
516 | 516 | { |
517 | 517 | int m; |
518 | 518 | |