lib: fix formatting nits (part 2)

From `lib/curl*` to `lib/g*`. With fixes to part 1.

part 1: 47a1ab2ebe #19764

Closes #19800
This commit is contained in:
Viktor Szakats 2025-11-27 04:27:26 +01:00
parent 3e2a946926
commit 86b346443b
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
56 changed files with 976 additions and 1088 deletions

View file

@ -71,8 +71,7 @@
# define vqualifier
#endif
void
Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
void Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
{
struct Curl_addrinfo *vqualifier canext;
struct Curl_addrinfo *ca;
@ -83,7 +82,6 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
}
}
#ifdef HAVE_GETADDRINFO
/*
* Curl_getaddrinfo_ex()
@ -98,12 +96,10 @@ Curl_freeaddrinfo(struct Curl_addrinfo *cahead)
* There should be no single call to system's getaddrinfo() in the
* whole library, any such call should be 'routed' through this one.
*/
int
Curl_getaddrinfo_ex(const char *nodename,
const char *servname,
const struct addrinfo *hints,
struct Curl_addrinfo **result)
int Curl_getaddrinfo_ex(const char *nodename,
const char *servname,
const struct addrinfo *hints,
struct Curl_addrinfo **result)
{
const struct addrinfo *ai;
struct addrinfo *aihead;
@ -176,7 +172,6 @@ Curl_getaddrinfo_ex(const char *nodename,
if(calast)
calast->ai_next = ca;
calast = ca;
}
/* destroy the addrinfo list */
@ -208,7 +203,6 @@ Curl_getaddrinfo_ex(const char *nodename,
}
#endif /* HAVE_GETADDRINFO */
/*
* Curl_he2ai()
*
@ -248,10 +242,8 @@ Curl_getaddrinfo_ex(const char *nodename,
*
* #define h_addr h_addr_list[0]
*/
#if !(defined(HAVE_GETADDRINFO) && defined(HAVE_GETADDRINFO_THREADSAFE))
struct Curl_addrinfo *
Curl_he2ai(const struct hostent *he, int port)
struct Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
{
struct Curl_addrinfo *ai;
struct Curl_addrinfo *prevai = NULL;
@ -350,10 +342,8 @@ Curl_he2ai(const struct hostent *he, int port)
* returns a Curl_addrinfo chain filled in correctly with information for the
* given address/host
*/
static CURLcode
ip2addr(struct Curl_addrinfo **addrp,
int af, const void *inaddr, const char *hostname, int port)
static CURLcode ip2addr(struct Curl_addrinfo **addrp, int af,
const void *inaddr, const char *hostname, int port)
{
struct Curl_addrinfo *ai;
size_t addrsize;
@ -473,7 +463,7 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath,
return NULL;
ai->ai_addr = (void *)((char *)ai + sizeof(struct Curl_addrinfo));
sa_un = (void *) ai->ai_addr;
sa_un = (void *)ai->ai_addr;
sa_un->sun_family = AF_UNIX;
/* sun_path must be able to store the null-terminated path */
@ -508,10 +498,8 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath,
* family otherwise present in memdebug.c. I put these ones here since they
* require a bunch of structs I did not want to include in memdebug.c
*/
void
curl_dbg_freeaddrinfo(struct addrinfo *freethis,
int line, const char *source)
void curl_dbg_freeaddrinfo(struct addrinfo *freethis,
int line, const char *source)
{
curl_dbg_log("ADDR %s:%d freeaddrinfo(%p)\n",
source, line, (void *)freethis);
@ -533,7 +521,6 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis,
}
#endif /* CURLDEBUG && HAVE_FREEADDRINFO */
#if defined(CURLDEBUG) && defined(HAVE_GETADDRINFO)
/*
* curl_dbg_getaddrinfo()
@ -542,13 +529,11 @@ curl_dbg_freeaddrinfo(struct addrinfo *freethis,
* family otherwise present in memdebug.c. I put these ones here since they
* require a bunch of structs I did not want to include in memdebug.c
*/
int
curl_dbg_getaddrinfo(const char *hostname,
const char *service,
const struct addrinfo *hints,
struct addrinfo **result,
int line, const char *source)
int curl_dbg_getaddrinfo(const char *hostname,
const char *service,
const struct addrinfo *hints,
struct addrinfo **result,
int line, const char *source)
{
#ifdef USE_LWIPSOCK
int res = lwip_getaddrinfo(hostname, service, hints, result);
@ -566,11 +551,10 @@ curl_dbg_getaddrinfo(const char *hostname,
#endif
if(res == 0)
/* success */
curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n",
source, line, (void *)*result);
curl_dbg_log("ADDR %s:%d getaddrinfo() = %p\n", source, line,
(void *)*result);
else
curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n",
source, line);
curl_dbg_log("ADDR %s:%d getaddrinfo() failed\n", source, line);
return res;
}
#endif /* CURLDEBUG && HAVE_GETADDRINFO */