Fix some alignment issues
* Use GRAPHENE_ALIGN16 to ensure that GtkSnapshotState size is a multiple of 16 * Use G_STATIC_ASSERT instead of g_return_val_if_fail to make the wrong size (if it turns out to be wrong) be a compile-time erorr instead of a runtime one
This commit is contained in:
@@ -67,8 +67,6 @@ gtk_snapshot_state_array_new (void)
|
||||
{
|
||||
GtkRealSnapshotStateArray *array;
|
||||
|
||||
g_return_val_if_fail (sizeof (GtkSnapshotState) % 16 == 0, NULL);
|
||||
|
||||
array = g_slice_new (GtkRealSnapshotStateArray);
|
||||
|
||||
array->data = NULL;
|
||||
|
||||
@@ -40,6 +40,7 @@ typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot *snapshot,
|
||||
GskRenderNode **nodes,
|
||||
guint n_nodes);
|
||||
|
||||
GRAPHENE_ALIGN16
|
||||
struct _GtkSnapshotState {
|
||||
guint start_node_index;
|
||||
guint n_nodes;
|
||||
@@ -91,6 +92,8 @@ struct _GtkSnapshotState {
|
||||
} data;
|
||||
};
|
||||
|
||||
G_STATIC_ASSERT (sizeof (GtkSnapshotState) % 16 == 0);
|
||||
|
||||
/* This is a nasty little hack. We typedef GtkSnapshot to the fake object GdkSnapshot
|
||||
* so that we don't need to typecast between them.
|
||||
* After all, the GdkSnapshot only exist so poor language bindings don't trip. Hardcore
|
||||
|
||||
Reference in New Issue
Block a user