tidy-up: make per-file ARRAYSIZE macros global as CURL_ARRAYSIZE

Closes #16111
This commit is contained in:
Viktor Szakats 2025-01-28 12:09:55 +01:00
parent 9da9a0226d
commit 13b2ea68f0
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 37 additions and 84 deletions

View file

@ -125,10 +125,6 @@
#include "curl_memory.h"
#include "memdebug.h"
#ifndef ARRAYSIZE
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
#endif
#ifdef USE_NGHTTP2
static void data_priority_cleanup(struct Curl_easy *data);
#else
@ -566,7 +562,7 @@ void Curl_conn_free(struct Curl_easy *data, struct connectdata *conn)
DEBUGASSERT(conn);
for(i = 0; i < ARRAYSIZE(conn->cfilter); ++i) {
for(i = 0; i < CURL_ARRAYSIZE(conn->cfilter); ++i) {
Curl_conn_cf_discard_all(data, conn, (int)i);
}
@ -3106,7 +3102,7 @@ static CURLcode parse_connect_to_slist(struct Curl_easy *data,
DEBUGF(infof(data, "check Alt-Svc for host %s", host));
if(srcalpnid == ALPN_none) {
/* scan all alt-svc protocol ids in order or relevance */
for(i = 0; !hit && (i < ARRAYSIZE(alpn_ids)); ++i) {
for(i = 0; !hit && (i < CURL_ARRAYSIZE(alpn_ids)); ++i) {
srcalpnid = alpn_ids[i];
hit = Curl_altsvc_lookup(data->asi,
srcalpnid, host, conn->remote_port, /* from */