diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 83f63e1a2b..efb69aeafa 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1660,16 +1660,18 @@ compare_properties (gconstpointer a, gconstpointer b, gpointer style) _gtk_style_property_get_name (GTK_STYLE_PROPERTY (styles[*ub].property))); } +/* This is looking into a GPtrArray where each "pointer" is actually + * GINT_TO_POINTER (id), so a and b are pointers to pointer-sized quantities */ static int compare_custom_properties (gconstpointer a, gconstpointer b, gpointer user_data) { GtkCssCustomPropertyPool *pool = user_data; - int id1 = GPOINTER_TO_INT (*((const int *) a)); - int id2 = GPOINTER_TO_INT (*((const int *) b)); + const void * const *ap = a; + const void * const *bp = b; const char *name1, *name2; - name1 = gtk_css_custom_property_pool_get_name (pool, id1); - name2 = gtk_css_custom_property_pool_get_name (pool, id2); + name1 = gtk_css_custom_property_pool_get_name (pool, GPOINTER_TO_INT (*ap)); + name2 = gtk_css_custom_property_pool_get_name (pool, GPOINTER_TO_INT (*bp)); return strcmp (name1, name2); } diff --git a/gtk/gtkcssvariableset.c b/gtk/gtkcssvariableset.c index 957d18ebcc..5e0b699daa 100644 --- a/gtk/gtkcssvariableset.c +++ b/gtk/gtkcssvariableset.c @@ -309,7 +309,10 @@ gtk_css_variable_set_list_ids (GtkCssVariableSet *self) g_hash_table_iter_init (&iter, all_ids); while (g_hash_table_iter_next (&iter, &id, NULL)) - g_array_append_val (ret, id); + { + int value = GPOINTER_TO_INT (id); + g_array_append_val (ret, value); + } g_hash_table_unref (all_ids);