From bb051a0a3c0febe9d3fabb21ae5b7fcc2ae7aa10 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 14 May 2009 01:39:07 +0200 Subject: Make some tests ISO C 99 compliant. --- tests/test-memrchr.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/test-memrchr.c') diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c index f829a226ae..63568c1566 100644 --- a/tests/test-memrchr.c +++ b/tests/test-memrchr.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Free Software Foundation + * Copyright (C) 2008-2009 Free Software Foundation * Written by Eric Blake and Bruno Haible * * This program is free software: you can redistribute it and/or modify @@ -22,6 +22,8 @@ #include #include +#include "zerosize-ptr.h" + #define ASSERT(expr) \ do \ { \ @@ -41,8 +43,6 @@ int main () { - void *nil = NULL; /* Use to avoid gcc attribute((nonnull)) warnings. */ - size_t n = 0x100000; char *input = malloc (n); ASSERT (input); @@ -58,7 +58,7 @@ main () ASSERT (MEMRCHR (input, 'a', n) == input + n - 1); ASSERT (MEMRCHR (input, 'a', 0) == NULL); - ASSERT (MEMRCHR (nil, 'a', 0) == NULL); + ASSERT (MEMRCHR (zerosize_ptr (), 'a', 0) == NULL); ASSERT (MEMRCHR (input, 'b', n) == input + n - 2); ASSERT (MEMRCHR (input, 'c', n) == input + n - 3); -- cgit v1.2.1