[glib] More alignment-related fixes.



commit 271997deb56cc17af5fa7b59b3a67f4ee347be6c
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed May 26 23:34:31 2010 -0400

    More alignment-related fixes.
    
    Partial-backout 8a21d8d23317ecebe46007f1fd5f7459bf182415.  The
    assertions should have remained relaxed since these functions are used
    with non-posix_memalign()ed data.

 glib/tests/gvariant.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/tests/gvariant.c b/glib/tests/gvariant.c
index aa55e74..020a3fd 100644
--- a/glib/tests/gvariant.c
+++ b/glib/tests/gvariant.c
@@ -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;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]