tidy-up: drop stray casts for allocated pointers

Closes #21865
This commit is contained in:
Viktor Szakats 2026-06-05 01:23:06 +02:00
parent cb307544ad
commit 1b8f4dba28
No known key found for this signature in database
16 changed files with 22 additions and 32 deletions

View file

@ -105,7 +105,7 @@ static voidpf zalloc_func(voidpf opaque, unsigned int items, unsigned int size)
{
(void)opaque;
/* not a typo, keep it curlx_calloc() */
return (voidpf)curlx_calloc(items, size);
return curlx_calloc(items, size);
}
static void zfree_func(voidpf opaque, voidpf ptr)
{

View file

@ -213,8 +213,7 @@ static size_t win_console(intptr_t fhnd, struct OutStruct *outs,
/* grow the buffer if needed */
if(len > global->term.len) {
wchar_t *buf = (wchar_t *)curlx_realloc(global->term.buf,
len * sizeof(wchar_t));
wchar_t *buf = curlx_realloc(global->term.buf, len * sizeof(wchar_t));
if(!buf)
return CURL_WRITEFUNC_ERROR;
global->term.len = len;

View file

@ -33,7 +33,7 @@
static struct tool_mime *tool_mime_new(struct tool_mime *parent,
toolmimekind kind)
{
struct tool_mime *m = (struct tool_mime *)curlx_calloc(1, sizeof(*m));
struct tool_mime *m = curlx_calloc(1, sizeof(*m));
if(m) {
m->kind = kind;

View file

@ -1709,9 +1709,7 @@ static int cb_timeout(CURLM *multi, long timeout_ms, void *userp)
static struct contextuv *create_context(curl_socket_t sockfd,
struct datauv *uv)
{
struct contextuv *c;
c = (struct contextuv *)curlx_malloc(sizeof(*c));
struct contextuv *c = curlx_malloc(sizeof(*c));
c->sockfd = sockfd;
c->uv = uv;