src/filemanager/chattr.c: fix -Wcast-qual warnings.

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>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andreas Mohr 2020-12-22 16:19:33 +00:00 committed by Andrew Borodin
parent e68c2f8c1b
commit 34616d6444
1 changed files with 2 additions and 2 deletions

View File

@ -394,7 +394,7 @@ chattr_toggle_select (const WChattrBoxes * cb, int Id)
Widget *w;
/* find checkbox */
w = WIDGET (g_list_nth_data (GROUP (cb)->widgets, Id - cb->top));
w = WIDGET (g_list_nth_data (CONST_GROUP (cb)->widgets, Id - cb->top));
check_attr[Id].selected = !check_attr[Id].selected;
@ -511,7 +511,7 @@ checkboxes_save_state (const WChattrBoxes * cb)
int i;
GList *l;
for (i = cb->top, l = GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l))
for (i = cb->top, l = CONST_GROUP (cb)->widgets; l != NULL; i++, l = g_list_next (l))
{
int m;