CLEANUP: Remove useless malloc() casts
This is not C++.
diff --git a/include/haproxy/chunk.h b/include/haproxy/chunk.h
index b5052d1..af9ef81 100644
--- a/include/haproxy/chunk.h
+++ b/include/haproxy/chunk.h
@@ -283,7 +283,7 @@
if (dst->size < src->size || !src->size)
dst->size++;
- dst->area = (char *)malloc(dst->size);
+ dst->area = malloc(dst->size);
if (!dst->area) {
dst->head = 0;
dst->data = 0;
diff --git a/include/haproxy/listener.h b/include/haproxy/listener.h
index e4cea50..17fe9e0 100644
--- a/include/haproxy/listener.h
+++ b/include/haproxy/listener.h
@@ -179,7 +179,7 @@
static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *file,
int line, const char *arg, struct xprt_ops *xprt)
{
- struct bind_conf *bind_conf = (void *)calloc(1, sizeof(struct bind_conf));
+ struct bind_conf *bind_conf = calloc(1, sizeof(struct bind_conf));
bind_conf->file = strdup(file);
bind_conf->line = line;
diff --git a/src/ev_select.c b/src/ev_select.c
index 1e9c48c..ab5da35 100644
--- a/src/ev_select.c
+++ b/src/ev_select.c
@@ -226,10 +226,10 @@
int fd_set_bytes;
fd_set_bytes = sizeof(fd_set) * (global.maxsock + FD_SETSIZE - 1) / FD_SETSIZE;
- tmp_evts[DIR_RD] = (fd_set *)calloc(1, fd_set_bytes);
+ tmp_evts[DIR_RD] = calloc(1, fd_set_bytes);
if (tmp_evts[DIR_RD] == NULL)
goto fail;
- tmp_evts[DIR_WR] = (fd_set *)calloc(1, fd_set_bytes);
+ tmp_evts[DIR_WR] = calloc(1, fd_set_bytes);
if (tmp_evts[DIR_WR] == NULL)
goto fail;
return 1;
diff --git a/src/http_htx.c b/src/http_htx.c
index a7951c0..53732d1 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -909,7 +909,7 @@
}
buf->size = global.tune.bufsize;
- buf->area = (char *)malloc(buf->size);
+ buf->area = malloc(buf->size);
if (!buf->area)
goto error;