gtk: Pass G_ALIGNOF (...) to gtk_sort_keys_new

The sizeof and G_ALIGNOF are often, but not always, identical.
This commit is contained in:
Matt Turner 2023-06-19 15:47:17 -04:00
parent 447d1fab62
commit a444045386
4 changed files with 14 additions and 14 deletions

View File

@ -227,7 +227,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_BOOLEAN_SORT_KEYS_CLASS
: &GTK_DESCENDING_BOOLEAN_SORT_KEYS_CLASS,
sizeof (char),
sizeof (char));
G_ALIGNOF (char));
break;
case G_TYPE_CHAR:
@ -236,7 +236,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_CHAR_SORT_KEYS_CLASS
: &GTK_DESCENDING_CHAR_SORT_KEYS_CLASS,
sizeof (char),
sizeof (char));
G_ALIGNOF (char));
break;
case G_TYPE_UCHAR:
@ -245,7 +245,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_UCHAR_SORT_KEYS_CLASS
: &GTK_DESCENDING_UCHAR_SORT_KEYS_CLASS,
sizeof (guchar),
sizeof (guchar));
G_ALIGNOF (guchar));
break;
case G_TYPE_INT:
@ -254,7 +254,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_INT_SORT_KEYS_CLASS
: &GTK_DESCENDING_INT_SORT_KEYS_CLASS,
sizeof (int),
sizeof (int));
G_ALIGNOF (int));
break;
case G_TYPE_UINT:
@ -263,7 +263,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_UINT_SORT_KEYS_CLASS
: &GTK_DESCENDING_UINT_SORT_KEYS_CLASS,
sizeof (guint),
sizeof (guint));
G_ALIGNOF (guint));
break;
case G_TYPE_FLOAT:
@ -272,7 +272,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_FLOAT_SORT_KEYS_CLASS
: &GTK_DESCENDING_FLOAT_SORT_KEYS_CLASS,
sizeof (float),
sizeof (float));
G_ALIGNOF (float));
break;
case G_TYPE_DOUBLE:
@ -281,7 +281,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_DOUBLE_SORT_KEYS_CLASS
: &GTK_DESCENDING_DOUBLE_SORT_KEYS_CLASS,
sizeof (double),
sizeof (double));
G_ALIGNOF (double));
break;
case G_TYPE_LONG:
@ -290,7 +290,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_LONG_SORT_KEYS_CLASS
: &GTK_DESCENDING_LONG_SORT_KEYS_CLASS,
sizeof (long),
sizeof (long));
G_ALIGNOF (long));
break;
case G_TYPE_ULONG:
@ -299,7 +299,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_ULONG_SORT_KEYS_CLASS
: &GTK_DESCENDING_ULONG_SORT_KEYS_CLASS,
sizeof (gulong),
sizeof (gulong));
G_ALIGNOF (gulong));
break;
case G_TYPE_INT64:
@ -308,7 +308,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_INT64_SORT_KEYS_CLASS
: &GTK_DESCENDING_INT64_SORT_KEYS_CLASS,
sizeof (gint64),
sizeof (gint64));
G_ALIGNOF (gint64));
break;
case G_TYPE_UINT64:
@ -317,7 +317,7 @@ gtk_numeric_sort_keys_new (GtkNumericSorter *self)
? &GTK_ASCENDING_UINT64_SORT_KEYS_CLASS
: &GTK_DESCENDING_UINT64_SORT_KEYS_CLASS,
sizeof (guint64),
sizeof (guint64));
G_ALIGNOF (guint64));
break;
default:

View File

@ -304,7 +304,7 @@ gtk_sorter_get_keys (GtkSorter *self)
if (priv->keys)
return gtk_sort_keys_ref (priv->keys);
fallback = gtk_sort_keys_new (GtkDefaultSortKeys, &GTK_DEFAULT_SORT_KEYS_CLASS, sizeof (gpointer), sizeof (gpointer));
fallback = gtk_sort_keys_new (GtkDefaultSortKeys, &GTK_DEFAULT_SORT_KEYS_CLASS, sizeof (gpointer), G_ALIGNOF (gpointer));
fallback->sorter = g_object_ref (self);
return (GtkSortKeys *) fallback;

View File

@ -234,7 +234,7 @@ gtk_string_sort_keys_new (GtkStringSorter *self)
result = gtk_sort_keys_new (GtkStringSortKeys,
&GTK_STRING_SORT_KEYS_CLASS,
sizeof (char *),
sizeof (char *));
G_ALIGNOF (char *));
result->expression = gtk_expression_ref (self->expression);
result->ignore_case = self->ignore_case;

View File

@ -350,7 +350,7 @@ gtk_tree_list_row_sort_keys_new (GtkTreeListRowSorter *self)
result = gtk_sort_keys_new (GtkTreeListRowSortKeys,
&GTK_TREE_LIST_ROW_SORT_KEYS_CLASS,
sizeof (gpointer[MAX_KEY_DEPTH]),
sizeof (gpointer[MAX_KEY_DEPTH]));
G_ALIGNOF (gpointer));
if (self->sorter)
result->sort_keys = gtk_sorter_get_keys (self->sorter);