Fix various bitfield warnings
authorMatthias Clasen <mclasen@redhat.com>
Thu, 27 Apr 2023 04:46:36 +0000 (06:46 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 27 Apr 2023 11:42:03 +0000 (13:42 +0200)
clang rightly complains about using gboolean
as type for bitfields, since it is signed.
Avoid that.

gsk/gl/gskglcommandqueue.c
gsk/gl/gskglprofiler.c
gsk/gskprofiler.c
gsk/gskrenderer.c
gtk/gtkbuilderprivate.h
gtk/gtkfilesystemmodel.c

index d5aa01a5f8a978ae0867daefe99daf907e34967c..d286c001babea60a936b9a94f64a20b8acf0305d 100644 (file)
@@ -1020,10 +1020,10 @@ gsk_gl_command_queue_execute (GskGLCommandQueue    *self,
   guint program = 0;
   guint width = 0;
   guint height = 0;
-  G_GNUC_UNUSED guint n_binds = 0;
-  guint n_fbos = 0;
-  G_GNUC_UNUSED guint n_uniforms = 0;
-  guint n_programs = 0;
+  G_GNUC_UNUSED unsigned int n_binds = 0;
+  G_GNUC_UNUSED unsigned int n_fbos = 0;
+  G_GNUC_UNUSED unsigned int n_uniforms = 0;
+  G_GNUC_UNUSED unsigned int n_programs = 0;
   guint vao_id;
   guint vbo_id;
   int textures[4];
index 27216418585ff9ec567c5de2043aa99dc3caae12..6aff5ab0a50be5e633d135dcaa8cbb495f77bba8 100644 (file)
@@ -18,9 +18,9 @@ struct _GskGLProfiler
   GLuint gl_queries[N_QUERIES];
   GLuint active_query;
 
-  gboolean has_queries : 1;
-  gboolean has_timer : 1;
-  gboolean first_frame : 1;
+  unsigned int has_queries : 1;
+  unsigned int has_timer : 1;
+  unsigned int first_frame : 1;
 };
 
 enum {
index a34844eb7064d585524f6738af6a4768bb9e2bfe..3f35646a33ae235df16fdbaf48d8ae51bd5ab27e 100644 (file)
@@ -9,7 +9,7 @@ typedef struct {
   char *description;
   gint64 value;
   gint64 n_samples;
-  gboolean can_reset : 1;
+  unsigned int can_reset : 1;
 } NamedCounter;
 
 typedef struct {
@@ -21,9 +21,9 @@ typedef struct {
   gint64 max_value;
   gint64 avg_value;
   gint64 n_samples;
-  gboolean in_flight : 1;
-  gboolean can_reset : 1;
-  gboolean invert : 1;
+  unsigned int in_flight : 1;
+  unsigned int can_reset : 1;
+  unsigned int invert : 1;
 } NamedTimer;
 
 typedef struct {
index eeb640850654ddf47d3b97bea19b9373244296c1..5bd214e026423d05027b9d4994a353cced058644 100644 (file)
@@ -83,7 +83,7 @@ typedef struct
 
   GskDebugFlags debug_flags;
 
-  gboolean is_realized : 1;
+  unsigned int is_realized : 1;
 } GskRendererPrivate;
 
 G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GskRenderer, gsk_renderer, G_TYPE_OBJECT)
index 218e33628a36f4d08d6f98a4ae4c2ec644e76ca6..8e9708ba8e28f877ad252f9e7a74265a69a0216d 100644 (file)
@@ -69,9 +69,9 @@ typedef struct {
   GParamSpec *pspec;
   gpointer value;
   GString *text;
-  gboolean translatable : 1;
-  gboolean bound        : 1;
-  gboolean applied      : 1;
+  unsigned int translatable : 1;
+  unsigned int bound        : 1;
+  unsigned int applied      : 1;
   char *context;
   int line;
   int col;
index 47129f10d3ec0cdb92740d428a0ca72edf88657f..a772d67aa650f3b8e5807072844b34b1a8711fe1 100644 (file)
@@ -66,22 +66,21 @@ struct _GtkFileSystemModel
   GArray *              files;          /* array of FileModelNode containing all our files */
   guint                 n_nodes_valid;  /* count of valid nodes (i.e. those whose node->row is accurate) */
   GHashTable *          file_lookup;    /* mapping of GFile => array index in model->files
-                                         * This hash table doesn't always have the same number of entries as the files array;
-                                         * The hash table gets re-populated in node_get_for_file() if this mismatch is
-                                         * detected.
+                                         * This hash table doesn't always have the same number of entries
+                                         * as the files array; it gets re-populated in node_get_for_file()
+                                         * if this mismatch is detected.
                                          */
 
   GtkFileFilter *       filter;         /* filter to use for deciding which nodes are visible */
 
   guint                 frozen;         /* number of times we're frozen */
 
-  gboolean              filter_on_thaw :1;/* set when filtering needs to happen upon thawing */
-
-  guint                 show_hidden :1; /* whether to show hidden files */
-  guint                 show_folders :1;/* whether to show folders */
-  guint                 show_files :1;  /* whether to show files */
-  guint                 filter_folders :1;/* whether filter applies to folders */
-  guint                 can_select_files : 1;
+  unsigned int          filter_on_thaw   : 1; /* set when filtering needs to happen upon thawing */
+  unsigned int          show_hidden      : 1; /* whether to show hidden files */
+  unsigned int          show_folders     : 1; /* whether to show folders */
+  unsigned int          show_files       : 1; /* whether to show files */
+  unsigned int          filter_folders   : 1; /* whether filter applies to folders */
+  unsigned int          can_select_files : 1;
 };
 
 static void freeze_updates (GtkFileSystemModel *model);