summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDmitry V. Levin <[email protected]>2021-09-06 08:00:00 +0000
committerDmitry V. Levin <[email protected]>2021-09-09 08:01:00 +0000
commite094270980f1ca8af86a64cee0dbb6f1df670619 (patch)
tree1471f9586bb9e3d7f5448001353d47e94145a4ae /lib
parent02b05e183998943dd5a19ba783b8793e2ab9ab44 (diff)
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 <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/ChangeLog6
-rw-r--r--lib/dynamicsizehash.c2
-rw-r--r--lib/dynamicsizehash_concurrent.c2
3 files changed, 8 insertions, 2 deletions
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 <[email protected]>
+
+ * 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 <[email protected]>
* 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;