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:
Philip Withnall
2025-04-11 15:08:16 +01:00
parent 70ddc35340
commit 633e49c8d1
6 changed files with 16 additions and 16 deletions

View File

@@ -948,7 +948,7 @@ g_object_base_class_init (GObjectClass *class)
GObjectClass *pclass = g_type_class_peek_parent (class);
/* Don't inherit HAS_DERIVED_CLASS flag from parent class */
class->flags &= ~CLASS_HAS_DERIVED_CLASS_FLAG;
class->flags &= (unsigned) ~CLASS_HAS_DERIVED_CLASS_FLAG;
if (pclass)
pclass->flags |= CLASS_HAS_DERIVED_CLASS_FLAG;