More alignment-related fixes.
authorRyan Lortie <desrt@desrt.ca>
Thu, 27 May 2010 03:34:31 +0000 (23:34 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 27 May 2010 15:07:19 +0000 (11:07 -0400)
Partial-backout 8a21d8d23317ecebe46007f1fd5f7459bf182415.  The
assertions should have remained relaxed since these functions are used
with non-posix_memalign()ed data.

glib/tests/gvariant.c

index aa55e74..020a3fd 100644 (file)
@@ -1151,7 +1151,7 @@ random_instance_write (RandomInstance *instance,
   GRand *rand;
   gint i;
 
-  g_assert_cmpint ((gsize) buffer & instance->alignment, ==, 0);
+  g_assert_cmpint ((gsize) buffer & ALIGN_BITS & instance->alignment, ==, 0);
 
   rand = g_rand_new_with_seed (instance->seed);
   for (i = 0; i < instance->size; i++)
@@ -1178,7 +1178,7 @@ random_instance_assert (RandomInstance *instance,
   GRand *rand;
   gint i;
 
-  g_assert_cmpint ((gsize) buffer & instance->alignment, ==, 0);
+  g_assert_cmpint ((gsize) buffer & ALIGN_BITS & instance->alignment, ==, 0);
   g_assert_cmpint (size, ==, instance->size);
 
   rand = g_rand_new_with_seed (instance->seed);
@@ -1201,7 +1201,7 @@ random_instance_check (RandomInstance *instance,
   GRand *rand;
   gint i;
 
-  g_assert_cmpint ((gsize) buffer & instance->alignment, ==, 0);
+  g_assert_cmpint ((gsize) buffer & ALIGN_BITS & instance->alignment, ==, 0);
 
   if (size != instance->size)
     return FALSE;