headers: name the arguments the way the definitions name them

Eleven arguments are named one way in the header and another in the
definition. the compiler only checks types so nothing is broken, but the
header is what people read first, and then the name changes under them
in the source:

```
curl_dbg_malloc          size     ->  wantedsize
curl_dbg_calloc          n, size  ->  wanted_elements, wanted_size
curl_dbg_realloc         size     ->  wantedsize
curl_dbg_strdup          src      ->  source
r_freeaddrinfo           res      ->  cahead
my_get_line              fp, db   ->  input, buf
curl_slist_append_ccsid  l        ->  list
curl_version_info_ccsid  cid      ->  ccsid
curl_easy_setopt_ccsid   curl     ->  easy
```

Follow-up to df6014894b #20794

Closes #22550
This commit is contained in:
Anton Karpov 2026-08-10 00:48:09 +03:00 committed by Viktor Szakats
parent 406edd036a
commit 05ddf5511a
No known key found for this signature in database
5 changed files with 19 additions and 16 deletions

View file

@ -1373,13 +1373,15 @@ extern FILE *curl_dbg_logfile;
/* memory functions */
CURL_EXTERN void curl_dbg_free(void *ptr, int line, const char *source);
CURL_EXTERN ALLOC_FUNC ALLOC_SIZE(1)
void *curl_dbg_malloc(size_t size, int line, const char *source);
void *curl_dbg_malloc(size_t wantedsize, int line, const char *source);
CURL_EXTERN ALLOC_FUNC ALLOC_SIZE2(1, 2)
void *curl_dbg_calloc(size_t n, size_t size, int line, const char *source);
void *curl_dbg_calloc(size_t wanted_elements, size_t wanted_size,
int line, const char *source);
CURL_EXTERN ALLOC_SIZE(2)
void *curl_dbg_realloc(void *ptr, size_t size, int line, const char *source);
void *curl_dbg_realloc(void *ptr, size_t wantedsize, int line,
const char *source);
CURL_EXTERN ALLOC_FUNC
char *curl_dbg_strdup(const char *str, int line, const char *src);
char *curl_dbg_strdup(const char *str, int line, const char *source);
#if defined(_WIN32) && defined(UNICODE)
CURL_EXTERN ALLOC_FUNC
wchar_t *curl_dbg_wcsdup(const wchar_t *str, int line, const char *source);

View file

@ -43,7 +43,7 @@
# include <arpa/inet.h>
#endif
void r_freeaddrinfo(struct addrinfo *res);
void r_freeaddrinfo(struct addrinfo *cahead);
int r_getaddrinfo(const char *node,
const char *service,
const struct addrinfo *hints,