From: Viktor Szakats Date: Tue, 7 Oct 2025 10:49:02 +0000 (+0200) Subject: tidy-up: miscellaneous X-Git-Tag: rc-8_17_0-3~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71d1eec675b3b7629a6f5dc4609b231ce60ade2a;p=thirdparty%2Fcurl.git tidy-up: miscellaneous - cmake/Find*: make double quotes consistent. - drop redundant parenthesis. - GHA/checksrc: sync a step name with others. - whitespace. Closes #19233 --- diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 05dcc2ec91..c5b918aa8e 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -53,7 +53,7 @@ jobs: with: persist-credentials: false - - name: 'install' + - name: 'install prereqs' run: | python3 -m venv ~/venv ~/venv/bin/pip --disable-pip-version-check --no-input --no-cache-dir install --progress-bar off --prefer-binary \ diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 8dccb9e399..71829ec302 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -138,8 +138,8 @@ jobs: include: - { build: 'autotools', arch: 'x86_64', compiler: 'clang' } - { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' } - - { build: 'autotools', arch: 'arm64', compiler: 'clang' } - - { build: 'cmake' , arch: 'arm64', compiler: 'clang' } + - { build: 'autotools', arch: 'arm64' , compiler: 'clang' } + - { build: 'cmake' , arch: 'arm64' , compiler: 'clang' } fail-fast: false steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake index c129a76567..d2b50d9621 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake @@ -51,7 +51,7 @@ endif() if(BROTLI_FOUND) set(Brotli_FOUND TRUE) - set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}") + set(BROTLI_VERSION ${BROTLI_libbrotlicommon_VERSION}) string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}") message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") else() diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake index 36ff08e397..0a897aa13f 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake @@ -50,7 +50,7 @@ if(CURL_USE_PKGCONFIG AND endif() if(LDAP_FOUND) - set(LDAP_VERSION "${LDAP_ldap_VERSION}") + set(LDAP_VERSION ${LDAP_ldap_VERSION}) string(REPLACE ";" " " LDAP_CFLAGS "${LDAP_CFLAGS}") message(STATUS "Found LDAP (via pkg-config): ${LDAP_INCLUDE_DIRS} (found version \"${LDAP_VERSION}\")") else() diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake index e1bee7dc4c..11b4f076f4 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake @@ -59,7 +59,7 @@ endif() if(MBEDTLS_FOUND) set(MbedTLS_FOUND TRUE) - set(MBEDTLS_VERSION "${MBEDTLS_mbedtls_VERSION}") + set(MBEDTLS_VERSION ${MBEDTLS_mbedtls_VERSION}) string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}") message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") else() diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake index d3d3835213..cda3b0e08c 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake @@ -86,7 +86,7 @@ if(CURL_USE_PKGCONFIG AND endif() if(NGTCP2_FOUND) - set(NGTCP2_VERSION "${NGTCP2_libngtcp2_VERSION}") + set(NGTCP2_VERSION ${NGTCP2_libngtcp2_VERSION}) string(REPLACE ";" " " NGTCP2_CFLAGS "${NGTCP2_CFLAGS}") message(STATUS "Found NGTCP2 (via pkg-config): ${NGTCP2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") else() diff --git a/docs/examples/log_failed_transfers.c b/docs/examples/log_failed_transfers.c index fe5f02f882..9237f69b32 100644 --- a/docs/examples/log_failed_transfers.c +++ b/docs/examples/log_failed_transfers.c @@ -130,7 +130,7 @@ static int mem_add(struct mem *mem, const char *str) } #if defined(__GNUC__) || defined(__clang__) -__attribute__ ((format (printf, 2, 3))) +__attribute__((format(printf, 2, 3))) #endif static int mem_addf(struct mem *mem, const char *format, ...) { diff --git a/docs/examples/usercertinmem.c b/docs/examples/usercertinmem.c index c53fcde9cb..0fb5ab0de9 100644 --- a/docs/examples/usercertinmem.c +++ b/docs/examples/usercertinmem.c @@ -176,9 +176,9 @@ int main(void) /* both VERIFYPEER and VERIFYHOST are set to 0 in this case because there is no CA certificate */ - curl_easy_setopt(ch, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(ch, CURLOPT_SSL_VERIFYHOST, 0L); + curl_easy_setopt(ch, CURLOPT_URL, "https://www.example.com/"); curl_easy_setopt(ch, CURLOPT_SSLKEYTYPE, "PEM"); diff --git a/include/curl/curl.h b/include/curl/curl.h index 917b101420..9e07527dc9 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -401,12 +401,12 @@ typedef int (*curl_seek_callback)(void *instream, #define CURL_TRAILERFUNC_ABORT 1 typedef size_t (*curl_read_callback)(char *buffer, - size_t size, - size_t nitems, - void *instream); + size_t size, + size_t nitems, + void *instream); typedef int (*curl_trailer_callback)(struct curl_slist **list, - void *userdata); + void *userdata); typedef enum { CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ diff --git a/lib/ldap.c b/lib/ldap.c index 322c870bc2..8db1f41338 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -399,8 +399,8 @@ static CURLcode ldap_do(struct Curl_easy *data, bool *done) #ifdef LDAP_OPT_X_TLS if(conn->ssl_config.verifypeer) { /* OpenLDAP SDK supports BASE64 files. */ - if((data->set.ssl.cert_type) && - (!curl_strequal(data->set.ssl.cert_type, "PEM"))) { + if(data->set.ssl.cert_type && + !curl_strequal(data->set.ssl.cert_type, "PEM")) { failf(data, "LDAP local: ERROR OpenLDAP only supports PEM cert-type"); result = CURLE_SSL_CERTPROBLEM; goto quit; diff --git a/lib/urldata.h b/lib/urldata.h index c7e19201fe..19f96bbc17 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -419,12 +419,12 @@ struct hostname { * Flags on the keepon member of the Curl_transfer_keeper */ -#define KEEP_NONE 0 -#define KEEP_RECV (1<<0) /* there is or may be data to read */ -#define KEEP_SEND (1<<1) /* there is or may be data to write */ -#define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there - might still be data to read */ -#define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there +#define KEEP_NONE 0 +#define KEEP_RECV (1<<0) /* there is or may be data to read */ +#define KEEP_SEND (1<<1) /* there is or may be data to write */ +#define KEEP_RECV_HOLD (1<<2) /* when set, no reading should be done but there + might still be data to read */ +#define KEEP_SEND_HOLD (1<<3) /* when set, no writing should be done but there might still be data to write */ #define KEEP_RECV_PAUSE (1<<4) /* reading is paused */ #define KEEP_SEND_PAUSE (1<<5) /* writing is paused */ @@ -543,10 +543,10 @@ struct Curl_handler { followtype type); int defport; /* Default port. */ - curl_prot_t protocol; /* See CURLPROTO_* - this needs to be the single - specific protocol bit */ - curl_prot_t family; /* single bit for protocol family; basically the - non-TLS name of the protocol this is */ + curl_prot_t protocol; /* See CURLPROTO_* - this needs to be the single + specific protocol bit */ + curl_prot_t family; /* single bit for protocol family; basically the + non-TLS name of the protocol this is */ unsigned int flags; /* Extra particular characteristics, see PROTOPT_* */ }; @@ -574,13 +574,13 @@ struct Curl_handler { #define PROTOPT_PROXY_AS_HTTP (1<<11) /* allow this non-HTTP scheme over a HTTP proxy as HTTP proxies may know this protocol and act as a gateway */ -#define PROTOPT_WILDCARD (1<<12) /* protocol supports wildcard matching */ +#define PROTOPT_WILDCARD (1<<12) /* protocol supports wildcard matching */ #define PROTOPT_USERPWDCTRL (1<<13) /* Allow "control bytes" (< 32 ASCII) in username and password */ -#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol cannot proxy over TCP */ -#define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing - SSL connection in the same family - without having PROTOPT_SSL. */ +#define PROTOPT_NOTCPPROXY (1<<14) /* this protocol cannot proxy over TCP */ +#define PROTOPT_SSL_REUSE (1<<15) /* this protocol may reuse an existing + SSL connection in the same family + without having PROTOPT_SSL. */ #define CONNCHECK_NONE 0 /* No checks */ #define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 4b793b7cdb..1e9b629d8f 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -842,7 +842,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, result = Curl_bufref_memdup(out, ntlmbuf, size); error: - free(ntlmv2resp);/* Free the dynamic buffer allocated for NTLMv2 */ + free(ntlmv2resp); /* Free the dynamic buffer allocated for NTLMv2 */ Curl_auth_cleanup_ntlm(ntlm);