aboutsummaryrefslogtreecommitdiff
path: root/testcases/misc
diff options
context:
space:
mode:
authorCyril Hrubis <chrubis@suse.cz>2014-09-24 16:34:35 +0200
committerCyril Hrubis <chrubis@suse.cz>2014-09-24 16:34:35 +0200
commit4e2bab8415bfd5ddd552220203ed22c93a4617e5 (patch)
tree8c463b7507cee4f9bc63e336c37c34cd8a7ae83f /testcases/misc
parent8b35601743f74e3199cdd9139b9ff95d00d2833b (diff)
Make use of NULL
Replace all (type *)0 with NULL Created with coccinelle patch: @@ type T; @@ -(T*)0 +NULL Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Diffstat (limited to 'testcases/misc')
-rw-r--r--testcases/misc/math/float/main.c4
-rw-r--r--testcases/misc/math/float/thread_code.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/testcases/misc/math/float/main.c b/testcases/misc/math/float/main.c
index e947d0ffd..d71ca18e6 100644
--- a/testcases/misc/math/float/main.c
+++ b/testcases/misc/math/float/main.c
@@ -133,8 +133,8 @@ int main(int argc, char *argv[])
tst_tmpdir();
- setbuf(stdout, (char *)0);
- setbuf(stderr, (char *)0);
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
datadir[0] = '.';
datadir[1] = '\0';
diff --git a/testcases/misc/math/float/thread_code.c b/testcases/misc/math/float/thread_code.c
index 4eb6ff668..ca18cef1e 100644
--- a/testcases/misc/math/float/thread_code.c
+++ b/testcases/misc/math/float/thread_code.c
@@ -69,7 +69,7 @@ static size_t read_file(char *fname, void **data)
return (size_t) 0;
}
- while ((buffer = malloc(fsize)) == (void *)0) {
+ while ((buffer = malloc(fsize)) == NULL) {
if (errno == EINTR || errno == 0) {
printf("Error malloc'ing: %s\n", strerror(errno));
pthread_testcancel();
@@ -278,7 +278,7 @@ void *thread_code(void *arg)
{
TH_DATA *th_data = (TH_DATA *) arg;
size_t fsize, fsize2, fsize3;
- double *din, *dex, *dex2 = (double *)0;
+ double *din, *dex, *dex2 = NULL;
int imax, index;
fsize = read_file(th_data->th_func.din_fname, (void **)&din);
@@ -408,5 +408,5 @@ file_size_error:
SAFE_FREE(dex);
if (fsize3)
SAFE_FREE(dex2);
- pthread_exit((void *)0);
+ pthread_exit(NULL);
}