Avoid pointer arithmetic on void* in test/integration/rallocx.c

This commit is contained in:
Mike Hommey 2014-05-21 18:13:21 +09:00 committed by Jason Evans
parent 86e2e703ff
commit 3a730dfd50

View File

@ -95,7 +95,8 @@ TEST_BEGIN(test_zero)
"Expected zeroed memory"); "Expected zeroed memory");
} }
if (psz != qsz) { if (psz != qsz) {
memset(q+psz, FILL_BYTE, qsz-psz); memset((void *)(uintptr_t)q+psz, FILL_BYTE,
qsz-psz);
psz = qsz; psz = qsz;
} }
p = q; p = q;
@ -159,8 +160,9 @@ TEST_BEGIN(test_lg_align_and_zero)
} else { } else {
assert_false(validate_fill(q, 0, 0, MAX_VALIDATE), assert_false(validate_fill(q, 0, 0, MAX_VALIDATE),
"Expected zeroed memory"); "Expected zeroed memory");
assert_false(validate_fill(q+sz-MAX_VALIDATE, 0, 0, assert_false(validate_fill(
MAX_VALIDATE), "Expected zeroed memory"); (void *)(uintptr_t)q+sz-MAX_VALIDATE,
0, 0, MAX_VALIDATE), "Expected zeroed memory");
} }
p = q; p = q;
} }