Ticket #4179: code cleanup before 4.8.27 release.

lib/widget/group.c: fix -Wcast-qual warnings:

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'
                            ^
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'
                            ^
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'
                            ^

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 15:12:20 +00:00 committed by Andrew Borodin
parent 77545fbb66
commit e68c2f8c1b
1 changed files with 3 additions and 3 deletions

View File

@ -195,7 +195,7 @@ group_default_find (const Widget * w, const Widget * what)
{
GList *iter;
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
{
w0 = widget_find (WIDGET (iter->data), what);
if (w0 != NULL)
@ -227,7 +227,7 @@ group_default_find_by_type (const Widget * w, widget_cb_fn cb)
{
GList *iter;
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
{
w0 = widget_find_by_type (WIDGET (iter->data), cb);
if (w0 != NULL)
@ -259,7 +259,7 @@ group_default_find_by_id (const Widget * w, unsigned long id)
{
GList *iter;
for (iter = GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
for (iter = CONST_GROUP (w)->widgets; iter != NULL; iter = g_list_next (iter))
{
w0 = widget_find_by_id (WIDGET (iter->data), id);
if (w0 != NULL)