mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-03 12:19:20 +02:00
gobject: Cast various inverted bitfield constants to unsigned
This fixes `-Wsign-conversion` warnings, though I’m not sure why the compiler is emitting them. The signed/unsigned status of flag enum members is not particularly well defined in the C standard (and even less well understood by me), so just do what seems necessary to shut the compiler up. The benefits of enabling `-Wsign-conversion` across the codebase hopefully outweighs this noise. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Helps: #3405
This commit is contained in:
@@ -3628,7 +3628,7 @@ type_add_flags_W (TypeNode *node,
|
||||
{
|
||||
guint dflags;
|
||||
|
||||
g_return_if_fail ((flags & ~TYPE_FLAG_MASK) == 0);
|
||||
g_return_if_fail ((flags & (unsigned) ~TYPE_FLAG_MASK) == 0);
|
||||
g_return_if_fail (node != NULL);
|
||||
|
||||
if ((flags & TYPE_FLAG_MASK) && node->is_classed && node->data && node->data->class.class)
|
||||
@@ -3725,7 +3725,7 @@ _g_type_test_flags (GType type,
|
||||
node = lookup_type_node_I (type);
|
||||
if (node)
|
||||
{
|
||||
if ((flags & ~NODE_FLAG_MASK) == 0)
|
||||
if ((flags & (unsigned) ~NODE_FLAG_MASK) == 0)
|
||||
{
|
||||
if ((flags & G_TYPE_FLAG_CLASSED) && !node->is_classed)
|
||||
return FALSE;
|
||||
|
Reference in New Issue
Block a user