More alignment-related fixes.

Partial-backout 8a21d8d233.  The
assertions should have remained relaxed since these functions are used
with non-posix_memalign()ed data.
This commit is contained in:
Ryan Lortie 2010-05-26 23:34:31 -04:00
parent 866e3dda60
commit 271997deb5

View File

@ -1151,7 +1151,7 @@ random_instance_write (RandomInstance *instance,
GRand *rand; GRand *rand;
gint i; 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); rand = g_rand_new_with_seed (instance->seed);
for (i = 0; i < instance->size; i++) for (i = 0; i < instance->size; i++)
@ -1178,7 +1178,7 @@ random_instance_assert (RandomInstance *instance,
GRand *rand; GRand *rand;
gint i; 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); g_assert_cmpint (size, ==, instance->size);
rand = g_rand_new_with_seed (instance->seed); rand = g_rand_new_with_seed (instance->seed);
@ -1201,7 +1201,7 @@ random_instance_check (RandomInstance *instance,
GRand *rand; GRand *rand;
gint i; gint i;
g_assert_cmpint ((gsize) buffer & instance->alignment, ==, 0); g_assert_cmpint ((gsize) buffer & ALIGN_BITS & instance->alignment, ==, 0);
if (size != instance->size) if (size != instance->size)
return FALSE; return FALSE;