lib: reserve 'result' for CURLcode

For consistency, whereever we use a local variable named 'result' that
is a CURLcode type. Make other types use other names.

Closes #21244
This commit is contained in:
Daniel Stenberg 2026-04-06 22:21:12 +02:00
parent 4cb4f9d602
commit 9f5d1a38d1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 66 additions and 67 deletions

View file

@ -41,16 +41,16 @@ void r_freeaddrinfo(struct addrinfo *cahead)
}
struct context {
struct ares_addrinfo *result;
struct ares_addrinfo *addr;
};
static void async_addrinfo_cb(void *userp, int status, int timeouts,
struct ares_addrinfo *result)
struct ares_addrinfo *addr)
{
struct context *ctx = (struct context *)userp;
(void)timeouts;
if(ARES_SUCCESS == status) {
ctx->result = result;
ctx->addr = addr;
}
}
@ -184,11 +184,11 @@ int r_getaddrinfo(const char *node,
/* Wait until no more requests are left to be processed */
ares_queue_wait_empty(channel, -1);
if(ctx.result) {
if(ctx.addr) {
/* convert the c-ares version */
*res = mk_getaddrinfo(ctx.result);
*res = mk_getaddrinfo(ctx.addr);
/* free the old */
ares_freeaddrinfo(ctx.result);
ares_freeaddrinfo(ctx.addr);
}
else
rc = EAI_NONAME; /* got nothing */