From e094270980f1ca8af86a64cee0dbb6f1df670619 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 6 Sep 2021 08:00:00 +0000 Subject: Remove redundant casts of memory allocating functions returning void * Return values of functions returning "void *", e.g. calloc, malloc, realloc, xcalloc, xmalloc, and xrealloc, do not need explicit casts. Signed-off-by: Dmitry V. Levin --- lib/ChangeLog | 6 ++++++ lib/dynamicsizehash.c | 2 +- lib/dynamicsizehash_concurrent.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/ChangeLog b/lib/ChangeLog index 60d32082..563b0b6a 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2021-09-06 Dmitry V. Levin + + * dynamicsizehash.c (INIT(NAME)): Remove cast of calloc return value. + * dynamicsizehash_concurrent.c (INIT(NAME)): Remove cast of malloc + return value. + 2021-08-23 Saleem Abdulrasool * system.h: Remove inline definition for error and error_message_count diff --git a/lib/dynamicsizehash.c b/lib/dynamicsizehash.c index f9406eba..76c86dad 100644 --- a/lib/dynamicsizehash.c +++ b/lib/dynamicsizehash.c @@ -184,7 +184,7 @@ INIT(NAME) (NAME *htab, size_t init_size) #ifdef ITERATE htab->first = NULL; #endif - htab->table = (void *) calloc ((init_size + 1), sizeof (htab->table[0])); + htab->table = calloc ((init_size + 1), sizeof (htab->table[0])); if (htab->table == NULL) return -1; diff --git a/lib/dynamicsizehash_concurrent.c b/lib/dynamicsizehash_concurrent.c index 2d53bec6..4e2e2476 100644 --- a/lib/dynamicsizehash_concurrent.c +++ b/lib/dynamicsizehash_concurrent.c @@ -355,7 +355,7 @@ INIT(NAME) (NAME *htab, size_t init_size) pthread_rwlock_init(&htab->resize_rwl, NULL); - htab->table = (void *) malloc ((init_size + 1) * sizeof (htab->table[0])); + htab->table = malloc ((init_size + 1) * sizeof (htab->table[0])); if (htab->table == NULL) return -1; -- cgit v1.2.3