From e05629e7fdf3c1ffddcf5052c662d77ef204a373 Mon Sep 17 00:00:00 2001 From: Moritz Grimm Date: Tue, 26 May 2015 08:04:04 +0200 Subject: [PATCH] Explicitly pass unsigned long to alloc functions This is just to squelch Wconversion warnings on older GCC, making the build output easier to read. No functional change. --- tests/check_xalloc.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/check_xalloc.c b/tests/check_xalloc.c index deacb39..278a155 100644 --- a/tests/check_xalloc.c +++ b/tests/check_xalloc.c @@ -10,10 +10,10 @@ START_TEST(test_malloc) { void *p; - p = xmalloc(0); + p = xmalloc(0UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xmalloc(1); + p = xmalloc(1UL); ck_assert_ptr_ne(p, NULL); xfree(p); } @@ -23,16 +23,16 @@ START_TEST(test_calloc) { void *p; - p = xcalloc(0, 0); + p = xcalloc(0UL, 0UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xcalloc(1, 0); + p = xcalloc(1UL, 0UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xcalloc(0, 1); + p = xcalloc(0UL, 1UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xcalloc(1, 1); + p = xcalloc(1UL, 1UL); ck_assert_ptr_ne(p, NULL); xfree(p); } @@ -42,20 +42,20 @@ START_TEST(test_reallocarray) { void *p; - p = xreallocarray(NULL, 0, 0); + p = xreallocarray(NULL, 0UL, 0UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xreallocarray(NULL, 1, 0); + p = xreallocarray(NULL, 1UL, 0UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xreallocarray(NULL, 0, 1); + p = xreallocarray(NULL, 0UL, 1UL); ck_assert_ptr_ne(p, NULL); xfree(p); - p = xreallocarray(NULL, 1, 1); + p = xreallocarray(NULL, 1UL, 1UL); ck_assert_ptr_ne(p, NULL); - p = xreallocarray(p, 2, 2); + p = xreallocarray(p, 2UL, 2UL); ck_assert_ptr_ne(p, NULL); - p = xreallocarray(p, 1, 1); + p = xreallocarray(p, 1UL, 1UL); ck_assert_ptr_ne(p, NULL); xfree(p); }