From 70329828961a7de194c4c258bd5825afb1075888 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 20 Dec 2025 14:32:49 +0100 Subject: [PATCH] tidy-up: miscellaneous - asyn-thrdd.c: scope an include. - apply more clang-format suggestions. - tidy-up PP guard comments. - delete empty line from the top of headers. - add empty line after `curl_setup.h` include where missing. - fix indent. - CODE_STYLE.md: add `strcpy`. Follow-up to 8636ad55dfbdbcc2809a61e65c3511baf5e7b0e8 #20088 - lib1901.c: drop unnecessary line. Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076 Closes #20070 --- docs/internals/CLIENT-WRITERS.md | 14 +- docs/internals/CODE_STYLE.md | 1 + docs/libcurl/curl_formget.md | 2 +- docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md | 8 +- docs/libcurl/opts/CURLOPT_HSTS_CTRL.md | 4 +- docs/libcurl/symbols.pl | 2 +- include/curl/curl.h | 178 +++++++++++------------ include/curl/curlver.h | 4 +- include/curl/header.h | 10 +- include/curl/multi.h | 4 +- include/curl/options.h | 2 +- include/curl/urlapi.h | 44 +++--- include/curl/websockets.h | 18 +-- lib/amigaos.c | 1 - lib/asyn-ares.c | 3 +- lib/asyn-base.c | 6 +- lib/asyn-thrdd.c | 4 +- lib/asyn.h | 1 - lib/bufq.c | 2 +- lib/bufref.c | 2 +- lib/cf-h1-proxy.c | 3 +- lib/cf-h1-proxy.h | 1 - lib/cf-h2-proxy.c | 1 - lib/cf-h2-proxy.h | 1 - lib/cf-haproxy.c | 1 - lib/cf-haproxy.h | 1 - lib/cf-https-connect.c | 1 - lib/cf-ip-happy.c | 1 - lib/cf-socket.c | 1 - lib/cfilters.c | 1 - lib/cfilters.h | 1 - lib/conncache.c | 1 - lib/conncache.h | 1 - lib/connect.c | 1 - lib/content_encoding.c | 1 - lib/cookie.c | 1 - lib/cshutdn.c | 1 - lib/cshutdn.h | 1 - lib/curl_addrinfo.c | 1 - lib/curl_addrinfo.h | 1 - lib/curl_endian.c | 1 - lib/curl_fnmatch.c | 10 +- lib/curl_fnmatch.h | 1 - lib/curl_fopen.c | 3 +- lib/curl_fopen.h | 1 - lib/curl_get_line.c | 1 - lib/curl_get_line.h | 1 - lib/curl_gethostname.c | 2 +- lib/curl_gssapi.c | 1 - lib/curl_gssapi.h | 1 - lib/curl_md4.h | 1 - lib/curl_memrchr.c | 1 - lib/curl_memrchr.h | 1 - lib/curl_ntlm_core.c | 1 - lib/curl_ntlm_core.h | 1 - lib/curl_range.c | 1 - lib/curl_range.h | 1 - lib/curl_rtmp.c | 3 +- lib/curl_sasl.c | 1 - lib/curl_sasl.h | 1 - lib/curl_sha256.h | 1 - lib/curl_sha512_256.c | 70 +++++---- lib/curl_sha512_256.h | 1 - lib/curl_share.c | 9 +- lib/curl_share.h | 1 - lib/curl_sspi.c | 1 - lib/curl_sspi.h | 1 - lib/curl_threads.c | 1 - lib/curl_trc.c | 5 +- lib/curl_trc.h | 125 +++++++++------- lib/curlx/dynbuf.c | 2 +- lib/curlx/fopen.c | 1 - lib/curlx/fopen.h | 1 - lib/curlx/inet_ntop.c | 1 - lib/curlx/inet_ntop.h | 1 - lib/curlx/inet_pton.c | 1 - lib/curlx/inet_pton.h | 1 - lib/curlx/multibyte.c | 1 - lib/curlx/nonblock.c | 1 - lib/curlx/strcopy.c | 1 + lib/curlx/strerr.c | 1 - lib/curlx/strparse.c | 1 - lib/curlx/timediff.c | 1 - lib/curlx/timediff.h | 1 - lib/curlx/timeval.c | 1 - lib/curlx/timeval.h | 1 - lib/curlx/version_win32.c | 1 - lib/curlx/version_win32.h | 1 - lib/curlx/wait.c | 1 - lib/curlx/wait.h | 1 - lib/curlx/warnless.c | 1 + lib/curlx/warnless.h | 2 - lib/cw-out.c | 1 - lib/cw-out.h | 1 - lib/cw-pause.c | 1 - lib/cw-pause.h | 1 - lib/dict.c | 1 - lib/dict.h | 1 - lib/dllmain.c | 5 +- lib/doh.c | 1 - lib/doh.h | 4 +- lib/dynhds.c | 10 +- lib/easy.c | 1 - lib/easy_lock.h | 1 - lib/easygetopt.c | 1 - lib/easyif.h | 1 - lib/easyoptions.h | 4 +- lib/escape.c | 4 +- lib/fake_addrinfo.c | 1 - lib/fake_addrinfo.h | 1 - lib/file.c | 1 - lib/file.h | 1 - lib/fileinfo.c | 3 +- lib/fileinfo.h | 1 - lib/formdata.c | 1 - lib/formdata.h | 1 - lib/ftp.c | 1 - lib/ftp.h | 1 - lib/ftplistparser.c | 9 +- lib/ftplistparser.h | 6 +- lib/functypes.h | 1 - lib/getenv.c | 1 - lib/getinfo.c | 1 - lib/gopher.c | 1 - lib/gopher.h | 1 - lib/hash.c | 2 - lib/hash.h | 1 - lib/headers.c | 1 - lib/hmac.c | 1 - lib/hostip.c | 1 - lib/hostip.h | 1 - lib/hostip4.c | 1 - lib/hostip6.c | 1 - lib/http.c | 1 - lib/http1.c | 1 - lib/http1.h | 1 - lib/http2.c | 1 - lib/http2.h | 1 - lib/http_aws_sigv4.c | 1 - lib/http_chunks.c | 1 - lib/http_digest.c | 1 - lib/http_digest.h | 1 - lib/http_negotiate.c | 1 - lib/http_negotiate.h | 1 - lib/http_ntlm.c | 1 - lib/http_ntlm.h | 1 - lib/http_proxy.c | 3 +- lib/http_proxy.h | 1 - lib/httpsrr.c | 1 - lib/httpsrr.h | 1 - lib/idn.c | 4 +- lib/idn.h | 4 +- lib/if2ip.c | 1 - lib/imap.c | 1 - lib/imap.h | 1 - lib/ldap.c | 1 - lib/llist.c | 1 - lib/llist.h | 1 - lib/macos.c | 1 - lib/macos.h | 5 - lib/md4.c | 1 - lib/md5.c | 1 - lib/memdebug.c | 1 - lib/mime.c | 1 - lib/mime.h | 1 - lib/mprintf.c | 3 +- lib/mqtt.c | 1 - lib/mqtt.h | 1 - lib/multi.c | 1 - lib/multi_ev.c | 1 - lib/multi_ev.h | 1 - lib/multi_ntfy.c | 1 - lib/multi_ntfy.h | 1 - lib/multihandle.h | 1 - lib/multiif.h | 1 - lib/netrc.c | 1 - lib/netrc.h | 2 +- lib/noproxy.c | 1 - lib/openldap.c | 1 - lib/parsedate.c | 10 +- lib/parsedate.h | 1 - lib/pingpong.c | 1 - lib/pingpong.h | 1 - lib/pop3.c | 1 - lib/pop3.h | 1 - lib/progress.c | 1 - lib/progress.h | 1 - lib/psl.c | 1 - lib/psl.h | 2 +- lib/rand.c | 1 - lib/rand.h | 1 - lib/ratelimit.c | 1 - lib/ratelimit.h | 1 - lib/request.c | 1 - lib/request.h | 2 - lib/rtsp.c | 1 - lib/rtsp.h | 8 +- lib/select.c | 5 +- lib/select.h | 1 - lib/sendf.c | 1 - lib/sendf.h | 1 - lib/setopt.c | 51 ++++--- lib/sha256.c | 1 - lib/slist.c | 1 - lib/smb.c | 7 +- lib/smb.h | 1 - lib/smtp.c | 1 - lib/smtp.h | 1 - lib/sockaddr.h | 1 - lib/socketpair.c | 15 +- lib/socketpair.h | 1 - lib/socks.c | 1 - lib/socks.h | 3 +- lib/socks_gssapi.c | 1 - lib/socks_sspi.c | 1 - lib/splay.c | 1 - lib/strcase.c | 1 - lib/strcase.h | 1 - lib/strdup.c | 1 - lib/strequal.c | 1 - lib/strerror.c | 1 - lib/strerror.h | 1 - lib/system_win32.c | 1 - lib/system_win32.h | 5 +- lib/telnet.c | 1 - lib/tftp.c | 1 - lib/transfer.c | 1 - lib/transfer.h | 1 - lib/uint-bset.c | 3 +- lib/uint-hash.c | 1 - lib/uint-hash.h | 1 - lib/uint-spbset.c | 1 - lib/uint-table.c | 1 - lib/url.c | 1 - lib/urlapi.c | 1 - lib/urldata.h | 60 ++++---- lib/vauth/cleartext.c | 1 - lib/vauth/cram.c | 1 - lib/vauth/digest.c | 9 +- lib/vauth/digest.h | 1 - lib/vauth/digest_sspi.c | 1 - lib/vauth/gsasl.c | 1 - lib/vauth/krb5_gssapi.c | 1 - lib/vauth/krb5_sspi.c | 1 - lib/vauth/ntlm.c | 53 ++++--- lib/vauth/ntlm_sspi.c | 1 - lib/vauth/oauth2.c | 1 - lib/vauth/spnego_gssapi.c | 1 - lib/vauth/spnego_sspi.c | 1 - lib/vauth/vauth.c | 1 - lib/vauth/vauth.h | 1 - lib/version.c | 1 - lib/vquic/curl_ngtcp2.c | 1 - lib/vquic/curl_ngtcp2.h | 1 - lib/vquic/curl_osslq.c | 1 - lib/vquic/curl_osslq.h | 1 - lib/vquic/curl_quiche.c | 1 - lib/vquic/curl_quiche.h | 1 - lib/vquic/vquic-tls.c | 1 - lib/vquic/vquic-tls.h | 1 - lib/vquic/vquic.c | 1 - lib/vquic/vquic.h | 1 - lib/vquic/vquic_int.h | 2 +- lib/vssh/libssh.c | 1 - lib/vssh/libssh2.c | 7 +- lib/vssh/ssh.h | 1 - lib/vssh/vssh.c | 3 +- lib/vssh/vssh.h | 2 +- lib/vtls/apple.h | 1 - lib/vtls/cipher_suite.c | 35 ++--- lib/vtls/cipher_suite.h | 1 - lib/vtls/gtls.c | 2 - lib/vtls/gtls.h | 1 - lib/vtls/hostcheck.c | 3 +- lib/vtls/hostcheck.h | 1 - lib/vtls/keylog.c | 2 +- lib/vtls/mbedtls.c | 2 - lib/vtls/openssl.c | 6 +- lib/vtls/openssl.h | 1 - lib/vtls/rustls.c | 3 +- lib/vtls/rustls.h | 8 +- lib/vtls/schannel.c | 2 - lib/vtls/schannel_verify.c | 2 - lib/vtls/vtls.h | 28 ++-- lib/vtls/vtls_scache.c | 1 - lib/vtls/vtls_scache.h | 1 + lib/vtls/vtls_spack.c | 1 - lib/vtls/wolfssl.c | 4 +- lib/vtls/x509asn1.c | 3 +- lib/vtls/x509asn1.h | 7 +- scripts/managen | 1 + src/curlinfo.c | 4 +- src/slist_wc.c | 1 - src/slist_wc.h | 2 +- src/tool_cfgable.h | 2 +- src/tool_easysrc.h | 1 + src/tool_ipfs.h | 3 +- src/tool_listhelp.c | 1 + src/tool_msgs.h | 1 + src/tool_operate.h | 1 + src/tool_operhlp.c | 2 +- src/tool_progress.c | 1 + src/tool_setup.h | 2 +- src/tool_stderr.c | 2 +- src/tool_stderr.h | 1 + src/tool_writeout.h | 1 + src/tool_writeout_json.h | 1 + src/tool_xattr.c | 1 + src/var.h | 1 - tests/ftpserver.pl | 2 +- tests/libtest/lib1308.c | 2 +- tests/libtest/lib1901.c | 1 - tests/libtest/testutil.h | 2 +- tests/unit/unit1658.c | 2 +- 314 files changed, 486 insertions(+), 730 deletions(-) diff --git a/docs/internals/CLIENT-WRITERS.md b/docs/internals/CLIENT-WRITERS.md index b07a562afb..0e9bc843a7 100644 --- a/docs/internals/CLIENT-WRITERS.md +++ b/docs/internals/CLIENT-WRITERS.md @@ -36,13 +36,13 @@ CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, si The `type` argument specifies what the bytes in `buf` actually are. The following bits are defined: ``` -#define CLIENTWRITE_BODY (1<<0) /* non-meta information, BODY */ -#define CLIENTWRITE_INFO (1<<1) /* meta information, not a HEADER */ -#define CLIENTWRITE_HEADER (1<<2) /* meta information, HEADER */ -#define CLIENTWRITE_STATUS (1<<3) /* a special status HEADER */ -#define CLIENTWRITE_CONNECT (1<<4) /* a CONNECT related HEADER */ -#define CLIENTWRITE_1XX (1<<5) /* a 1xx response related HEADER */ -#define CLIENTWRITE_TRAILER (1<<6) /* a trailer HEADER */ +#define CLIENTWRITE_BODY (1 << 0) /* non-meta information, BODY */ +#define CLIENTWRITE_INFO (1 << 1) /* meta information, not a HEADER */ +#define CLIENTWRITE_HEADER (1 << 2) /* meta information, HEADER */ +#define CLIENTWRITE_STATUS (1 << 3) /* a special status HEADER */ +#define CLIENTWRITE_CONNECT (1 << 4) /* a CONNECT related HEADER */ +#define CLIENTWRITE_1XX (1 << 5) /* a 1xx response related HEADER */ +#define CLIENTWRITE_TRAILER (1 << 6) /* a trailer HEADER */ ``` The main types here are `CLIENTWRITE_BODY` and `CLIENTWRITE_HEADER`. They are diff --git a/docs/internals/CODE_STYLE.md b/docs/internals/CODE_STYLE.md index ee5bdbb562..8be6592df5 100644 --- a/docs/internals/CODE_STYLE.md +++ b/docs/internals/CODE_STYLE.md @@ -393,6 +393,7 @@ This is the full list of functions generally banned. sscanf stat strcat + strcpy strdup strerror strncat diff --git a/docs/libcurl/curl_formget.md b/docs/libcurl/curl_formget.md index 316609e93a..4c4726c315 100644 --- a/docs/libcurl/curl_formget.md +++ b/docs/libcurl/curl_formget.md @@ -54,7 +54,7 @@ This, because first then does libcurl known which actual read callback to use. size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); - (*(size_t *)arg) += len; + *((size_t *)arg) += len; return len; } diff --git a/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md b/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md index 84e5d6657c..cdf9ec44a4 100644 --- a/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md +++ b/docs/libcurl/opts/CURLOPT_ALTSVC_CTRL.md @@ -22,10 +22,10 @@ CURLOPT_ALTSVC_CTRL - control alt-svc behavior ~~~c #include -#define CURLALTSVC_READONLYFILE (1L<<2) -#define CURLALTSVC_H1 (1L<<3) -#define CURLALTSVC_H2 (1L<<4) -#define CURLALTSVC_H3 (1L<<5) +#define CURLALTSVC_READONLYFILE (1L << 2) +#define CURLALTSVC_H1 (1L << 3) +#define CURLALTSVC_H2 (1L << 4) +#define CURLALTSVC_H3 (1L << 5) CURLcode curl_easy_setopt(CURL *handle, CURLOPT_ALTSVC_CTRL, long bitmask); ~~~ diff --git a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md index 9026dddc15..e432fc4edc 100644 --- a/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md +++ b/docs/libcurl/opts/CURLOPT_HSTS_CTRL.md @@ -23,8 +23,8 @@ CURLOPT_HSTS_CTRL - control HSTS behavior ~~~c #include -#define CURLHSTS_ENABLE (1L<<0) -#define CURLHSTS_READONLYFILE (1L<<1) +#define CURLHSTS_ENABLE (1L << 0) +#define CURLHSTS_READONLYFILE (1L << 1) CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTS_CTRL, long bitmask); ~~~ diff --git a/docs/libcurl/symbols.pl b/docs/libcurl/symbols.pl index 1751a4887d..d20554ab93 100755 --- a/docs/libcurl/symbols.pl +++ b/docs/libcurl/symbols.pl @@ -52,7 +52,7 @@ open F, "= CURL_VERSION_BITS(x, y, z)) #endif /* CURLINC_CURLVER_H */ diff --git a/include/curl/header.h b/include/curl/header.h index 7465274b9c..e7334b5a3a 100644 --- a/include/curl/header.h +++ b/include/curl/header.h @@ -38,11 +38,11 @@ struct curl_header { }; /* 'origin' bits */ -#define CURLH_HEADER (1<<0) /* plain server header */ -#define CURLH_TRAILER (1<<1) /* trailers */ -#define CURLH_CONNECT (1<<2) /* CONNECT headers */ -#define CURLH_1XX (1<<3) /* 1xx headers */ -#define CURLH_PSEUDO (1<<4) /* pseudo headers */ +#define CURLH_HEADER (1 << 0) /* plain server header */ +#define CURLH_TRAILER (1 << 1) /* trailers */ +#define CURLH_CONNECT (1 << 2) /* CONNECT headers */ +#define CURLH_1XX (1 << 3) /* 1xx headers */ +#define CURLH_PSEUDO (1 << 4) /* pseudo headers */ typedef enum { CURLHE_OK, diff --git a/include/curl/multi.h b/include/curl/multi.h index f3f66030ca..531c1a954a 100644 --- a/include/curl/multi.h +++ b/include/curl/multi.h @@ -412,12 +412,12 @@ typedef enum { /* - CURLMNWC_CLEAR_CONNS tells libcurl to prevent further reuse of existing connections. Connections that are idle will be closed. Ongoing transfers will continue with the connection they have. */ -#define CURLMNWC_CLEAR_CONNS (1L<<0) +#define CURLMNWC_CLEAR_CONNS (1L << 0) /* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing connections. Connections that are idle will be closed. Ongoing transfers will continue with the connection they have. */ -#define CURLMNWC_CLEAR_DNS (1L<<0) +#define CURLMNWC_CLEAR_DNS (1L << 0) /* * Name: curl_multi_setopt() diff --git a/include/curl/options.h b/include/curl/options.h index 77cab7768f..835a722e91 100644 --- a/include/curl/options.h +++ b/include/curl/options.h @@ -44,7 +44,7 @@ typedef enum { /* "alias" means it is provided for old programs to remain functional, we prefer another name */ -#define CURLOT_FLAG_ALIAS (1<<0) +#define CURLOT_FLAG_ALIAS (1 << 0) /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size to use for curl_easy_setopt() for the given id */ diff --git a/include/curl/urlapi.h b/include/curl/urlapi.h index 34c11a6bb7..dabe44a47d 100644 --- a/include/curl/urlapi.h +++ b/include/curl/urlapi.h @@ -81,28 +81,28 @@ typedef enum { CURLUPART_ZONEID /* added in 7.65.0 */ } CURLUPart; -#define CURLU_DEFAULT_PORT (1<<0) /* return default port number */ -#define CURLU_NO_DEFAULT_PORT (1<<1) /* act as if no port number was set, - if the port number matches the - default for the scheme */ -#define CURLU_DEFAULT_SCHEME (1<<2) /* return default scheme if - missing */ -#define CURLU_NON_SUPPORT_SCHEME (1<<3) /* allow non-supported scheme */ -#define CURLU_PATH_AS_IS (1<<4) /* leave dot sequences */ -#define CURLU_DISALLOW_USER (1<<5) /* no user+password allowed */ -#define CURLU_URLDECODE (1<<6) /* URL decode on get */ -#define CURLU_URLENCODE (1<<7) /* URL encode on set */ -#define CURLU_APPENDQUERY (1<<8) /* append a form style part */ -#define CURLU_GUESS_SCHEME (1<<9) /* legacy curl-style guessing */ -#define CURLU_NO_AUTHORITY (1<<10) /* Allow empty authority when the - scheme is unknown. */ -#define CURLU_ALLOW_SPACE (1<<11) /* Allow spaces in the URL */ -#define CURLU_PUNYCODE (1<<12) /* get the hostname in punycode */ -#define CURLU_PUNY2IDN (1<<13) /* punycode => IDN conversion */ -#define CURLU_GET_EMPTY (1<<14) /* allow empty queries and fragments - when extracting the URL or the - components */ -#define CURLU_NO_GUESS_SCHEME (1<<15) /* for get, do not accept a guess */ +#define CURLU_DEFAULT_PORT (1 << 0) /* return default port number */ +#define CURLU_NO_DEFAULT_PORT (1 << 1) /* act as if no port number was set, + if the port number matches the + default for the scheme */ +#define CURLU_DEFAULT_SCHEME (1 << 2) /* return default scheme if + missing */ +#define CURLU_NON_SUPPORT_SCHEME (1 << 3) /* allow non-supported scheme */ +#define CURLU_PATH_AS_IS (1 << 4) /* leave dot sequences */ +#define CURLU_DISALLOW_USER (1 << 5) /* no user+password allowed */ +#define CURLU_URLDECODE (1 << 6) /* URL decode on get */ +#define CURLU_URLENCODE (1 << 7) /* URL encode on set */ +#define CURLU_APPENDQUERY (1 << 8) /* append a form style part */ +#define CURLU_GUESS_SCHEME (1 << 9) /* legacy curl-style guessing */ +#define CURLU_NO_AUTHORITY (1 << 10) /* Allow empty authority when the + scheme is unknown. */ +#define CURLU_ALLOW_SPACE (1 << 11) /* Allow spaces in the URL */ +#define CURLU_PUNYCODE (1 << 12) /* get the hostname in punycode */ +#define CURLU_PUNY2IDN (1 << 13) /* punycode => IDN conversion */ +#define CURLU_GET_EMPTY (1 << 14) /* allow empty queries and fragments + when extracting the URL or the + components */ +#define CURLU_NO_GUESS_SCHEME (1 << 15) /* for get, do not accept a guess */ typedef struct Curl_URL CURLU; diff --git a/include/curl/websockets.h b/include/curl/websockets.h index df8590f399..402a2ca0f5 100644 --- a/include/curl/websockets.h +++ b/include/curl/websockets.h @@ -37,12 +37,12 @@ struct curl_ws_frame { }; /* flag bits */ -#define CURLWS_TEXT (1<<0) -#define CURLWS_BINARY (1<<1) -#define CURLWS_CONT (1<<2) -#define CURLWS_CLOSE (1<<3) -#define CURLWS_PING (1<<4) -#define CURLWS_OFFSET (1<<5) +#define CURLWS_TEXT (1 << 0) +#define CURLWS_BINARY (1 << 1) +#define CURLWS_CONT (1 << 2) +#define CURLWS_CLOSE (1 << 3) +#define CURLWS_PING (1 << 4) +#define CURLWS_OFFSET (1 << 5) /* * NAME curl_ws_recv() @@ -57,7 +57,7 @@ CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen, const struct curl_ws_frame **metap); /* flags for curl_ws_send() */ -#define CURLWS_PONG (1<<6) +#define CURLWS_PONG (1 << 6) /* * NAME curl_ws_send() @@ -86,8 +86,8 @@ CURL_EXTERN CURLcode curl_ws_start_frame(CURL *curl, curl_off_t frame_len); /* bits for the CURLOPT_WS_OPTIONS bitmask: */ -#define CURLWS_RAW_MODE (1L<<0) -#define CURLWS_NOAUTOPONG (1L<<1) +#define CURLWS_RAW_MODE (1L << 0) +#define CURLWS_NOAUTOPONG (1L << 1) CURL_EXTERN const struct curl_ws_frame *curl_ws_meta(CURL *curl); diff --git a/lib/amigaos.c b/lib/amigaos.c index 76d67b08fe..7ce5045851 100644 --- a/lib/amigaos.c +++ b/lib/amigaos.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef __AMIGA__ diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index d723de9873..7544140d43 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef CURLRES_ARES @@ -872,7 +871,7 @@ static CURLcode async_ares_set_dns_servers(struct Curl_easy *data, result = CURLE_BAD_FUNCTION_ARGUMENT; break; } -#else /* too old c-ares version! */ +#else /* c-ares version too old! */ (void)data; (void)(ares_result); #endif diff --git a/lib/asyn-base.c b/lib/asyn-base.c index 398e41dffd..02797f1afb 100644 --- a/lib/asyn-base.c +++ b/lib/asyn-base.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H @@ -40,8 +39,7 @@ #ifdef USE_ARES #include -#include /* really old c-ares did not include this by - itself */ +#include /* really old c-ares did not include it by itself */ #endif #include "urldata.h" @@ -173,7 +171,7 @@ int Curl_ares_perform(ares_channel channel, timediff_t timeout_ms) return nfds; } -#endif +#endif /* USE_ARES */ #endif /* CURLRES_ASYNCH */ diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 64251ae57e..690e8139bd 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -21,15 +21,15 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" -#include "socketpair.h" /*********************************************************************** * Only for threaded name resolves builds **********************************************************************/ #ifdef CURLRES_THREADED +#include "socketpair.h" + #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/lib/asyn.h b/lib/asyn.h index 87c6532a3d..b9610810c7 100644 --- a/lib/asyn.h +++ b/lib/asyn.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_easy; diff --git a/lib/bufq.c b/lib/bufq.c index 6eeeeb35d4..750d86888f 100644 --- a/lib/bufq.c +++ b/lib/bufq.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" + #include "bufq.h" static bool chunk_is_empty(const struct buf_chunk *chunk) diff --git a/lib/bufref.c b/lib/bufref.c index e5b5a4d985..b1272d589d 100644 --- a/lib/bufref.c +++ b/lib/bufref.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" + #include "urldata.h" #include "bufref.h" #include "strdup.h" diff --git a/lib/cf-h1-proxy.c b/lib/cf-h1-proxy.c index 5c764bb59f..c41a68dee1 100644 --- a/lib/cf-h1-proxy.c +++ b/lib/cf-h1-proxy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) @@ -788,4 +787,4 @@ CURLcode Curl_cf_h1_proxy_insert_after(struct Curl_cfilter *cf_at, return result; } -#endif /* !CURL_DISABLE_PROXY && ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_PROXY && !CURL_DISABLE_HTTP */ diff --git a/lib/cf-h1-proxy.h b/lib/cf-h1-proxy.h index ded55db9df..e48d827825 100644 --- a/lib/cf-h1-proxy.h +++ b/lib/cf-h1-proxy.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) diff --git a/lib/cf-h2-proxy.c b/lib/cf-h2-proxy.c index d35d8b4d45..d225d69989 100644 --- a/lib/cf-h2-proxy.c +++ b/lib/cf-h2-proxy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_PROXY) && \ diff --git a/lib/cf-h2-proxy.h b/lib/cf-h2-proxy.h index 1b3f85aaaf..318ce1973f 100644 --- a/lib/cf-h2-proxy.h +++ b/lib/cf-h2-proxy.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if defined(USE_NGHTTP2) && !defined(CURL_DISABLE_PROXY) diff --git a/lib/cf-haproxy.c b/lib/cf-haproxy.c index ea35f040a3..6c9bfdd137 100644 --- a/lib/cf-haproxy.c +++ b/lib/cf-haproxy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_PROXY diff --git a/lib/cf-haproxy.h b/lib/cf-haproxy.h index da9920fd89..6d67597cd7 100644 --- a/lib/cf-haproxy.h +++ b/lib/cf-haproxy.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cf-https-connect.c b/lib/cf-https-connect.c index 4882f28c4b..d2a08d124f 100644 --- a/lib/cf-https-connect.c +++ b/lib/cf-https-connect.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/cf-ip-happy.c b/lib/cf-ip-happy.c index 36d53ed9c2..a24abbe190 100644 --- a/lib/cf-ip-happy.c +++ b/lib/cf-ip-happy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/cf-socket.c b/lib/cf-socket.c index ab28bc40aa..c0f01c1a00 100644 --- a/lib/cf-socket.c +++ b/lib/cf-socket.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/cfilters.c b/lib/cfilters.c index 5f3e511117..b91d30c204 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cfilters.h b/lib/cfilters.h index 6834c4133a..9faf01de75 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/timediff.h" struct bufq; diff --git a/lib/conncache.c b/lib/conncache.c index 7fccde05e1..1a3dba7f63 100644 --- a/lib/conncache.c +++ b/lib/conncache.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/conncache.h b/lib/conncache.h index fabb967bd0..9b392af05c 100644 --- a/lib/conncache.h +++ b/lib/conncache.h @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/timeval.h" struct connectdata; diff --git a/lib/connect.c b/lib/connect.c index bb51701d0c..6e178345f4 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 7a9eb354e4..70fb5692cf 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cookie.c b/lib/cookie.c index de382f3b00..c8072228b9 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) diff --git a/lib/cshutdn.c b/lib/cshutdn.c index c7f2d6610a..84e5b2a116 100644 --- a/lib/cshutdn.c +++ b/lib/cshutdn.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cshutdn.h b/lib/cshutdn.h index 793b4c6c2c..ad2d009673 100644 --- a/lib/cshutdn.h +++ b/lib/cshutdn.h @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/timeval.h" struct connectdata; diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 43dcfd25c7..61c8b18819 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/curl_addrinfo.h b/lib/curl_addrinfo.h index 378b31ed05..ca80f3a45d 100644 --- a/lib/curl_addrinfo.h +++ b/lib/curl_addrinfo.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/curl_endian.c b/lib/curl_endian.c index d982e31269..864b411b68 100644 --- a/lib/curl_endian.c +++ b/lib/curl_endian.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curl_endian.h" diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c index d61e7d43bc..8e35edeed6 100644 --- a/lib/curl_fnmatch.c +++ b/lib/curl_fnmatch.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" + #ifndef CURL_DISABLE_FTP #include "curl_fnmatch.h" @@ -356,7 +356,8 @@ int Curl_fnmatch(void *ptr, const char *pattern, const char *string) return loop((const unsigned char *)pattern, (const unsigned char *)string, 2); } -#else +#else /* HAVE_FNMATCH */ + #include /* * @unittest: 1307 @@ -379,7 +380,6 @@ int Curl_fnmatch(void *ptr, const char *pattern, const char *string) } /* not reached */ } +#endif /* !HAVE_FNMATCH */ -#endif - -#endif /* if FTP is disabled */ +#endif /* !CURL_DISABLE_FTP */ diff --git a/lib/curl_fnmatch.h b/lib/curl_fnmatch.h index b8c2a4353c..61d2a0c4e9 100644 --- a/lib/curl_fnmatch.h +++ b/lib/curl_fnmatch.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #define CURL_FNMATCH_MATCH 0 #define CURL_FNMATCH_NOMATCH 1 #define CURL_FNMATCH_FAIL 2 diff --git a/lib/curl_fopen.c b/lib/curl_fopen.c index 383b307e21..9559c0d0c4 100644 --- a/lib/curl_fopen.c +++ b/lib/curl_fopen.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \ @@ -156,4 +155,4 @@ fail: return result; } -#endif /* ! disabled */ +#endif /* !disabled */ diff --git a/lib/curl_fopen.h b/lib/curl_fopen.h index a3dc1382bc..bd402d4489 100644 --- a/lib/curl_fopen.h +++ b/lib/curl_fopen.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/fopen.h" CURLcode Curl_fopen(struct Curl_easy *data, const char *filename, diff --git a/lib/curl_get_line.c b/lib/curl_get_line.c index 5e553f4d31..46c1287924 100644 --- a/lib/curl_get_line.c +++ b/lib/curl_get_line.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_COOKIES) || !defined(CURL_DISABLE_ALTSVC) || \ diff --git a/lib/curl_get_line.h b/lib/curl_get_line.h index 176d5f7a30..6b90ac4727 100644 --- a/lib/curl_get_line.h +++ b/lib/curl_get_line.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/dynbuf.h" /* Curl_get_line() returns complete lines that end with a newline. */ diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index 4d772cb491..f154c837f6 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" + #include "curl_gethostname.h" #include "curlx/strcopy.h" diff --git a/lib/curl_gssapi.c b/lib/curl_gssapi.c index 2145b42686..8c82f778cd 100644 --- a/lib/curl_gssapi.c +++ b/lib/curl_gssapi.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_GSSAPI diff --git a/lib/curl_gssapi.h b/lib/curl_gssapi.h index d4fbf5c240..8c09c72c9b 100644 --- a/lib/curl_gssapi.h +++ b/lib/curl_gssapi.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/curl_md4.h b/lib/curl_md4.h index 9d4a12ed3d..05d1624974 100644 --- a/lib/curl_md4.h +++ b/lib/curl_md4.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_CURL_NTLM_CORE diff --git a/lib/curl_memrchr.c b/lib/curl_memrchr.c index 27f5fc01ba..59ee176bc9 100644 --- a/lib/curl_memrchr.c +++ b/lib/curl_memrchr.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curl_memrchr.h" diff --git a/lib/curl_memrchr.h b/lib/curl_memrchr.h index 2ee65f3c0b..248368b25c 100644 --- a/lib/curl_memrchr.h +++ b/lib/curl_memrchr.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_MEMRCHR diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c index b34d42f6bf..2f4f7c3abd 100644 --- a/lib/curl_ntlm_core.c +++ b/lib/curl_ntlm_core.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_CURL_NTLM_CORE diff --git a/lib/curl_ntlm_core.h b/lib/curl_ntlm_core.h index 0d2aa21862..947b836966 100644 --- a/lib/curl_ntlm_core.h +++ b/lib/curl_ntlm_core.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_CURL_NTLM_CORE diff --git a/lib/curl_range.c b/lib/curl_range.c index c4118b07d9..14218f1eee 100644 --- a/lib/curl_range.c +++ b/lib/curl_range.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curl_range.h" diff --git a/lib/curl_range.h b/lib/curl_range.h index 842ada9ab1..97354677c2 100644 --- a/lib/curl_range.h +++ b/lib/curl_range.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/curl_rtmp.c b/lib/curl_rtmp.c index 36f81464a4..98816f8269 100644 --- a/lib/curl_rtmp.c +++ b/lib/curl_rtmp.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_LIBRTMP @@ -384,4 +383,4 @@ void Curl_rtmp_version(char *version, size_t len) suff); } -#endif /* USE_LIBRTMP */ +#endif /* USE_LIBRTMP */ diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index f71c909a68..123c1c14fb 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -32,7 +32,6 @@ * Draft LOGIN SASL Mechanism * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ diff --git a/lib/curl_sasl.h b/lib/curl_sasl.h index 0632e09ebd..8432d261ec 100644 --- a/lib/curl_sasl.h +++ b/lib/curl_sasl.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "bufref.h" struct Curl_easy; diff --git a/lib/curl_sha256.h b/lib/curl_sha256.h index 99a87b290b..0aaa4126f4 100644 --- a/lib/curl_sha256.h +++ b/lib/curl_sha256.h @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \ diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index aff0ce0a47..a6c78d67cf 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256) @@ -75,7 +74,7 @@ # ifdef SHA512_256_DIGEST_SIZE # define USE_GNUTLS_SHA512_256 1 # endif -#endif /* ! HAS_SHA512_256_IMPLEMENTATION && USE_GNUTLS */ +#endif /* !HAS_SHA512_256_IMPLEMENTATION && USE_GNUTLS */ #ifdef USE_OPENSSL_SHA512_256 @@ -169,9 +168,9 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) if(ret == CURLE_OK) memcpy(digest, tmp_digest, CURL_SHA512_256_DIGEST_SIZE); explicit_memset(tmp_digest, 0, sizeof(tmp_digest)); -#else /* ! NEED_NETBSD_SHA512_256_WORKAROUND */ +#else /* !NEED_NETBSD_SHA512_256_WORKAROUND */ ret = EVP_DigestFinal_ex(*ctx, digest, NULL) ? CURLE_OK : CURLE_SSL_CIPHER; -#endif /* ! NEED_NETBSD_SHA512_256_WORKAROUND */ +#endif /* NEED_NETBSD_SHA512_256_WORKAROUND */ EVP_MD_CTX_destroy(*ctx); *ctx = NULL; @@ -288,15 +287,16 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) ((uint64_t)(((const uint8_t *)(ptr))[6]) << 8) | \ (uint64_t)(((const uint8_t *)(ptr))[7])) -#define CURL_PUT_64BIT_BE(ptr,val) do { \ - ((uint8_t*)(ptr))[7] = (uint8_t) ((uint64_t)(val)); \ - ((uint8_t*)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \ - ((uint8_t*)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \ - ((uint8_t*)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \ - ((uint8_t*)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \ - ((uint8_t*)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \ - ((uint8_t*)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \ - ((uint8_t*)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \ +#define CURL_PUT_64BIT_BE(ptr, val) \ + do { \ + ((uint8_t *)(ptr))[7] = (uint8_t)((uint64_t)(val)); \ + ((uint8_t *)(ptr))[6] = (uint8_t)(((uint64_t)(val)) >> 8); \ + ((uint8_t *)(ptr))[5] = (uint8_t)(((uint64_t)(val)) >> 16); \ + ((uint8_t *)(ptr))[4] = (uint8_t)(((uint64_t)(val)) >> 24); \ + ((uint8_t *)(ptr))[3] = (uint8_t)(((uint64_t)(val)) >> 32); \ + ((uint8_t *)(ptr))[2] = (uint8_t)(((uint64_t)(val)) >> 40); \ + ((uint8_t *)(ptr))[1] = (uint8_t)(((uint64_t)(val)) >> 48); \ + ((uint8_t *)(ptr))[0] = (uint8_t)(((uint64_t)(val)) >> 56); \ } while(0) /* Defined as a function. The macro version may duplicate the binary code @@ -459,9 +459,9 @@ static void Curl_sha512_256_transform(uint64_t H[SHA512_256_HASH_SIZE_WORDS], (Curl_rotr64((x), 28) ^ Curl_rotr64((x), 34) ^ Curl_rotr64((x), 39)) #define SIG1(x) \ (Curl_rotr64((x), 14) ^ Curl_rotr64((x), 18) ^ Curl_rotr64((x), 41)) -#define sig0(x) \ - (Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7)) -#define sig1(x) \ +#define sig0(x) \ + (Curl_rotr64((x), 1) ^ Curl_rotr64((x), 8) ^ ((x) >> 7)) +#define sig1(x) \ (Curl_rotr64((x), 19) ^ Curl_rotr64((x), 61) ^ ((x) >> 6)) if(1) { @@ -601,7 +601,7 @@ static CURLcode Curl_sha512_256_update(void *context, const unsigned char *data, size_t length) { - unsigned int bytes_have; /**< Number of bytes in the context buffer */ + unsigned int bytes_have; /* Number of bytes in the context buffer */ struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context; /* the void pointer here is required to mute Intel compiler warning */ void * const ctx_buf = ctx->buffer; @@ -625,7 +625,7 @@ static CURLcode Curl_sha512_256_update(void *context, if(length >= bytes_left) { /* Combine new data with data in the buffer and process the full block. */ - memcpy(((unsigned char *)ctx_buf) + bytes_have, data, bytes_left); + memcpy((unsigned char *)ctx_buf + bytes_have, data, bytes_left); data += bytes_left; length -= bytes_left; Curl_sha512_256_transform(ctx->H, ctx->buffer); @@ -644,7 +644,7 @@ static CURLcode Curl_sha512_256_update(void *context, if(length) { /* Copy incomplete block of new data (if any) to the buffer. */ - memcpy(((unsigned char *)ctx_buf) + bytes_have, data, length); + memcpy((unsigned char *)ctx_buf + bytes_have, data, length); } return CURLE_OK; @@ -672,8 +672,8 @@ static CURLcode Curl_sha512_256_update(void *context, static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { struct Curl_sha512_256ctx * const ctx = (struct Curl_sha512_256ctx *)context; - uint64_t num_bits; /**< Number of processed bits */ - unsigned int bytes_have; /**< Number of bytes in the context buffer */ + uint64_t num_bits; /* Number of processed bits */ + unsigned int bytes_have; /* Number of bytes in the context buffer */ /* the void pointer here is required to mute Intel compiler warning */ void * const ctx_buf = ctx->buffer; @@ -702,7 +702,7 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) /* No space in the current block to put the total length of message. Pad the current block with zeros and process it. */ if(bytes_have < CURL_SHA512_256_BLOCK_SIZE) - memset(((unsigned char *)ctx_buf) + bytes_have, 0, + memset((unsigned char *)ctx_buf + bytes_have, 0, CURL_SHA512_256_BLOCK_SIZE - bytes_have); /* Process the full block. */ Curl_sha512_256_transform(ctx->H, ctx->buffer); @@ -711,31 +711,29 @@ static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) } /* Pad the rest of the buffer with zeros. */ - memset(((unsigned char *)ctx_buf) + bytes_have, 0, + memset((unsigned char *)ctx_buf + bytes_have, 0, CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD - bytes_have); /* Put high part of number of bits in processed message and then lower part of number of bits as big-endian values. See FIPS PUB 180-4 section 5.1.2. */ /* Note: the target location is predefined and buffer is always aligned */ - CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \ - + CURL_SHA512_256_BLOCK_SIZE \ - - SHA512_256_SIZE_OF_LEN_ADD, \ - ctx->count_bits_hi); - CURL_PUT_64BIT_BE(((unsigned char *)ctx_buf) \ - + CURL_SHA512_256_BLOCK_SIZE \ - - SHA512_256_SIZE_OF_LEN_ADD \ - + SHA512_256_BYTES_IN_WORD, \ - num_bits); + CURL_PUT_64BIT_BE((unsigned char *)ctx_buf + + CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD, + ctx->count_bits_hi); + CURL_PUT_64BIT_BE((unsigned char *)ctx_buf + + CURL_SHA512_256_BLOCK_SIZE - SHA512_256_SIZE_OF_LEN_ADD + + SHA512_256_BYTES_IN_WORD, + num_bits); /* Process the full final block. */ Curl_sha512_256_transform(ctx->H, ctx->buffer); /* Put in BE mode the leftmost part of the hash as the final digest. See FIPS PUB 180-4 section 6.7. */ - CURL_PUT_64BIT_BE((digest + 0 * SHA512_256_BYTES_IN_WORD), ctx->H[0]); - CURL_PUT_64BIT_BE((digest + 1 * SHA512_256_BYTES_IN_WORD), ctx->H[1]); - CURL_PUT_64BIT_BE((digest + 2 * SHA512_256_BYTES_IN_WORD), ctx->H[2]); - CURL_PUT_64BIT_BE((digest + 3 * SHA512_256_BYTES_IN_WORD), ctx->H[3]); + CURL_PUT_64BIT_BE(digest + 0 * SHA512_256_BYTES_IN_WORD, ctx->H[0]); + CURL_PUT_64BIT_BE(digest + 1 * SHA512_256_BYTES_IN_WORD, ctx->H[1]); + CURL_PUT_64BIT_BE(digest + 2 * SHA512_256_BYTES_IN_WORD, ctx->H[2]); + CURL_PUT_64BIT_BE(digest + 3 * SHA512_256_BYTES_IN_WORD, ctx->H[3]); /* Erase potentially sensitive data. */ memset(ctx, 0, sizeof(struct Curl_sha512_256ctx)); diff --git a/lib/curl_sha512_256.h b/lib/curl_sha512_256.h index 0efcb27f3b..ddaf8be91d 100644 --- a/lib/curl_sha512_256.h +++ b/lib/curl_sha512_256.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_DIGEST_AUTH) && !defined(CURL_DISABLE_SHA512_256) diff --git a/lib/curl_share.c b/lib/curl_share.c index 60ea78bf7f..3ff2755684 100644 --- a/lib/curl_share.c +++ b/lib/curl_share.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" @@ -93,7 +92,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) if(!share->cookies) res = CURLSHE_NOMEM; } -#else /* CURL_DISABLE_HTTP */ +#else /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */ res = CURLSHE_NOT_BUILT_IN; #endif break; @@ -105,7 +104,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) if(!share->hsts) res = CURLSHE_NOMEM; } -#else /* CURL_DISABLE_HSTS */ +#else /* CURL_DISABLE_HSTS */ res = CURLSHE_NOT_BUILT_IN; #endif break; @@ -160,7 +159,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) Curl_cookie_cleanup(share->cookies); share->cookies = NULL; } -#else /* CURL_DISABLE_HTTP */ +#else /* CURL_DISABLE_HTTP || CURL_DISABLE_COOKIES */ res = CURLSHE_NOT_BUILT_IN; #endif break; @@ -170,7 +169,7 @@ CURLSHcode curl_share_setopt(CURLSH *sh, CURLSHoption option, ...) if(share->hsts) { Curl_hsts_cleanup(&share->hsts); } -#else /* CURL_DISABLE_HSTS */ +#else /* CURL_DISABLE_HSTS */ res = CURLSHE_NOT_BUILT_IN; #endif break; diff --git a/lib/curl_share.h b/lib/curl_share.h index 25d67ce1d9..fcd9e32980 100644 --- a/lib/curl_share.h +++ b/lib/curl_share.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "cookie.h" diff --git a/lib/curl_sspi.c b/lib/curl_sspi.c index 93a68e56c5..6e27269005 100644 --- a/lib/curl_sspi.c +++ b/lib/curl_sspi.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index 46dc6faaa2..0fba510357 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/curl_threads.c b/lib/curl_threads.c index 36a64eb8e3..f5fea98046 100644 --- a/lib/curl_threads.c +++ b/lib/curl_threads.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H) diff --git a/lib/curl_trc.c b/lib/curl_trc.c index fd80a76ee5..565d1b45f0 100644 --- a/lib/curl_trc.c +++ b/lib/curl_trc.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curl_trc.h" @@ -86,8 +85,8 @@ static struct curl_trc_feat Curl_trc_feat_ids = { CURL_LOG_LVL_NONE, }; #define CURL_TRC_IDS(data) \ - (Curl_trc_is_verbose(data) && \ - Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO) + (Curl_trc_is_verbose(data) && \ + Curl_trc_feat_ids.log_level >= CURL_LOG_LVL_INFO) static size_t trc_print_ids(struct Curl_easy *data, char *buf, size_t maxlen) { diff --git a/lib/curl_trc.h b/lib/curl_trc.h index 6d6a22ef99..ff085d6a4e 100644 --- a/lib/curl_trc.h +++ b/lib/curl_trc.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - struct Curl_easy; struct Curl_cfilter; @@ -119,7 +118,7 @@ void Curl_trc_ssls(struct Curl_easy *data, #ifdef USE_SSH extern struct curl_trc_feat Curl_trc_feat_ssh; void Curl_trc_ssh(struct Curl_easy *data, - const char *fmt, ...) CURL_PRINTF(2, 3); + const char *fmt, ...) CURL_PRINTF(2, 3); #endif #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) extern struct curl_trc_feat Curl_trc_feat_ws; @@ -135,52 +134,76 @@ void Curl_trc_ws(struct Curl_easy *data, Curl_trc_ft_is_verbose(data, &Curl_trc_feat_timer) #if defined(CURL_HAVE_C99) && !defined(CURL_DISABLE_VERBOSE_STRINGS) -#define infof(data, ...) \ - do { if(Curl_trc_is_verbose(data)) \ - Curl_infof(data, __VA_ARGS__); } while(0) -#define CURL_TRC_M(data, ...) \ - do { if(CURL_TRC_M_is_verbose(data)) \ - Curl_trc_multi(data, __VA_ARGS__); } while(0) -#define CURL_TRC_CF(data, cf, ...) \ - do { if(Curl_trc_cf_is_verbose(cf, data)) \ - Curl_trc_cf_infof(data, cf, __VA_ARGS__); } while(0) -#define CURL_TRC_WRITE(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \ - Curl_trc_write(data, __VA_ARGS__); } while(0) -#define CURL_TRC_READ(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \ - Curl_trc_read(data, __VA_ARGS__); } while(0) -#define CURL_TRC_DNS(data, ...) \ - do { if(CURL_TRC_DNS_is_verbose(data)) \ - Curl_trc_dns(data, __VA_ARGS__); } while(0) -#define CURL_TRC_TIMER(data, tid, ...) \ - do { if(CURL_TRC_TIMER_is_verbose(data)) \ - Curl_trc_timer(data, tid, __VA_ARGS__); } while(0) +#define infof(data, ...) \ + do { \ + if(Curl_trc_is_verbose(data)) \ + Curl_infof(data, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_M(data, ...) \ + do { \ + if(CURL_TRC_M_is_verbose(data)) \ + Curl_trc_multi(data, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_CF(data, cf, ...) \ + do { \ + if(Curl_trc_cf_is_verbose(cf, data)) \ + Curl_trc_cf_infof(data, cf, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_WRITE(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_write)) \ + Curl_trc_write(data, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_READ(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \ + Curl_trc_read(data, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_DNS(data, ...) \ + do { \ + if(CURL_TRC_DNS_is_verbose(data)) \ + Curl_trc_dns(data, __VA_ARGS__); \ + } while(0) +#define CURL_TRC_TIMER(data, tid, ...) \ + do { \ + if(CURL_TRC_TIMER_is_verbose(data)) \ + Curl_trc_timer(data, tid, __VA_ARGS__); \ + } while(0) #ifndef CURL_DISABLE_FTP -#define CURL_TRC_FTP(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \ - Curl_trc_ftp(data, __VA_ARGS__); } while(0) +#define CURL_TRC_FTP(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ftp)) \ + Curl_trc_ftp(data, __VA_ARGS__); \ + } while(0) #endif /* !CURL_DISABLE_FTP */ #ifndef CURL_DISABLE_SMTP -#define CURL_TRC_SMTP(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \ - Curl_trc_smtp(data, __VA_ARGS__); } while(0) +#define CURL_TRC_SMTP(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_smtp)) \ + Curl_trc_smtp(data, __VA_ARGS__); \ + } while(0) #endif /* !CURL_DISABLE_SMTP */ #ifdef USE_SSL -#define CURL_TRC_SSLS(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \ - Curl_trc_ssls(data, __VA_ARGS__); } while(0) +#define CURL_TRC_SSLS(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssls)) \ + Curl_trc_ssls(data, __VA_ARGS__); \ + } while(0) #endif /* USE_SSL */ #ifdef USE_SSH -#define CURL_TRC_SSH(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \ - Curl_trc_ssh(data, __VA_ARGS__); } while(0) +#define CURL_TRC_SSH(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ssh)) \ + Curl_trc_ssh(data, __VA_ARGS__); \ + } while(0) #endif /* USE_SSH */ #if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP) -#define CURL_TRC_WS(data, ...) \ - do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \ - Curl_trc_ws(data, __VA_ARGS__); } while(0) +#define CURL_TRC_WS(data, ...) \ + do { \ + if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_ws)) \ + Curl_trc_ws(data, __VA_ARGS__); \ + } while(0) #endif /* !CURL_DISABLE_WEBSOCKETS && !CURL_DISABLE_HTTP */ #else /* CURL_HAVE_C99 */ @@ -220,20 +243,22 @@ extern struct curl_trc_feat Curl_trc_feat_write; extern struct curl_trc_feat Curl_trc_feat_dns; extern struct curl_trc_feat Curl_trc_feat_timer; -#define Curl_trc_is_verbose(data) \ - ((data) && (data)->set.verbose && \ - (!(data)->state.feat || \ - ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO))) -#define Curl_trc_cf_is_verbose(cf, data) \ - (Curl_trc_is_verbose(data) && \ - (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO) +#define Curl_trc_is_verbose(data) \ + ((data) && (data)->set.verbose && \ + (!(data)->state.feat || \ + ((data)->state.feat->log_level >= CURL_LOG_LVL_INFO))) +#define Curl_trc_cf_is_verbose(cf, data) \ + (Curl_trc_is_verbose(data) && \ + (cf) && (cf)->cft->log_level >= CURL_LOG_LVL_INFO) #define Curl_trc_ft_is_verbose(data, ft) \ - (Curl_trc_is_verbose(data) && \ - (ft)->log_level >= CURL_LOG_LVL_INFO) + (Curl_trc_is_verbose(data) && \ + (ft)->log_level >= CURL_LOG_LVL_INFO) #define CURL_MSTATE_NAME(s) Curl_trc_mstate_name((int)(s)) -#define CURL_TRC_EASY_TIMERS(data) \ - do { if(CURL_TRC_TIMER_is_verbose(data)) \ - Curl_trc_easy_timers(data); } while(0) +#define CURL_TRC_EASY_TIMERS(data) \ + do { \ + if(CURL_TRC_TIMER_is_verbose(data)) \ + Curl_trc_easy_timers(data); \ + } while(0) #else /* CURL_DISABLE_VERBOSE_STRINGS */ /* All informational messages are not compiled in for size savings */ diff --git a/lib/curlx/dynbuf.c b/lib/curlx/dynbuf.c index a9ff48367f..158d4d044a 100644 --- a/lib/curlx/dynbuf.c +++ b/lib/curlx/dynbuf.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" + #include "dynbuf.h" #include "../curl_printf.h" diff --git a/lib/curlx/fopen.c b/lib/curlx/fopen.c index ac2552a1c3..035632af4b 100644 --- a/lib/curlx/fopen.c +++ b/lib/curlx/fopen.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "fopen.h" diff --git a/lib/curlx/fopen.h b/lib/curlx/fopen.h index 4cda50df1c..53c079ee26 100644 --- a/lib/curlx/fopen.h +++ b/lib/curlx/fopen.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "multibyte.h" diff --git a/lib/curlx/inet_ntop.c b/lib/curlx/inet_ntop.c index e3dfdc93d1..6b4472bab2 100644 --- a/lib/curlx/inet_ntop.c +++ b/lib/curlx/inet_ntop.c @@ -16,7 +16,6 @@ * * SPDX-License-Identifier: ISC */ - #include "../curl_setup.h" #ifndef HAVE_INET_NTOP diff --git a/lib/curlx/inet_ntop.h b/lib/curlx/inet_ntop.h index 79cdc9e2af..45b63d97a5 100644 --- a/lib/curlx/inet_ntop.h +++ b/lib/curlx/inet_ntop.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef HAVE_INET_NTOP diff --git a/lib/curlx/inet_pton.c b/lib/curlx/inet_pton.c index 8d356bb3d4..703a7b96cb 100644 --- a/lib/curlx/inet_pton.c +++ b/lib/curlx/inet_pton.c @@ -17,7 +17,6 @@ * * SPDX-License-Identifier: ISC */ - #include "../curl_setup.h" #include "strparse.h" diff --git a/lib/curlx/inet_pton.h b/lib/curlx/inet_pton.h index a52ef145da..fc3ae3d2bb 100644 --- a/lib/curlx/inet_pton.h +++ b/lib/curlx/inet_pton.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef HAVE_INET_PTON diff --git a/lib/curlx/multibyte.c b/lib/curlx/multibyte.c index 71170df2c5..529091ad92 100644 --- a/lib/curlx/multibyte.c +++ b/lib/curlx/multibyte.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(_WIN32) && defined(UNICODE) diff --git a/lib/curlx/nonblock.c b/lib/curlx/nonblock.c index 23eb8c0e3a..96bf3db64e 100644 --- a/lib/curlx/nonblock.c +++ b/lib/curlx/nonblock.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef HAVE_SYS_IOCTL_H diff --git a/lib/curlx/strcopy.c b/lib/curlx/strcopy.c index 7ca1b9a057..01d00880cf 100644 --- a/lib/curlx/strcopy.c +++ b/lib/curlx/strcopy.c @@ -22,6 +22,7 @@ * ***************************************************************************/ #include "../curl_setup.h" + #include "strcopy.h" /* diff --git a/lib/curlx/strerr.c b/lib/curlx/strerr.c index addafd2897..3f1b1f5cd2 100644 --- a/lib/curlx/strerr.c +++ b/lib/curlx/strerr.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef HAVE_STRERROR_R diff --git a/lib/curlx/strparse.c b/lib/curlx/strparse.c index 66c749b916..aa78921f50 100644 --- a/lib/curlx/strparse.c +++ b/lib/curlx/strparse.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "strparse.h" void curlx_str_init(struct Curl_str *out) diff --git a/lib/curlx/timediff.c b/lib/curlx/timediff.c index 58a4dfd303..694c8d8352 100644 --- a/lib/curlx/timediff.c +++ b/lib/curlx/timediff.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "timediff.h" /* diff --git a/lib/curlx/timediff.h b/lib/curlx/timediff.h index aa224381dd..e19b0f4403 100644 --- a/lib/curlx/timediff.h +++ b/lib/curlx/timediff.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" /* Use a larger type even for 32-bit time_t systems so that we can keep diff --git a/lib/curlx/timeval.c b/lib/curlx/timeval.c index 08cc2aba5e..fa7e528dd6 100644 --- a/lib/curlx/timeval.c +++ b/lib/curlx/timeval.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "timeval.h" #ifdef _WIN32 diff --git a/lib/curlx/timeval.h b/lib/curlx/timeval.h index 533e80e5e3..4aab17519d 100644 --- a/lib/curlx/timeval.h +++ b/lib/curlx/timeval.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "timediff.h" diff --git a/lib/curlx/version_win32.c b/lib/curlx/version_win32.c index be5b13c9de..a9a4ee38f9 100644 --- a/lib/curlx/version_win32.c +++ b/lib/curlx/version_win32.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef _WIN32 diff --git a/lib/curlx/version_win32.h b/lib/curlx/version_win32.h index 471100a66f..a5fb8ff3c2 100644 --- a/lib/curlx/version_win32.h +++ b/lib/curlx/version_win32.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef _WIN32 diff --git a/lib/curlx/wait.c b/lib/curlx/wait.c index f42041961b..2a9f54bb3e 100644 --- a/lib/curlx/wait.c +++ b/lib/curlx/wait.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifndef HAVE_SELECT diff --git a/lib/curlx/wait.h b/lib/curlx/wait.h index 208bc20acc..c140194a8c 100644 --- a/lib/curlx/wait.h +++ b/lib/curlx/wait.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" int curlx_wait_ms(timediff_t timeout_ms); diff --git a/lib/curlx/warnless.c b/lib/curlx/warnless.c index 1b3d88481a..8c1be2d589 100644 --- a/lib/curlx/warnless.c +++ b/lib/curlx/warnless.c @@ -21,6 +21,7 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#include "../curl_setup.h" #include "warnless.h" diff --git a/lib/curlx/warnless.h b/lib/curlx/warnless.h index 290aaac28d..8a62ccf6a7 100644 --- a/lib/curlx/warnless.h +++ b/lib/curlx/warnless.h @@ -24,8 +24,6 @@ * ***************************************************************************/ -#include "../curl_setup.h" - #define CURLX_FUNCTION_CAST(target_type, func) \ (target_type)(void (*)(void))(func) diff --git a/lib/cw-out.c b/lib/cw-out.c index ad880504a8..69fb344fde 100644 --- a/lib/cw-out.c +++ b/lib/cw-out.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cw-out.h b/lib/cw-out.h index fce868d4e4..7de6524bc5 100644 --- a/lib/cw-out.h +++ b/lib/cw-out.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_easy; diff --git a/lib/cw-pause.c b/lib/cw-pause.c index 69fd675c38..481b9fb27d 100644 --- a/lib/cw-pause.c +++ b/lib/cw-pause.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/cw-pause.h b/lib/cw-pause.h index 4f436059ce..544cbfa577 100644 --- a/lib/cw-pause.h +++ b/lib/cw-pause.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_easy; diff --git a/lib/dict.c b/lib/dict.c index 38d79db057..5839e804c2 100644 --- a/lib/dict.c +++ b/lib/dict.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_DICT diff --git a/lib/dict.h b/lib/dict.h index ba9a92719b..4025c8bcdd 100644 --- a/lib/dict.h +++ b/lib/dict.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifndef CURL_DISABLE_DICT extern const struct Curl_handler Curl_handler_dict; #endif diff --git a/lib/dllmain.c b/lib/dllmain.c index 7b7d3c7e2e..f715b6d301 100644 --- a/lib/dllmain.c +++ b/lib/dllmain.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_OPENSSL @@ -60,6 +59,6 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) } return TRUE; } -#endif /* OpenSSL */ +#endif /* USE_OPENSSL (non-fork) */ -#endif /* DLL build */ +#endif /* _WIN32 && !CURL_STATICLIB */ diff --git a/lib/doh.c b/lib/doh.c index d7d25694c8..9052fab26b 100644 --- a/lib/doh.c +++ b/lib/doh.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_DOH diff --git a/lib/doh.h b/lib/doh.h index 16732173ab..43bc32346b 100644 --- a/lib/doh.h +++ b/lib/doh.h @@ -179,9 +179,9 @@ UNITTEST void de_init(struct dohentry *d); UNITTEST void de_cleanup(struct dohentry *d); #endif -#else /* if DoH is disabled */ +#else /* CURL_DISABLE_DOH */ #define Curl_doh(a, b, c, d, e) NULL #define Curl_doh_is_resolved(x, y) CURLE_COULDNT_RESOLVE_HOST -#endif +#endif /* !CURL_DISABLE_DOH */ #endif /* HEADER_CURL_DOH_H */ diff --git a/lib/dynhds.c b/lib/dynhds.c index 3a4c80de69..c69d312f42 100644 --- a/lib/dynhds.c +++ b/lib/dynhds.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "dynhds.h" @@ -32,10 +31,9 @@ #include #endif /* USE_NGHTTP2 */ - -static struct dynhds_entry * -entry_new(const char *name, size_t namelen, - const char *value, size_t valuelen, int opts) +static struct dynhds_entry *entry_new(const char *name, size_t namelen, + const char *value, size_t valuelen, + int opts) { struct dynhds_entry *e; char *p; @@ -45,7 +43,7 @@ entry_new(const char *name, size_t namelen, e = curlx_calloc(1, sizeof(*e) + namelen + valuelen + 2); if(!e) return NULL; - e->name = p = ((char *)e) + sizeof(*e); + e->name = p = (char *)e + sizeof(*e); memcpy(p, name, namelen); e->namelen = namelen; e->value = p += namelen + 1; /* leave a \0 at the end of name */ diff --git a/lib/easy.c b/lib/easy.c index ccdc4f41c4..398b20edd1 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/easy_lock.h b/lib/easy_lock.h index 927b11d70f..10c84c6a5b 100644 --- a/lib/easy_lock.h +++ b/lib/easy_lock.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #define GLOBAL_INIT_IS_THREADSAFE diff --git a/lib/easygetopt.c b/lib/easygetopt.c index 8eb96ebd17..2685adae95 100644 --- a/lib/easygetopt.c +++ b/lib/easygetopt.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "easyoptions.h" diff --git a/lib/easyif.h b/lib/easyif.h index 181ce38f7b..213fd027da 100644 --- a/lib/easyif.h +++ b/lib/easyif.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Prototypes for library-wide functions provided by easy.c */ diff --git a/lib/easyoptions.h b/lib/easyoptions.h index e908d15bed..d895653ce9 100644 --- a/lib/easyoptions.h +++ b/lib/easyoptions.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* should probably go into the public header */ /* generated table with all easy options */ @@ -32,4 +31,5 @@ extern const struct curl_easyoption Curl_easyopts[]; #ifdef DEBUGBUILD int Curl_easyopts_check(void); #endif -#endif + +#endif /* HEADER_CURL_EASYOPTIONS_H */ diff --git a/lib/escape.c b/lib/escape.c index 24d4c4e42c..afdf18c1b4 100644 --- a/lib/escape.c +++ b/lib/escape.c @@ -21,10 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* Escape and unescape URL encoding in strings. The functions return a new * allocated string or NULL if an error occurred. */ - #include "curl_setup.h" struct Curl_easy; @@ -62,7 +60,7 @@ char *curl_easy_escape(CURL *data, const char *string, int inlength) if(!length) return curlx_strdup(""); - if(length > SIZE_MAX/16) + if(length > SIZE_MAX / 16) return NULL; curlx_dyn_init(&d, length * 3 + 1); diff --git a/lib/fake_addrinfo.c b/lib/fake_addrinfo.c index d4173dbaa2..bf5a44892c 100644 --- a/lib/fake_addrinfo.c +++ b/lib/fake_addrinfo.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "fake_addrinfo.h" diff --git a/lib/fake_addrinfo.h b/lib/fake_addrinfo.h index 4612aa02cb..db701be40a 100644 --- a/lib/fake_addrinfo.h +++ b/lib/fake_addrinfo.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_ARES diff --git a/lib/file.c b/lib/file.c index a8617c213a..8d171374a5 100644 --- a/lib/file.c +++ b/lib/file.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_FILE diff --git a/lib/file.h b/lib/file.h index fea1eea57d..cb3552d924 100644 --- a/lib/file.h +++ b/lib/file.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifndef CURL_DISABLE_FILE extern const struct Curl_handler Curl_handler_file; #endif diff --git a/lib/fileinfo.c b/lib/fileinfo.c index 83d2ef0d00..33e5acde01 100644 --- a/lib/fileinfo.c +++ b/lib/fileinfo.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_FTP @@ -42,4 +41,4 @@ void Curl_fileinfo_cleanup(struct fileinfo *finfo) curlx_free(finfo); } -#endif +#endif /* !CURL_DISABLE_FTP */ diff --git a/lib/fileinfo.h b/lib/fileinfo.h index a17b8d3426..737966788c 100644 --- a/lib/fileinfo.h +++ b/lib/fileinfo.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "llist.h" diff --git a/lib/formdata.c b/lib/formdata.c index 576b644496..8c4dc4830b 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_easy; diff --git a/lib/formdata.h b/lib/formdata.h index 4ece7d06e7..ce592a8fd9 100644 --- a/lib/formdata.h +++ b/lib/formdata.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_FORM_API diff --git a/lib/ftp.c b/lib/ftp.c index 650c2ee992..13fae6a4e4 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_FTP diff --git a/lib/ftp.h b/lib/ftp.h index f4ddb1a37c..0e32d39832 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "pingpong.h" diff --git a/lib/ftplistparser.c b/lib/ftplistparser.c index 5836f1cec3..f82895d57a 100644 --- a/lib/ftplistparser.c +++ b/lib/ftplistparser.c @@ -21,6 +21,9 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#include "curl_setup.h" + +#ifndef CURL_DISABLE_FTP /** * Now implemented: @@ -37,10 +40,6 @@ * 01-29-97 11:32PM prog */ -#include "curl_setup.h" - -#ifndef CURL_DISABLE_FTP - #include "urldata.h" #include "fileinfo.h" #include "llist.h" @@ -1089,4 +1088,4 @@ fail: return retsize; } -#endif /* CURL_DISABLE_FTP */ +#endif /* !CURL_DISABLE_FTP */ diff --git a/lib/ftplistparser.h b/lib/ftplistparser.h index ad8dee7438..afb90dee4c 100644 --- a/lib/ftplistparser.h +++ b/lib/ftplistparser.h @@ -70,8 +70,8 @@ void Curl_wildcard_dtor(struct WildcardData **wcp); struct Curl_easy; -#else -/* FTP is disabled */ +#else /* CURL_DISABLE_FTP */ #define Curl_wildcard_dtor(x) -#endif /* CURL_DISABLE_FTP */ +#endif /* !CURL_DISABLE_FTP */ + #endif /* HEADER_CURL_FTPLISTPARSER_H */ diff --git a/lib/functypes.h b/lib/functypes.h index 92f6b45cd2..ba754f99b6 100644 --- a/lib/functypes.h +++ b/lib/functypes.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /* defaults: diff --git a/lib/getenv.c b/lib/getenv.c index 1955649ace..a957e6e801 100644 --- a/lib/getenv.c +++ b/lib/getenv.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" char *curl_getenv(const char *variable) diff --git a/lib/getinfo.c b/lib/getinfo.c index 1f429b2227..e094ffd134 100644 --- a/lib/getinfo.c +++ b/lib/getinfo.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/gopher.c b/lib/gopher.c index 826de91512..186530de9f 100644 --- a/lib/gopher.c +++ b/lib/gopher.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_GOPHER diff --git a/lib/gopher.h b/lib/gopher.h index 9e3365b71c..1e6a5d2d30 100644 --- a/lib/gopher.h +++ b/lib/gopher.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifndef CURL_DISABLE_GOPHER extern const struct Curl_handler Curl_handler_gopher; #ifdef USE_SSL diff --git a/lib/hash.c b/lib/hash.c index 9ef80dffe9..0b6ecc48f7 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "hash.h" @@ -32,7 +31,6 @@ #define ITERINIT 0x5FEDCBA9 #endif - #if 0 /* useful function for debugging hashes and their contents */ void Curl_hash_print(struct Curl_hash *h, void (*func)(void *)) { diff --git a/lib/hash.h b/lib/hash.h index f669fa5801..8bf47ccf75 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /* Hash function prototype */ diff --git a/lib/headers.c b/lib/headers.c index 5ad73dad01..c188045354 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/hmac.c b/lib/hmac.c index f9248b0977..9080588341 100644 --- a/lib/hmac.c +++ b/lib/hmac.c @@ -23,7 +23,6 @@ * RFC2104 Keyed-Hashing for Message Authentication * ***************************************************************************/ - #include "curl_setup.h" #if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ diff --git a/lib/hostip.c b/lib/hostip.c index aba12ef791..640010c94a 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/hostip.h b/lib/hostip.h index 8964d29af9..6f8e98218e 100644 --- a/lib/hostip.h +++ b/lib/hostip.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "hash.h" diff --git a/lib/hostip4.c b/lib/hostip4.c index 785ca24933..422e0b222a 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /*********************************************************************** diff --git a/lib/hostip6.c b/lib/hostip6.c index d0d67196c4..e4793d7a68 100644 --- a/lib/hostip6.c +++ b/lib/hostip6.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /*********************************************************************** diff --git a/lib/http.c b/lib/http.c index 8a95c6ba6f..3e52efa8d1 100644 --- a/lib/http.c +++ b/lib/http.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http1.c b/lib/http1.c index e12dd32c5a..9e584248be 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http1.h b/lib/http1.h index 88bd99798e..124d32e373 100644 --- a/lib/http1.h +++ b/lib/http1.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http2.c b/lib/http2.c index 061c4d67fb..e0c447ac7e 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2) diff --git a/lib/http2.h b/lib/http2.h index b47cccecc8..950b2f7b28 100644 --- a/lib/http2.h +++ b/lib/http2.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_NGHTTP2 diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index d2493b0b0e..a01b72202d 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_AWS) diff --git a/lib/http_chunks.c b/lib/http_chunks.c index 73f93c2bce..f78a89e54f 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_HTTP diff --git a/lib/http_digest.c b/lib/http_digest.c index 34aba0e3ba..ccc67f5efc 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH) diff --git a/lib/http_digest.h b/lib/http_digest.h index 46cffb0bda..5f797310fd 100644 --- a/lib/http_digest.h +++ b/lib/http_digest.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_DIGEST_AUTH) diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index a8e715a7b9..be1063d92d 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO) diff --git a/lib/http_negotiate.h b/lib/http_negotiate.h index 8e56e9dea3..6c285f152f 100644 --- a/lib/http_negotiate.h +++ b/lib/http_negotiate.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_SPNEGO) diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index e5c97269b1..c4dbdf9ca5 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) diff --git a/lib/http_ntlm.h b/lib/http_ntlm.h index b38ff82dba..ff5218d89f 100644 --- a/lib/http_ntlm.h +++ b/lib/http_ntlm.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_NTLM) diff --git a/lib/http_proxy.c b/lib/http_proxy.c index 088954f230..c5b2f3e871 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "http_proxy.h" @@ -437,4 +436,4 @@ out: return result; } -#endif /* ! CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_HTTP && !CURL_DISABLE_PROXY */ diff --git a/lib/http_proxy.h b/lib/http_proxy.h index 7af2ebb284..c27787b3a5 100644 --- a/lib/http_proxy.h +++ b/lib/http_proxy.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_PROXY) && !defined(CURL_DISABLE_HTTP) diff --git a/lib/httpsrr.c b/lib/httpsrr.c index 7013be5b66..d642a4c904 100644 --- a/lib/httpsrr.c +++ b/lib/httpsrr.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_HTTPSRR diff --git a/lib/httpsrr.h b/lib/httpsrr.h index 4259a03262..8fe7c0c85c 100644 --- a/lib/httpsrr.h +++ b/lib/httpsrr.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_ARES diff --git a/lib/idn.c b/lib/idn.c index b3618c2de3..f055882e23 100644 --- a/lib/idn.c +++ b/lib/idn.c @@ -21,11 +21,9 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * IDN conversions */ - #include "curl_setup.h" #include "urldata.h" @@ -41,7 +39,7 @@ #define IDN2_LOOKUP(name, host, flags) \ idn2_lookup_ul((const char *)name, (char **)host, flags) #endif -#endif /* USE_LIBIDN2 */ +#endif /* USE_LIBIDN2 */ /* for macOS and iOS targets */ #ifdef USE_APPLE_IDN diff --git a/lib/idn.h b/lib/idn.h index 2bdce8927f..42613af509 100644 --- a/lib/idn.h +++ b/lib/idn.h @@ -23,17 +23,17 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - bool Curl_is_ASCII_name(const char *hostname); CURLcode Curl_idnconvert_hostname(struct hostname *host); + #if defined(USE_LIBIDN2) || defined(USE_WIN32_IDN) || defined(USE_APPLE_IDN) #define USE_IDN void Curl_free_idnconverted_hostname(struct hostname *host); CURLcode Curl_idn_decode(const char *input, char **output); CURLcode Curl_idn_encode(const char *input, char **output); - #else #define Curl_free_idnconverted_hostname(x) #define Curl_idn_decode(x) NULL #endif + #endif /* HEADER_CURL_IDN_H */ diff --git a/lib/if2ip.c b/lib/if2ip.c index ef2bfe2b0a..d940c871bc 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/imap.c b/lib/imap.c index 18405e7b44..0af18780d4 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -34,7 +34,6 @@ * Draft LOGIN SASL Mechanism * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_IMAP diff --git a/lib/imap.h b/lib/imap.h index 4433dcf035..26306a6a22 100644 --- a/lib/imap.h +++ b/lib/imap.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - extern const struct Curl_handler Curl_handler_imap; extern const struct Curl_handler Curl_handler_imaps; diff --git a/lib/ldap.c b/lib/ldap.c index cad6203eeb..71871fc742 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && !defined(USE_OPENLDAP) diff --git a/lib/llist.c b/lib/llist.c index ce8e064280..0e3084b570 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "llist.h" diff --git a/lib/llist.h b/lib/llist.h index d90dd68463..1d73db1719 100644 --- a/lib/llist.h +++ b/lib/llist.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" typedef void (*Curl_llist_dtor)(void *user, void *elem); diff --git a/lib/macos.c b/lib/macos.c index 8c49a07b8d..334dbc7d1d 100644 --- a/lib/macos.c +++ b/lib/macos.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef CURL_MACOS_CALL_COPYPROXIES diff --git a/lib/macos.h b/lib/macos.h index 637860e80f..0a72a30272 100644 --- a/lib/macos.h +++ b/lib/macos.h @@ -23,17 +23,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef CURL_MACOS_CALL_COPYPROXIES - CURLcode Curl_macos_init(void); - #else - #define Curl_macos_init() CURLE_OK - #endif #endif /* HEADER_CURL_MACOS_H */ diff --git a/lib/md4.c b/lib/md4.c index 5353695795..e7ecf58ec8 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_CURL_NTLM_CORE diff --git a/lib/md5.c b/lib/md5.c index 12997d175d..3e068cc59f 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ diff --git a/lib/memdebug.c b/lib/memdebug.c index 2dd3aa0bfa..a99972fd13 100644 --- a/lib/memdebug.c +++ b/lib/memdebug.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef CURLDEBUG diff --git a/lib/mime.c b/lib/mime.c index 011201a7cb..37b50de3a0 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_easy; diff --git a/lib/mime.h b/lib/mime.h index 3ac196180b..81080b449f 100644 --- a/lib/mime.h +++ b/lib/mime.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #define MIME_BOUNDARY_DASHES 24 /* leading boundary dashes */ diff --git a/lib/mprintf.c b/lib/mprintf.c index 39f45901ed..50ede212a4 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -20,8 +20,7 @@ * * SPDX-License-Identifier: curl * - */ - + ***************************************************************************/ #include "curl_setup.h" #include "curlx/dynbuf.h" diff --git a/lib/mqtt.c b/lib/mqtt.c index bc9671cc17..74ba90a4a7 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_MQTT diff --git a/lib/mqtt.h b/lib/mqtt.h index 8fb8a33c02..3e45815ba9 100644 --- a/lib/mqtt.h +++ b/lib/mqtt.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifndef CURL_DISABLE_MQTT extern const struct Curl_handler Curl_handler_mqtt; #endif diff --git a/lib/multi.c b/lib/multi.c index 1dd858d189..92f6ca764d 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/multi_ev.c b/lib/multi_ev.c index 5d55ed8ebc..deebb970f3 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/multi_ev.h b/lib/multi_ev.h index 4e5b2a454d..ddbb9331d3 100644 --- a/lib/multi_ev.h +++ b/lib/multi_ev.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "hash.h" struct Curl_easy; diff --git a/lib/multi_ntfy.c b/lib/multi_ntfy.c index c41743719e..4921fc55d5 100644 --- a/lib/multi_ntfy.c +++ b/lib/multi_ntfy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/multi_ntfy.h b/lib/multi_ntfy.h index 2f1f344357..05df2d6681 100644 --- a/lib/multi_ntfy.h +++ b/lib/multi_ntfy.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "uint-bset.h" struct Curl_easy; diff --git a/lib/multihandle.h b/lib/multihandle.h index 2bf06322a8..f66853f5f0 100644 --- a/lib/multihandle.h +++ b/lib/multihandle.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "llist.h" #include "hash.h" #include "conncache.h" diff --git a/lib/multiif.h b/lib/multiif.h index f4dc24a3e9..3695674e4a 100644 --- a/lib/multiif.h +++ b/lib/multiif.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Prototypes for library-wide functions provided by multi.c */ diff --git a/lib/netrc.c b/lib/netrc.c index fe0380066b..0678733d22 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_NETRC diff --git a/lib/netrc.h b/lib/netrc.h index af07c812a5..99ddc6253e 100644 --- a/lib/netrc.h +++ b/lib/netrc.h @@ -23,10 +23,10 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_NETRC + #include "curlx/dynbuf.h" struct store_netrc { diff --git a/lib/noproxy.c b/lib/noproxy.c index 5c0c58530d..541765b650 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_PROXY diff --git a/lib/openldap.c b/lib/openldap.c index e78080ab83..f826a4d006 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_LDAP) && defined(USE_OPENLDAP) diff --git a/lib/parsedate.c b/lib/parsedate.c index b622b5ad90..9b4c483858 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -21,6 +21,11 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#include "curl_setup.h" + +#include "parsedate.h" +#include "curlx/strparse.h" + /* A brief summary of the date string formats this parser groks: @@ -75,11 +80,6 @@ */ -#include "curl_setup.h" - -#include "parsedate.h" -#include "curlx/strparse.h" - /* * parsedate() * diff --git a/lib/parsedate.h b/lib/parsedate.h index ef2578098d..a6ee43a5d4 100644 --- a/lib/parsedate.h +++ b/lib/parsedate.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - extern const char * const Curl_wkday[7]; extern const char * const Curl_month[12]; diff --git a/lib/pingpong.c b/lib/pingpong.c index 8c5cf05fc2..5af5305255 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -24,7 +24,6 @@ * IMAP, POP3, SMTP and whatever more that likes them. * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/pingpong.h b/lib/pingpong.h index b3780571c4..a7292e6003 100644 --- a/lib/pingpong.h +++ b/lib/pingpong.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_FTP) || \ diff --git a/lib/pop3.c b/lib/pop3.c index 97a34ff4d8..8e2c8aa32e 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -36,7 +36,6 @@ * Draft LOGIN SASL Mechanism * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_POP3 diff --git a/lib/pop3.h b/lib/pop3.h index 485e7c2c49..ed00dd15ae 100644 --- a/lib/pop3.h +++ b/lib/pop3.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - extern const struct Curl_handler Curl_handler_pop3; extern const struct Curl_handler Curl_handler_pop3s; diff --git a/lib/progress.c b/lib/progress.c index fc0164c172..6493f748eb 100644 --- a/lib/progress.c +++ b/lib/progress.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/progress.h b/lib/progress.h index f368c2475e..e604a499ed 100644 --- a/lib/progress.h +++ b/lib/progress.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/timeval.h" struct Curl_easy; diff --git a/lib/psl.c b/lib/psl.c index 5346a57fce..e2488aea22 100644 --- a/lib/psl.c +++ b/lib/psl.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_LIBPSL diff --git a/lib/psl.h b/lib/psl.h index dc11469a52..97871f9634 100644 --- a/lib/psl.h +++ b/lib/psl.h @@ -23,8 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifdef USE_LIBPSL + #include struct Curl_easy; diff --git a/lib/rand.c b/lib/rand.c index 4689a04b00..25ecdf1086 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_ARPA_INET_H diff --git a/lib/rand.h b/lib/rand.h index 674cb6ee20..03c69a0df4 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - CURLcode Curl_rand_bytes(struct Curl_easy *data, #ifdef DEBUGBUILD bool allow_env_override, diff --git a/lib/ratelimit.c b/lib/ratelimit.c index feafe669c1..5f87c966a5 100644 --- a/lib/ratelimit.c +++ b/lib/ratelimit.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curlx/timeval.h" diff --git a/lib/ratelimit.h b/lib/ratelimit.h index aa57645126..07f11b8ff4 100644 --- a/lib/ratelimit.h +++ b/lib/ratelimit.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curlx/timeval.h" struct Curl_easy; diff --git a/lib/request.c b/lib/request.c index c8781b70bf..90c10af99c 100644 --- a/lib/request.c +++ b/lib/request.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/request.h b/lib/request.h index 5b0d146028..0b006dc77c 100644 --- a/lib/request.h +++ b/lib/request.h @@ -23,9 +23,7 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* This file is for lib internal stuff */ - #include "curl_setup.h" #include "bufq.h" diff --git a/lib/rtsp.c b/lib/rtsp.c index 063ab7eb92..3d70556400 100644 --- a/lib/rtsp.c +++ b/lib/rtsp.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_RTSP diff --git a/lib/rtsp.h b/lib/rtsp.h index 7b42efde28..70ca00f69a 100644 --- a/lib/rtsp.h +++ b/lib/rtsp.h @@ -23,17 +23,11 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #ifndef CURL_DISABLE_RTSP - extern const struct Curl_handler Curl_handler_rtsp; - CURLcode Curl_rtsp_parseheader(struct Curl_easy *data, const char *header); - #else -/* disabled */ #define Curl_rtsp_parseheader(x, y) CURLE_NOT_BUILT_IN - -#endif /* CURL_DISABLE_RTSP */ +#endif #endif /* HEADER_CURL_RTSP_H */ diff --git a/lib/select.c b/lib/select.c index 5761084242..cae5085fdc 100644 --- a/lib/select.c +++ b/lib/select.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(HAVE_SELECT) && !defined(HAVE_POLL) @@ -263,7 +262,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) ufds[i].revents |= POLLIN | POLLOUT; } -#else /* HAVE_POLL */ +#else /* !HAVE_POLL */ FD_ZERO(&fds_read); FD_ZERO(&fds_write); @@ -329,7 +328,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms) r++; } -#endif /* HAVE_POLL */ +#endif /* HAVE_POLL */ return r; } diff --git a/lib/select.h b/lib/select.h index c5f1c59be0..268ae7cecf 100644 --- a/lib/select.h +++ b/lib/select.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_POLL_H diff --git a/lib/sendf.c b/lib/sendf.c index 96f5c49e0d..2d66ed58dd 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/sendf.h b/lib/sendf.h index a11010d8ad..1521ccb0f8 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /** diff --git a/lib/setopt.c b/lib/setopt.c index 5c0edfa01f..06e7dd1b86 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H @@ -314,7 +313,7 @@ static CURLcode setopt_HTTP_VERSION(struct Curl_easy *data, long arg) data->set.httpwant = (unsigned char)arg; return CURLE_OK; } -#endif /* ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_HTTP */ #ifdef USE_SSL CURLcode Curl_setopt_SSLVERSION(struct Curl_easy *data, CURLoption option, @@ -351,7 +350,7 @@ CURLcode Curl_setopt_SSLVERSION(struct Curl_easy *data, CURLoption option, } return CURLE_OK; } -#endif /* ! USE_SSL */ +#endif /* !USE_SSL */ #ifndef CURL_DISABLE_RTSP static CURLcode setopt_RTSP_REQUEST(struct Curl_easy *data, long arg) @@ -412,7 +411,7 @@ static CURLcode setopt_RTSP_REQUEST(struct Curl_easy *data, long arg) data->set.rtspreq = rtspreq; return CURLE_OK; } -#endif /* ! CURL_DISABLE_RTSP */ +#endif /* !CURL_DISABLE_RTSP */ #ifdef USE_SSL static void set_ssl_options(struct ssl_config_data *ssl, @@ -583,7 +582,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, else s->method = HTTPREQ_GET; break; -#endif /* ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_HTTP */ #ifndef CURL_DISABLE_PROXY case CURLOPT_HTTPPROXYTUNNEL: /* @@ -621,7 +620,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, */ s->proxy_transfer_mode = enabled; break; -#endif /* ! CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_PROXY */ #if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI) case CURLOPT_SOCKS5_GSSAPI_NEC: /* @@ -684,7 +683,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, */ s->tftp_no_options = enabled; break; -#endif /* ! CURL_DISABLE_TFTP */ +#endif /* !CURL_DISABLE_TFTP */ case CURLOPT_TRANSFERTEXT: /* * This option was previously named 'FTPASCII'. Renamed to work with @@ -727,7 +726,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, s->doh_verifystatus = enabled; ok = 2; break; -#endif /* ! CURL_DISABLE_DOH */ +#endif /* !CURL_DISABLE_DOH */ case CURLOPT_SSL_VERIFYHOST: /* * Enable verification of the hostname in the peer certificate @@ -790,7 +789,7 @@ static CURLcode setopt_bool(struct Curl_easy *data, CURLoption option, case CURLOPT_SSH_COMPRESSION: s->ssh_compression = enabled; break; -#endif /* ! USE_SSH */ +#endif /* !USE_SSH */ #ifndef CURL_DISABLE_SMTP case CURLOPT_MAIL_RCPT_ALLOWFAILS: /* allow RCPT TO command to fail for some recipients */ @@ -983,7 +982,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, s->expect_100_timeout = (unsigned short)arg; break; -#endif /* ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_HTTP */ #ifndef CURL_DISABLE_MIME case CURLOPT_MIME_OPTIONS: @@ -1011,7 +1010,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, return CURLE_NOT_BUILT_IN; s->socks5auth = (unsigned char)uarg; break; -#endif /* ! CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_PROXY */ #ifndef CURL_DISABLE_FTP case CURLOPT_FTP_FILEMETHOD: @@ -1032,14 +1031,14 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, break; case CURLOPT_ACCEPTTIMEOUT_MS: return setopt_set_timeout_ms(&s->accepttimeout, arg); -#endif /* ! CURL_DISABLE_FTP */ +#endif /* !CURL_DISABLE_FTP */ #if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) case CURLOPT_FTP_CREATE_MISSING_DIRS: if((arg < CURLFTP_CREATE_DIR_NONE) || (arg > CURLFTP_CREATE_DIR_RETRY)) return CURLE_BAD_FUNCTION_ARGUMENT; s->ftp_create_missing_dirs = (unsigned char)arg; break; -#endif /* ! CURL_DISABLE_FTP || USE_SSH */ +#endif /* !CURL_DISABLE_FTP || USE_SSH */ case CURLOPT_INFILESIZE: if(arg < -1) return CURLE_BAD_FUNCTION_ARGUMENT; @@ -1198,7 +1197,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, data->state.rtsp_next_server_CSeq = arg; break; -#endif /* ! CURL_DISABLE_RTSP */ +#endif /* !CURL_DISABLE_RTSP */ case CURLOPT_TCP_KEEPIDLE: result = value_range(&arg, 0, 0, INT_MAX); @@ -1254,7 +1253,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, else Curl_hsts_cleanup(&data->hsts); break; -#endif /* ! CURL_DISABLE_HSTS */ +#endif /* !CURL_DISABLE_HSTS */ #ifndef CURL_DISABLE_ALTSVC case CURLOPT_ALTSVC_CTRL: if(!arg) { @@ -1267,7 +1266,7 @@ static CURLcode setopt_long(struct Curl_easy *data, CURLoption option, return CURLE_OUT_OF_MEMORY; } return Curl_altsvc_ctrl(data->asi, arg); -#endif /* ! CURL_DISABLE_ALTSVC */ +#endif /* !CURL_DISABLE_ALTSVC */ #ifndef CURL_DISABLE_WEBSOCKETS case CURLOPT_WS_OPTIONS: s->ws_raw_mode = (bool)(arg & CURLWS_RAW_MODE); @@ -1406,8 +1405,8 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, Curl_safefree(data->state.formp); data->state.mimepost = NULL; break; -#endif /* ! CURL_DISABLE_FORM_API */ -#endif /* ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_FORM_API */ +#endif /* !CURL_DISABLE_HTTP */ #if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \ !defined(CURL_DISABLE_IMAP) # ifndef CURL_DISABLE_MIME @@ -1428,8 +1427,8 @@ static CURLcode setopt_pointers(struct Curl_easy *data, CURLoption option, #endif } break; -#endif /* ! CURL_DISABLE_MIME */ -#endif /* ! disabled HTTP, SMTP or IMAP */ +#endif /* !CURL_DISABLE_MIME */ +#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_SMTP || !CURL_DISABLE_IMAP */ case CURLOPT_STDERR: /* * Set to a FILE * that should receive all error writes. This @@ -1711,7 +1710,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, Curl_safefree(s->str[STRING_COPYPOSTFIELDS]); s->method = HTTPREQ_POST; break; -#endif /* ! CURL_DISABLE_HTTP || ! CURL_DISABLE_MQTT */ +#endif /* !CURL_DISABLE_HTTP || !CURL_DISABLE_MQTT */ #ifndef CURL_DISABLE_HTTP case CURLOPT_ACCEPT_ENCODING: @@ -1795,7 +1794,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, return cookielist(data, ptr); #endif /* !CURL_DISABLE_COOKIES */ -#endif /* ! CURL_DISABLE_HTTP */ +#endif /* !CURL_DISABLE_HTTP */ case CURLOPT_CUSTOMREQUEST: /* @@ -2042,7 +2041,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, * proxy exception list */ return Curl_setstropt(&s->str[STRING_NOPROXY], ptr); -#endif /* ! CURL_DISABLE_PROXY */ +#endif /* !CURL_DISABLE_PROXY */ case CURLOPT_RANGE: /* @@ -2400,7 +2399,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, case CURLOPT_INTERLEAVEDATA: s->rtp_out = ptr; break; -#endif /* ! CURL_DISABLE_RTSP */ +#endif /* !CURL_DISABLE_RTSP */ #ifndef CURL_DISABLE_FTP case CURLOPT_CHUNK_DATA: s->wildcardptr = ptr; @@ -2518,7 +2517,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, } break; } -#endif /* ! CURL_DISABLE_HSTS */ +#endif /* !CURL_DISABLE_HSTS */ #ifndef CURL_DISABLE_ALTSVC case CURLOPT_ALTSVC: if(!data->asi) { @@ -2532,7 +2531,7 @@ static CURLcode setopt_cptr(struct Curl_easy *data, CURLoption option, if(ptr) return Curl_altsvc_load(data->asi, ptr); break; -#endif /* ! CURL_DISABLE_ALTSVC */ +#endif /* !CURL_DISABLE_ALTSVC */ #ifdef USE_ECH case CURLOPT_ECH: { size_t plen = 0; diff --git a/lib/sha256.c b/lib/sha256.c index b653100d5d..7c3cad33bf 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \ diff --git a/lib/slist.c b/lib/slist.c index 3be71cb728..9bfd08ae2c 100644 --- a/lib/slist.c +++ b/lib/slist.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "slist.h" diff --git a/lib/smb.c b/lib/smb.c index 5f3e419a42..003a38f19f 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) @@ -1112,9 +1111,9 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) next_state = SMB_CLOSE; break; } - len = Curl_read16_le(((const unsigned char *)msg) + + len = Curl_read16_le((const unsigned char *)msg + sizeof(struct smb_header) + 11); - off = Curl_read16_le(((const unsigned char *)msg) + + off = Curl_read16_le((const unsigned char *)msg + sizeof(struct smb_header) + 13); if(len > 0) { if(off + sizeof(unsigned int) + len > smbc->got) { @@ -1141,7 +1140,7 @@ static CURLcode smb_request_state(struct Curl_easy *data, bool *done) next_state = SMB_CLOSE; break; } - len = Curl_read16_le(((const unsigned char *)msg) + + len = Curl_read16_le((const unsigned char *)msg + sizeof(struct smb_header) + 5); data->req.bytecount += len; data->req.offset += len; diff --git a/lib/smb.h b/lib/smb.h index aa0be881c1..474f8d6a5f 100644 --- a/lib/smb.h +++ b/lib/smb.h @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #if !defined(CURL_DISABLE_SMB) && defined(USE_CURL_NTLM_CORE) && \ (SIZEOF_CURL_OFF_T > 4) diff --git a/lib/smtp.c b/lib/smtp.c index bfd238a13b..471c823152 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -38,7 +38,6 @@ * Draft LOGIN SASL Mechanism * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_SMTP diff --git a/lib/smtp.h b/lib/smtp.h index 5111c62ae6..7e3cf774ae 100644 --- a/lib/smtp.h +++ b/lib/smtp.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - extern const struct Curl_handler Curl_handler_smtp; extern const struct Curl_handler Curl_handler_smtps; diff --git a/lib/sockaddr.h b/lib/sockaddr.h index 2e2d375e06..2b03335087 100644 --- a/lib/sockaddr.h +++ b/lib/sockaddr.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" struct Curl_sockaddr_storage { diff --git a/lib/socketpair.c b/lib/socketpair.c index 756fd7f181..69b42da04c 100644 --- a/lib/socketpair.c +++ b/lib/socketpair.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "socketpair.h" @@ -221,14 +220,14 @@ int Curl_socketpair(int domain, int type, int protocol, goto error; if( #ifdef USE_WINSOCK - /* This is how Windows does it */ - (SOCKEWOULDBLOCK == sockerr) + /* This is how Windows does it */ + (SOCKEWOULDBLOCK == sockerr) #else - /* errno may be EWOULDBLOCK or on some systems EAGAIN when it - returned due to its inability to send off data without - blocking. We therefore treat both error codes the same here */ - (SOCKEWOULDBLOCK == sockerr) || (EAGAIN == sockerr) || - (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr) + /* errno may be EWOULDBLOCK or on some systems EAGAIN when it + returned due to its inability to send off data without + blocking. We therefore treat both error codes the same here */ + (SOCKEWOULDBLOCK == sockerr) || (EAGAIN == sockerr) || + (SOCKEINTR == sockerr) || (SOCKEINPROGRESS == sockerr) #endif ) { continue; diff --git a/lib/socketpair.h b/lib/socketpair.h index a839a2c50d..36685e71a5 100644 --- a/lib/socketpair.h +++ b/lib/socketpair.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_EVENTFD diff --git a/lib/socks.c b/lib/socks.c index 5306214557..ee89e89298 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_PROXY diff --git a/lib/socks.h b/lib/socks.h index 7c43e92e7e..520fb75ddb 100644 --- a/lib/socks.h +++ b/lib/socks.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_PROXY @@ -54,4 +53,4 @@ extern struct Curl_cftype Curl_cft_socks_proxy; #endif /* !CURL_DISABLE_PROXY */ -#endif /* HEADER_CURL_SOCKS_H */ +#endif /* HEADER_CURL_SOCKS_H */ diff --git a/lib/socks_gssapi.c b/lib/socks_gssapi.c index ce493c0393..1c2bfee987 100644 --- a/lib/socks_gssapi.c +++ b/lib/socks_gssapi.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if defined(HAVE_GSSAPI) && !defined(CURL_DISABLE_PROXY) diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 4a206a06ad..5e9e49f2a9 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -22,7 +22,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_PROXY) diff --git a/lib/splay.c b/lib/splay.c index a95eb10d85..92a4b16199 100644 --- a/lib/splay.c +++ b/lib/splay.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "curlx/timeval.h" diff --git a/lib/strcase.c b/lib/strcase.c index f36d2b8f10..34ccae35de 100644 --- a/lib/strcase.c +++ b/lib/strcase.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "strcase.h" diff --git a/lib/strcase.h b/lib/strcase.h index 060ebba6e5..3a7f126790 100644 --- a/lib/strcase.h +++ b/lib/strcase.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" char Curl_raw_toupper(char in); diff --git a/lib/strdup.c b/lib/strdup.c index 99976a5dea..f666571e3e 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef _WIN32 diff --git a/lib/strequal.c b/lib/strequal.c index 14edad7e8c..98cecdc244 100644 --- a/lib/strequal.c +++ b/lib/strequal.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "strcase.h" diff --git a/lib/strerror.c b/lib/strerror.c index 6c655f4fe6..b281b1886a 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/strerror.h b/lib/strerror.h index a10164c9da..4b9779ff2d 100644 --- a/lib/strerror.h +++ b/lib/strerror.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_WINDOWS_SSPI diff --git a/lib/system_win32.c b/lib/system_win32.c index a53f61724e..0e03e7cd6f 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef _WIN32 diff --git a/lib/system_win32.h b/lib/system_win32.h index e3ed0547fe..c7df2a5c0d 100644 --- a/lib/system_win32.h +++ b/lib/system_win32.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef _WIN32 @@ -41,8 +40,8 @@ typedef unsigned int(WINAPI *IF_NAMETOINDEX_FN)(const char *); /* This is used instead of if_nametoindex if available on Windows */ extern IF_NAMETOINDEX_FN Curl_if_nametoindex; #endif -#else /* _WIN32 */ +#else /* !_WIN32 */ #define Curl_win32_init(x) CURLE_OK -#endif /* !_WIN32 */ +#endif /* _WIN32 */ #endif /* HEADER_CURL_SYSTEM_WIN32_H */ diff --git a/lib/telnet.c b/lib/telnet.c index b4589158e9..a9326cbffd 100644 --- a/lib/telnet.c +++ b/lib/telnet.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_TELNET diff --git a/lib/tftp.c b/lib/tftp.c index 0e03933ab9..69571bbdde 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifndef CURL_DISABLE_TFTP diff --git a/lib/transfer.c b/lib/transfer.c index b567d14abd..fed6a1786e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/transfer.h b/lib/transfer.h index 78473b1f0d..05a5f891ac 100644 --- a/lib/transfer.h +++ b/lib/transfer.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #define Curl_headersep(x) ((((x) == ':') || ((x) == ';'))) char *Curl_checkheaders(const struct Curl_easy *data, diff --git a/lib/uint-bset.c b/lib/uint-bset.c index 32aebe7cda..5efdbea282 100644 --- a/lib/uint-bset.c +++ b/lib/uint-bset.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "uint-bset.h" @@ -186,7 +185,7 @@ uint32_t Curl_popcount64(uint64_t x) x -= (x >> 1) & m1; /* replace every 2 bits with bits present */ x = (x & m2) + ((x >> 2) & m2); /* replace every nibble with bits present */ x = (x + (x >> 4)) & m4; /* replace every byte with bits present */ - /* top 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ... which makes the + /* top 8 bits of x + (x << 8) + (x << 16) + (x << 24) + ... which makes the * top byte the sum of all individual 8 bytes, throw away the rest */ return (uint32_t)((x * h01) >> 56); } diff --git a/lib/uint-hash.c b/lib/uint-hash.c index b3fd9dea19..e23d249d05 100644 --- a/lib/uint-hash.c +++ b/lib/uint-hash.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "uint-hash.h" diff --git a/lib/uint-hash.h b/lib/uint-hash.h index e7f2ab9cbc..56d7104355 100644 --- a/lib/uint-hash.h +++ b/lib/uint-hash.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" /* A version with uint32_t as key */ diff --git a/lib/uint-spbset.c b/lib/uint-spbset.c index 03e9efb424..58dcbdac22 100644 --- a/lib/uint-spbset.c +++ b/lib/uint-spbset.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "uint-bset.h" diff --git a/lib/uint-table.c b/lib/uint-table.c index bbfabc9edf..b9c1990130 100644 --- a/lib/uint-table.c +++ b/lib/uint-table.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "uint-table.h" diff --git a/lib/url.c b/lib/url.c index 556d140ee2..f64a1a481c 100644 --- a/lib/url.c +++ b/lib/url.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef HAVE_NETINET_IN_H diff --git a/lib/urlapi.c b/lib/urlapi.c index 747ac814ba..5a424829c0 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #include "urldata.h" diff --git a/lib/urldata.h b/lib/urldata.h index 486cfd4173..aba1693ca7 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -23,9 +23,7 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* This file is for lib internal stuff */ - #include "curl_setup.h" #define PORT_FTP 21 @@ -530,43 +528,45 @@ struct Curl_handler { }; #define PROTOPT_NONE 0 /* nothing extra */ -#define PROTOPT_SSL (1<<0) /* uses SSL */ -#define PROTOPT_DUAL (1<<1) /* this protocol uses two connections */ -#define PROTOPT_CLOSEACTION (1<<2) /* need action before socket close */ +#define PROTOPT_SSL (1 << 0) /* uses SSL */ +#define PROTOPT_DUAL (1 << 1) /* this protocol uses two connections */ +#define PROTOPT_CLOSEACTION (1 << 2) /* need action before socket close */ /* some protocols will have to call the underlying functions without regard to what exact state the socket signals. IE even if the socket says "readable", the send function might need to be called while uploading, or vice versa. */ -#define PROTOPT_DIRLOCK (1<<3) -#define PROTOPT_NONETWORK (1<<4) /* protocol does not use the network! */ -#define PROTOPT_NEEDSPWD (1<<5) /* needs a password, and if none is set it +#define PROTOPT_DIRLOCK (1 << 3) +#define PROTOPT_NONETWORK (1 << 4) /* protocol does not use the network! */ +#define PROTOPT_NEEDSPWD (1 << 5) /* needs a password, and if none is set it gets a default */ -#define PROTOPT_NOURLQUERY (1<<6) /* protocol cannot handle - URL query strings (?foo=bar) ! */ -#define PROTOPT_CREDSPERREQUEST (1<<7) /* requires login credentials per - request instead of per connection */ -#define PROTOPT_ALPN (1<<8) /* set ALPN for this */ -/* (1<<9) was PROTOPT_STREAM, now free */ -#define PROTOPT_URLOPTIONS (1<<10) /* allow options part in the userinfo field - of the URL */ -#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_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_CONN_REUSE (1<<16) /* this protocol can reuse connections */ +#define PROTOPT_NOURLQUERY (1 << 6) /* protocol cannot handle + URL query strings (?foo=bar) ! */ +#define PROTOPT_CREDSPERREQUEST (1 << 7) /* requires login credentials per + request instead of per + connection */ +#define PROTOPT_ALPN (1 << 8) /* set ALPN for this */ +/* (1 << 9) was PROTOPT_STREAM, now free */ +#define PROTOPT_URLOPTIONS (1 << 10) /* allow options part in the userinfo + field of the URL */ +#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_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_CONN_REUSE (1 << 16) /* this protocol can reuse connections */ #define CONNCHECK_NONE 0 /* No checks */ -#define CONNCHECK_ISDEAD (1<<0) /* Check if the connection is dead. */ -#define CONNCHECK_KEEPALIVE (1<<1) /* Perform any keepalive function. */ +#define CONNCHECK_ISDEAD (1 << 0) /* Check if the connection is dead. */ +#define CONNCHECK_KEEPALIVE (1 << 1) /* Perform any keepalive function. */ #define CONNRESULT_NONE 0 /* No extra information. */ -#define CONNRESULT_DEAD (1<<0) /* The connection is dead. */ +#define CONNRESULT_DEAD (1 << 0) /* The connection is dead. */ #define TRNSPRT_NONE 0 #define TRNSPRT_TCP 3 diff --git a/lib/vauth/cleartext.c b/lib/vauth/cleartext.c index a3e83d74f4..fc8a6ebd51 100644 --- a/lib/vauth/cleartext.c +++ b/lib/vauth/cleartext.c @@ -24,7 +24,6 @@ * Draft LOGIN SASL Mechanism * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ diff --git a/lib/vauth/cram.c b/lib/vauth/cram.c index 8aa4055231..f539973802 100644 --- a/lib/vauth/cram.c +++ b/lib/vauth/cram.c @@ -23,7 +23,6 @@ * RFC2195 CRAM-MD5 authentication * ***************************************************************************/ - #include "../curl_setup.h" #ifndef CURL_DISABLE_DIGEST_AUTH diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index c67be1dd84..40e8873913 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -24,7 +24,6 @@ * RFC7616 DIGEST-SHA256, DIGEST-SHA512-256 authentication * ***************************************************************************/ - #include "../curl_setup.h" #ifndef CURL_DISABLE_DIGEST_AUTH @@ -586,16 +585,16 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg, else if(curl_strequal(content, "SHA-512-256")) { #ifdef CURL_HAVE_SHA512_256 digest->algo = ALGO_SHA512_256; -#else /* ! CURL_HAVE_SHA512_256 */ +#else /* !CURL_HAVE_SHA512_256 */ return CURLE_NOT_BUILT_IN; -#endif /* ! CURL_HAVE_SHA512_256 */ +#endif /* CURL_HAVE_SHA512_256 */ } else if(curl_strequal(content, "SHA-512-256-SESS")) { #ifdef CURL_HAVE_SHA512_256 digest->algo = ALGO_SHA512_256SESS; -#else /* ! CURL_HAVE_SHA512_256 */ +#else /* !CURL_HAVE_SHA512_256 */ return CURLE_NOT_BUILT_IN; -#endif /* ! CURL_HAVE_SHA512_256 */ +#endif /* CURL_HAVE_SHA512_256 */ } else return CURLE_BAD_CONTENT_ENCODING; diff --git a/lib/vauth/digest.h b/lib/vauth/digest.h index 63f388bf46..902ffab153 100644 --- a/lib/vauth/digest.h +++ b/lib/vauth/digest.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifndef CURL_DISABLE_DIGEST_AUTH diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index bc681d13dc..615b4bc827 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -24,7 +24,6 @@ * RFC2831 DIGEST-MD5 authentication * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_WINDOWS_SSPI) && !defined(CURL_DISABLE_DIGEST_AUTH) diff --git a/lib/vauth/gsasl.c b/lib/vauth/gsasl.c index 2f82254608..b95d6e3f0a 100644 --- a/lib/vauth/gsasl.c +++ b/lib/vauth/gsasl.c @@ -23,7 +23,6 @@ * RFC5802 SCRAM-SHA-1 authentication * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_GSASL diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 64797190ce..6a9f182864 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -24,7 +24,6 @@ * RFC4752 The Kerberos V5 ("GSSAPI") SASL Mechanism * ***************************************************************************/ - #include "../curl_setup.h" #if defined(HAVE_GSSAPI) && defined(USE_KERBEROS5) diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index d88ee79bde..8bf2091a54 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -23,7 +23,6 @@ * RFC4752 The Kerberos V5 ("GSSAPI") SASL Mechanism * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_WINDOWS_SSPI) && defined(USE_KERBEROS5) diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 620f2a5c84..54755733e9 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_NTLM) && !defined(USE_WINDOWS_SSPI) @@ -48,86 +47,86 @@ /* Flag bits definitions based on https://davenport.sourceforge.net/ntlm.html */ -#define NTLMFLAG_NEGOTIATE_UNICODE (1<<0) +#define NTLMFLAG_NEGOTIATE_UNICODE (1 << 0) /* Indicates that Unicode strings are supported for use in security buffer data. */ -#define NTLMFLAG_NEGOTIATE_OEM (1<<1) +#define NTLMFLAG_NEGOTIATE_OEM (1 << 1) /* Indicates that OEM strings are supported for use in security buffer data. */ -#define NTLMFLAG_REQUEST_TARGET (1<<2) +#define NTLMFLAG_REQUEST_TARGET (1 << 2) /* Requests that the server's authentication realm be included in the Type 2 message. */ -/* unknown (1<<3) */ -#define NTLMFLAG_NEGOTIATE_SIGN (1<<4) +/* unknown (1 << 3) */ +#define NTLMFLAG_NEGOTIATE_SIGN (1 << 4) /* Specifies that authenticated communication between the client and server should carry a digital signature (message integrity). */ -#define NTLMFLAG_NEGOTIATE_SEAL (1<<5) +#define NTLMFLAG_NEGOTIATE_SEAL (1 << 5) /* Specifies that authenticated communication between the client and server should be encrypted (message confidentiality). */ -#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1<<6) +#define NTLMFLAG_NEGOTIATE_DATAGRAM_STYLE (1 << 6) /* Indicates that datagram authentication is being used. */ -#define NTLMFLAG_NEGOTIATE_LM_KEY (1<<7) +#define NTLMFLAG_NEGOTIATE_LM_KEY (1 << 7) /* Indicates that the LAN Manager session key should be used for signing and sealing authenticated communications. */ -#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1<<9) +#define NTLMFLAG_NEGOTIATE_NTLM_KEY (1 << 9) /* Indicates that NTLM authentication is being used. */ -/* unknown (1<<10) */ +/* unknown (1 << 10) */ -#define NTLMFLAG_NEGOTIATE_ANONYMOUS (1<<11) +#define NTLMFLAG_NEGOTIATE_ANONYMOUS (1 << 11) /* Sent by the client in the Type 3 message to indicate that an anonymous context has been established. This also affects the response fields. */ -#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1<<12) +#define NTLMFLAG_NEGOTIATE_DOMAIN_SUPPLIED (1 << 12) /* Sent by the client in the Type 1 message to indicate that a desired authentication realm is included in the message. */ -#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1<<13) +#define NTLMFLAG_NEGOTIATE_WORKSTATION_SUPPLIED (1 << 13) /* Sent by the client in the Type 1 message to indicate that the client workstation's name is included in the message. */ -#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1<<14) +#define NTLMFLAG_NEGOTIATE_LOCAL_CALL (1 << 14) /* Sent by the server to indicate that the server and client are on the same machine. Implies that the client may use a pre-established local security context rather than responding to the challenge. */ -#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1<<15) +#define NTLMFLAG_NEGOTIATE_ALWAYS_SIGN (1 << 15) /* Indicates that authenticated communication between the client and server should be signed with a "dummy" signature. */ -#define NTLMFLAG_TARGET_TYPE_DOMAIN (1<<16) +#define NTLMFLAG_TARGET_TYPE_DOMAIN (1 << 16) /* Sent by the server in the Type 2 message to indicate that the target authentication realm is a domain. */ -#define NTLMFLAG_TARGET_TYPE_SERVER (1<<17) +#define NTLMFLAG_TARGET_TYPE_SERVER (1 << 17) /* Sent by the server in the Type 2 message to indicate that the target authentication realm is a server. */ -#define NTLMFLAG_TARGET_TYPE_SHARE (1<<18) +#define NTLMFLAG_TARGET_TYPE_SHARE (1 << 18) /* Sent by the server in the Type 2 message to indicate that the target authentication realm is a share. Presumably, this is for share-level authentication. Usage is unclear. */ -#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1<<19) +#define NTLMFLAG_NEGOTIATE_NTLM2_KEY (1 << 19) /* Indicates that the NTLM2 signing and sealing scheme should be used for protecting authenticated communications. */ -#define NTLMFLAG_REQUEST_INIT_RESPONSE (1<<20) +#define NTLMFLAG_REQUEST_INIT_RESPONSE (1 << 20) /* unknown purpose */ -#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1<<21) +#define NTLMFLAG_REQUEST_ACCEPT_RESPONSE (1 << 21) /* unknown purpose */ -#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1<<22) +#define NTLMFLAG_REQUEST_NONNT_SESSION_KEY (1 << 22) /* unknown purpose */ -#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1<<23) +#define NTLMFLAG_NEGOTIATE_TARGET_INFO (1 << 23) /* Sent by the server in the Type 2 message to indicate that it is including a Target Information block in the message. */ @@ -137,14 +136,14 @@ /* unknown (1<27) */ /* unknown (1<28) */ -#define NTLMFLAG_NEGOTIATE_128 (1<<29) +#define NTLMFLAG_NEGOTIATE_128 (1 << 29) /* Indicates that 128-bit encryption is supported. */ -#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1<<30) +#define NTLMFLAG_NEGOTIATE_KEY_EXCHANGE (1 << 30) /* Indicates that the client will provide an encrypted master key in the "Session Key" field of the Type 3 message. */ -#define NTLMFLAG_NEGOTIATE_56 (1<<31) +#define NTLMFLAG_NEGOTIATE_56 (1 << 31) /* Indicates that 56-bit encryption is supported. */ /* "NTLMSSP" signature is always in ASCII regardless of the platform */ diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 3d6712766e..3197dd0a2e 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_WINDOWS_SSPI) && defined(USE_NTLM) diff --git a/lib/vauth/oauth2.c b/lib/vauth/oauth2.c index fc89cba49f..a7a061337f 100644 --- a/lib/vauth/oauth2.c +++ b/lib/vauth/oauth2.c @@ -23,7 +23,6 @@ * RFC6749 OAuth 2.0 Authorization Framework * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_IMAP) || !defined(CURL_DISABLE_SMTP) || \ diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 08689fe5e0..b1ec37cb31 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -23,7 +23,6 @@ * RFC4178 Simple and Protected GSS-API Negotiation Mechanism * ***************************************************************************/ - #include "../curl_setup.h" #if defined(HAVE_GSSAPI) && defined(USE_SPNEGO) diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index 280753e396..4211763166 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -23,7 +23,6 @@ * RFC4178 Simple and Protected GSS-API Negotiation Mechanism * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_WINDOWS_SSPI) && defined(USE_SPNEGO) diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 61f79037a3..9c37df947c 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "vauth.h" diff --git a/lib/vauth/vauth.h b/lib/vauth/vauth.h index 39dc0d3995..312bd8da5a 100644 --- a/lib/vauth/vauth.h +++ b/lib/vauth/vauth.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "../bufref.h" diff --git a/lib/version.c b/lib/version.c index a5be6c69cf..697d9ea96d 100644 --- a/lib/version.c +++ b/lib/version.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "curl_setup.h" #ifdef USE_NGHTTP2 diff --git a/lib/vquic/curl_ngtcp2.c b/lib/vquic/curl_ngtcp2.c index 7a0c214422..e80ece0f9c 100644 --- a/lib/vquic/curl_ngtcp2.c +++ b/lib/vquic/curl_ngtcp2.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_NGTCP2) && defined(USE_NGHTTP3) diff --git a/lib/vquic/curl_ngtcp2.h b/lib/vquic/curl_ngtcp2.h index 7933e924e1..1e9868e0f7 100644 --- a/lib/vquic/curl_ngtcp2.h +++ b/lib/vquic/curl_ngtcp2.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_NGTCP2) && defined(USE_NGHTTP3) diff --git a/lib/vquic/curl_osslq.c b/lib/vquic/curl_osslq.c index 537484faf6..464879788c 100644 --- a/lib/vquic/curl_osslq.c +++ b/lib/vquic/curl_osslq.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \ diff --git a/lib/vquic/curl_osslq.h b/lib/vquic/curl_osslq.h index 9f5025f8ae..7aa93d6728 100644 --- a/lib/vquic/curl_osslq.h +++ b/lib/vquic/curl_osslq.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_OPENSSL_QUIC) && \ diff --git a/lib/vquic/curl_quiche.c b/lib/vquic/curl_quiche.c index c85336cd02..5c431110a5 100644 --- a/lib/vquic/curl_quiche.c +++ b/lib/vquic/curl_quiche.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_QUICHE) diff --git a/lib/vquic/curl_quiche.h b/lib/vquic/curl_quiche.h index bee966eeb7..6c0fb9ee1e 100644 --- a/lib/vquic/curl_quiche.h +++ b/lib/vquic/curl_quiche.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_QUICHE) diff --git a/lib/vquic/vquic-tls.c b/lib/vquic/vquic-tls.c index 204a722249..3391d98074 100644 --- a/lib/vquic/vquic-tls.c +++ b/lib/vquic/vquic-tls.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_HTTP3) && \ diff --git a/lib/vquic/vquic-tls.h b/lib/vquic/vquic-tls.h index a14714532d..cff7654323 100644 --- a/lib/vquic/vquic-tls.h +++ b/lib/vquic/vquic-tls.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_HTTP3) && \ diff --git a/lib/vquic/vquic.c b/lib/vquic/vquic.c index a09b2b7193..d7bfa99104 100644 --- a/lib/vquic/vquic.c +++ b/lib/vquic/vquic.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef HAVE_NETINET_UDP_H diff --git a/lib/vquic/vquic.h b/lib/vquic/vquic.h index fa2c0d4e81..f5392eb047 100644 --- a/lib/vquic/vquic.h +++ b/lib/vquic/vquic.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP3) diff --git a/lib/vquic/vquic_int.h b/lib/vquic/vquic_int.h index 82f22b45a8..e602b7ee6d 100644 --- a/lib/vquic/vquic_int.h +++ b/lib/vquic/vquic_int.h @@ -23,8 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" + #include "../bufq.h" #ifdef USE_HTTP3 diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 1a007cd561..5d5125b526 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_LIBSSH diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 6357f41b79..5b2b337289 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -21,13 +21,12 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - -/* #define CURL_LIBSSH2_DEBUG */ - #include "../curl_setup.h" #ifdef USE_LIBSSH2 +/* #define CURL_LIBSSH2_DEBUG */ + #ifdef HAVE_NETINET_IN_H #include #endif @@ -167,7 +166,7 @@ static void kbd_callback(const char *name, int name_len, (void)name_len; (void)instruction; (void)instruction_len; -#endif /* CURL_LIBSSH2_DEBUG */ +#endif /* CURL_LIBSSH2_DEBUG */ if(num_prompts == 1) { struct connectdata *conn = data->conn; responses[0].text = curlx_strdup(conn->passwd); diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 40b26e6cb7..6fdf3f794b 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_LIBSSH2 diff --git a/lib/vssh/vssh.c b/lib/vssh/vssh.c index d322643eb4..77fa89b557 100644 --- a/lib/vssh/vssh.c +++ b/lib/vssh/vssh.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl AND ISC * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_SSH @@ -239,4 +238,4 @@ CURLcode Curl_ssh_range(struct Curl_easy *data, return CURLE_OK; } -#endif /* if SSH is used */ +#endif /* USE_SSH */ diff --git a/lib/vssh/vssh.h b/lib/vssh/vssh.h index 78de75c9e9..4bc6d80807 100644 --- a/lib/vssh/vssh.h +++ b/lib/vssh/vssh.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #include "../urldata.h" @@ -37,4 +36,5 @@ CURLcode Curl_get_pathname(const char **cpp, char **path, const char *homedir); CURLcode Curl_ssh_range(struct Curl_easy *data, const char *range, curl_off_t filesize, curl_off_t *startp, curl_off_t *sizep); + #endif /* HEADER_CURL_PATH_H */ diff --git a/lib/vtls/apple.h b/lib/vtls/apple.h index 3d84f87822..dd1b5db357 100644 --- a/lib/vtls/apple.h +++ b/lib/vtls/apple.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_APPLE_SECTRUST diff --git a/lib/vtls/cipher_suite.c b/lib/vtls/cipher_suite.c index c026bdee91..562a347735 100644 --- a/lib/vtls/cipher_suite.c +++ b/lib/vtls/cipher_suite.c @@ -24,6 +24,7 @@ #include "../curl_setup.h" #if defined(USE_MBEDTLS) || defined(USE_RUSTLS) + #include "cipher_suite.h" /* @@ -130,24 +131,24 @@ enum { CS_TXT_LEN, }; -#define CS_ZIP_IDX(a, b, c, d, e, f, g, h) \ -{ \ - (uint8_t) ((((a) << 2) & 0xFF) | ((b) & 0x3F) >> 4), \ - (uint8_t) ((((b) << 4) & 0xFF) | ((c) & 0x3F) >> 2), \ - (uint8_t) ((((c) << 6) & 0xFF) | ((d) & 0x3F)), \ - (uint8_t) ((((e) << 2) & 0xFF) | ((f) & 0x3F) >> 4), \ - (uint8_t) ((((f) << 4) & 0xFF) | ((g) & 0x3F) >> 2), \ - (uint8_t) ((((g) << 6) & 0xFF) | ((h) & 0x3F)) \ +#define CS_ZIP_IDX(a, b, c, d, e, f, g, h) \ +{ \ + (uint8_t)((((a) << 2) & 0xFF) | ((b) & 0x3F) >> 4), \ + (uint8_t)((((b) << 4) & 0xFF) | ((c) & 0x3F) >> 2), \ + (uint8_t)((((c) << 6) & 0xFF) | ((d) & 0x3F)), \ + (uint8_t)((((e) << 2) & 0xFF) | ((f) & 0x3F) >> 4), \ + (uint8_t)((((f) << 4) & 0xFF) | ((g) & 0x3F) >> 2), \ + (uint8_t)((((g) << 6) & 0xFF) | ((h) & 0x3F)) \ } -#define CS_ENTRY(id, a, b, c, d, e, f, g, h) \ -{ \ - id, \ - CS_ZIP_IDX( \ - CS_TXT_IDX_ ## a, CS_TXT_IDX_ ## b, \ - CS_TXT_IDX_ ## c, CS_TXT_IDX_ ## d, \ - CS_TXT_IDX_ ## e, CS_TXT_IDX_ ## f, \ - CS_TXT_IDX_ ## g, CS_TXT_IDX_ ## h \ - ) \ +#define CS_ENTRY(id, a, b, c, d, e, f, g, h) \ +{ \ + id, \ + CS_ZIP_IDX( \ + CS_TXT_IDX_ ## a, CS_TXT_IDX_ ## b, \ + CS_TXT_IDX_ ## c, CS_TXT_IDX_ ## d, \ + CS_TXT_IDX_ ## e, CS_TXT_IDX_ ## f, \ + CS_TXT_IDX_ ## g, CS_TXT_IDX_ ## h \ + ) \ } struct cs_entry { diff --git a/lib/vtls/cipher_suite.h b/lib/vtls/cipher_suite.h index a1dcbc524f..a17284f86e 100644 --- a/lib/vtls/cipher_suite.h +++ b/lib/vtls/cipher_suite.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_MBEDTLS) || defined(USE_RUSTLS) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index dbc72c521d..0fa7cfd6e1 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for all GnuTLS-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. @@ -29,7 +28,6 @@ * Note: do not use the GnuTLS' *_t variable type names in this source code, * since they were not present in 1.0.X. */ - #include "../curl_setup.h" #ifdef USE_GNUTLS diff --git a/lib/vtls/gtls.h b/lib/vtls/gtls.h index 4ed79f63ed..ecdca0a666 100644 --- a/lib/vtls/gtls.h +++ b/lib/vtls/gtls.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_GNUTLS diff --git a/lib/vtls/hostcheck.c b/lib/vtls/hostcheck.c index e56860a35b..9706336735 100644 --- a/lib/vtls/hostcheck.c +++ b/lib/vtls/hostcheck.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_OPENSSL) || defined(USE_SCHANNEL) @@ -125,4 +124,4 @@ bool Curl_cert_hostcheck(const char *match, size_t matchlen, return FALSE; } -#endif /* OPENSSL or SCHANNEL */ +#endif /* USE_OPENSSL || USE_SCHANNEL */ diff --git a/lib/vtls/hostcheck.h b/lib/vtls/hostcheck.h index ca767be3ce..d62c721352 100644 --- a/lib/vtls/hostcheck.h +++ b/lib/vtls/hostcheck.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_OPENSSL) || defined(USE_SCHANNEL) diff --git a/lib/vtls/keylog.c b/lib/vtls/keylog.c index 2c1c595bfc..ace9cab1ae 100644 --- a/lib/vtls/keylog.c +++ b/lib/vtls/keylog.c @@ -144,4 +144,4 @@ bool Curl_tls_keylog_write(const char *label, return TRUE; } -#endif /* TLS or QUIC backend */ +#endif /* TLS or QUIC backend */ diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 46bfa0967e..dff45a3299 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -22,13 +22,11 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for all mbedTLS-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * */ - #include "../curl_setup.h" #ifdef USE_MBEDTLS diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index dcc76a9299..339130103f 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -21,12 +21,10 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for all OpenSSL-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. */ - #include "../curl_setup.h" #if defined(USE_QUICHE) || defined(USE_OPENSSL) @@ -518,7 +516,7 @@ static CURLcode ossl_certchain(struct Curl_easy *data, SSL *ssl) return result; } -#endif /* quiche or OpenSSL */ +#endif /* USE_QUICHE || USE_OPENSSL */ #ifdef USE_OPENSSL @@ -4656,7 +4654,7 @@ out: curlx_dyn_free(&dname); return result; } -#endif /* ! CURL_DISABLE_VERBOSE_STRINGS */ +#endif /* !CURL_DISABLE_VERBOSE_STRINGS */ #ifdef USE_APPLE_SECTRUST struct ossl_certs_ctx { diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h index c3ba67a8ff..aeeb8dd805 100644 --- a/lib/vtls/openssl.h +++ b/lib/vtls/openssl.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_OPENSSL diff --git a/lib/vtls/rustls.c b/lib/vtls/rustls.c index 014f11b4f0..fc380b062b 100644 --- a/lib/vtls/rustls.c +++ b/lib/vtls/rustls.c @@ -5,8 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) Jacob Hoffman-Andrews, - * + * Copyright (C) Jacob Hoffman-Andrews, * Copyright (C) kpcyrd, * Copyright (C) Daniel McCarney, * diff --git a/lib/vtls/rustls.h b/lib/vtls/rustls.h index 74d39d4d11..2d3b0bb11f 100644 --- a/lib/vtls/rustls.h +++ b/lib/vtls/rustls.h @@ -1,3 +1,5 @@ +#ifndef HEADER_CURL_RUSTLS_H +#define HEADER_CURL_RUSTLS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | @@ -5,8 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) Jacob Hoffman-Andrews, - * + * Copyright (C) Jacob Hoffman-Andrews, * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -22,9 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ -#ifndef HEADER_CURL_RUSTLS_H -#define HEADER_CURL_RUSTLS_H - #include "../curl_setup.h" #ifdef USE_RUSTLS diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 2575a9f8f9..891dfc4e73 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -23,12 +23,10 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for all Schannel-specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. */ - #include "../curl_setup.h" #ifdef USE_SCHANNEL diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index e3525a1105..5129b8b04d 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -23,12 +23,10 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for Schannel-specific certificate verification. This code should * only be invoked by code in schannel.c. */ - #include "../curl_setup.h" #ifdef USE_SCHANNEL diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index b5b517f0b6..112681ae57 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -32,24 +32,22 @@ struct Curl_cfilter; struct Curl_easy; struct dynbuf; -#define SSLSUPP_CA_PATH (1<<0) /* supports CAPATH */ -#define SSLSUPP_CERTINFO (1<<1) /* supports CURLOPT_CERTINFO */ -#define SSLSUPP_PINNEDPUBKEY (1<<2) /* supports CURLOPT_PINNEDPUBLICKEY */ -#define SSLSUPP_SSL_CTX (1<<3) /* supports CURLOPT_SSL_CTX */ -#define SSLSUPP_HTTPS_PROXY (1<<4) /* supports access via HTTPS proxies */ -#define SSLSUPP_TLS13_CIPHERSUITES (1<<5) /* supports TLS 1.3 ciphersuites */ -#define SSLSUPP_CAINFO_BLOB (1<<6) -#define SSLSUPP_ECH (1<<7) -#define SSLSUPP_CA_CACHE (1<<8) -#define SSLSUPP_CIPHER_LIST (1<<9) /* supports TLS 1.0-1.2 ciphersuites */ -#define SSLSUPP_SIGNATURE_ALGORITHMS (1<<10) /* supports TLS sigalgs */ +#define SSLSUPP_CA_PATH (1 << 0) /* supports CAPATH */ +#define SSLSUPP_CERTINFO (1 << 1) /* supports CURLOPT_CERTINFO */ +#define SSLSUPP_PINNEDPUBKEY (1 << 2) /* supports CURLOPT_PINNEDPUBLICKEY */ +#define SSLSUPP_SSL_CTX (1 << 3) /* supports CURLOPT_SSL_CTX */ +#define SSLSUPP_HTTPS_PROXY (1 << 4) /* supports access via HTTPS proxies */ +#define SSLSUPP_TLS13_CIPHERSUITES (1 << 5) /* supports TLS 1.3 ciphersuites */ +#define SSLSUPP_CAINFO_BLOB (1 << 6) +#define SSLSUPP_ECH (1 << 7) +#define SSLSUPP_CA_CACHE (1 << 8) +#define SSLSUPP_CIPHER_LIST (1 << 9) /* supports TLS 1.0-1.2 ciphersuites */ +#define SSLSUPP_SIGNATURE_ALGORITHMS (1 << 10) /* supports TLS sigalgs */ #ifdef USE_ECH # include "../curlx/base64.h" # define ECH_ENABLED(__data__) \ - (__data__->set.tls_ech && \ - !(__data__->set.tls_ech & CURLECH_DISABLE)\ - ) + (__data__->set.tls_ech && !(__data__->set.tls_ech & CURLECH_DISABLE)) #endif /* USE_ECH */ #define ALPN_ACCEPTED "ALPN: server accepted " @@ -96,7 +94,7 @@ CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name, const curl_ssl_backend ***avail); #ifndef MAX_PINNED_PUBKEY_SIZE -#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1MB */ +#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1 MiB */ #endif curl_sslbackend Curl_ssl_backend(void); diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index ea4ea4e68e..df04ec7e00 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #ifdef USE_SSL diff --git a/lib/vtls/vtls_scache.h b/lib/vtls/vtls_scache.h index 67049462a8..2a99e779e5 100644 --- a/lib/vtls/vtls_scache.h +++ b/lib/vtls/vtls_scache.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "../curl_setup.h" + #include "../cfilters.h" #include "../urldata.h" diff --git a/lib/vtls/vtls_spack.c b/lib/vtls/vtls_spack.c index ac289f1b2f..9eeb808bde 100644 --- a/lib/vtls/vtls_spack.c +++ b/lib/vtls/vtls_spack.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_SSL) && defined(USE_SSLS_EXPORT) diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 3ccd0917a4..510378886d 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -21,13 +21,11 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * Source file for all wolfSSL specific code for the TLS/SSL layer. No code * but vtls.c should ever call or use these functions. * */ - #include "../curl_setup.h" #ifdef USE_WOLFSSL @@ -1712,7 +1710,7 @@ static CURLcode wssl_handshake(struct Curl_cfilter *cf, struct Curl_easy *data) wolfSSL_FreeArrays(wssl->ssl); } } -#endif /* OPENSSL_EXTRA */ +#endif /* OPENSSL_EXTRA */ detail = wolfSSL_get_error(wssl->ssl, ret); CURL_TRC_CF(data, cf, "wolfSSL_connect() -> %d, detail=%d", ret, detail); diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index e23331e9d6..e6fdb10d65 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \ @@ -1260,5 +1259,5 @@ done: #endif /* WANT_EXTRACT_CERTINFO */ -#endif /* USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL or USE_MBEDTLS or +#endif /* USE_GNUTLS || USE_WOLFSSL || USE_SCHANNEL || USE_MBEDTLS || USE_RUSTLS */ diff --git a/lib/vtls/x509asn1.h b/lib/vtls/x509asn1.h index 51ea0c2cd6..ba2c3893a9 100644 --- a/lib/vtls/x509asn1.h +++ b/lib/vtls/x509asn1.h @@ -24,7 +24,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "../curl_setup.h" #if defined(USE_GNUTLS) || defined(USE_WOLFSSL) || defined(USE_SCHANNEL) || \ @@ -87,9 +86,9 @@ CURLcode Curl_x509_GTime2str(struct dynbuf *store, /* used by unit1657.c */ CURLcode Curl_x509_getASN1Element(struct Curl_asn1Element *elem, const char *beg, const char *end); -#endif -#endif +#endif /* USE_GNUTLS || USE_SCHANNEL || USE_MBEDTLS || RUSTLS */ +#endif /* UNITTESTS */ -#endif /* USE_GNUTLS or USE_WOLFSSL or USE_SCHANNEL or USE_MBEDTLS or +#endif /* USE_GNUTLS || USE_WOLFSSL || USE_SCHANNEL || USE_MBEDTLS || USE_RUSTLS */ #endif /* HEADER_CURL_X509ASN1_H */ diff --git a/scripts/managen b/scripts/managen index a537e38432..88a50acc26 100755 --- a/scripts/managen +++ b/scripts/managen @@ -1088,6 +1088,7 @@ sub listhelp { * ***************************************************************************/ #include "tool_setup.h" + #include "tool_help.h" /* diff --git a/src/curlinfo.c b/src/curlinfo.c index 8716b72437..9e6030d553 100644 --- a/src/curlinfo.c +++ b/src/curlinfo.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - /* * The purpose of this tool is to figure out which, if any, features that are * disabled which should otherwise exist and work. These are not visible in @@ -30,13 +29,14 @@ * Disabled protocols are visible in curl_version_info() and are not included * in this table. */ - #include "curl_setup.h" + #include "multihandle.h" /* for ENABLE_WAKEUP */ #include "tool_xattr.h" /* for USE_XATTR */ #include "curl_sha512_256.h" /* for CURL_HAVE_SHA512_256 */ #include "asyn.h" /* for CURLRES_ARES */ #include "fake_addrinfo.h" /* for USE_FAKE_GETADDRINFO */ + #include static const char *disabled[] = { diff --git a/src/slist_wc.c b/src/slist_wc.c index 8a3ff254cc..f34cbd4861 100644 --- a/src/slist_wc.c +++ b/src/slist_wc.c @@ -21,7 +21,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "tool_setup.h" #ifndef CURL_DISABLE_LIBCURL_OPTION diff --git a/src/slist_wc.h b/src/slist_wc.h index dd7b8c10a7..7bf76257a4 100644 --- a/src/slist_wc.h +++ b/src/slist_wc.h @@ -23,8 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "tool_setup.h" + #ifndef CURL_DISABLE_LIBCURL_OPTION /* linked-list structure with last node cache for easysrc */ diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 6b442dd1c9..89243ef254 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -23,8 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "tool_setup.h" + #include "tool_sdecls.h" #include "tool_urlglob.h" #include "var.h" diff --git a/src/tool_easysrc.h b/src/tool_easysrc.h index 44d40b727a..f9ddacfc37 100644 --- a/src/tool_easysrc.h +++ b/src/tool_easysrc.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #ifndef CURL_DISABLE_LIBCURL_OPTION /* global variable declarations, for easy-interface source code generation */ diff --git a/src/tool_ipfs.h b/src/tool_ipfs.h index 31d8019fa2..caa959b607 100644 --- a/src/tool_ipfs.h +++ b/src/tool_ipfs.h @@ -27,9 +27,8 @@ #ifndef CURL_DISABLE_IPFS #define MAX_GATEWAY_URL_LEN 10000 - CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, struct OperationConfig *config); +#endif #endif /* HEADER_CURL_TOOL_IPFS_H */ -#endif /* !CURL_DISABLE_IPFS */ diff --git a/src/tool_listhelp.c b/src/tool_listhelp.c index 48a32214b8..9a8a7d94a7 100644 --- a/src/tool_listhelp.c +++ b/src/tool_listhelp.c @@ -22,6 +22,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_help.h" /* diff --git a/src/tool_msgs.h b/src/tool_msgs.h index be75d95593..eb201929f6 100644 --- a/src/tool_msgs.h +++ b/src/tool_msgs.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_cfgable.h" void warnf(const char *fmt, ...) CURL_PRINTF(1, 2); diff --git a/src/tool_operate.h b/src/tool_operate.h index 19cb8b5248..8c30d3b651 100644 --- a/src/tool_operate.h +++ b/src/tool_operate.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_cb_hdr.h" #include "tool_cb_prg.h" #include "tool_sdecls.h" diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index c46f3e3eef..4ad8f84c21 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -22,8 +22,8 @@ * ***************************************************************************/ #include "tool_setup.h" -#include "tool_operate.h" +#include "tool_operate.h" #include "tool_cfgable.h" #include "tool_doswin.h" #include "tool_operhlp.h" diff --git a/src/tool_progress.c b/src/tool_progress.c index f7ffe558f2..d2d932b000 100644 --- a/src/tool_progress.c +++ b/src/tool_progress.c @@ -22,6 +22,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_operate.h" #include "tool_progress.h" diff --git a/src/tool_setup.h b/src/tool_setup.h index 1699e5f34f..a0d9d2baf5 100644 --- a/src/tool_setup.h +++ b/src/tool_setup.h @@ -103,7 +103,7 @@ int tool_ftruncate64(int fd, curl_off_t where); #define HAVE_FTRUNCATE 1 #define USE_TOOL_FTRUNCATE 1 -#endif /* ! HAVE_FTRUNCATE */ +#endif /* !HAVE_FTRUNCATE */ #endif /* _WIN32 */ #endif /* HEADER_CURL_TOOL_SETUP_H */ diff --git a/src/tool_stderr.c b/src/tool_stderr.c index 7871ebc0cc..8ac6726dab 100644 --- a/src/tool_stderr.c +++ b/src/tool_stderr.c @@ -21,8 +21,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "tool_setup.h" + #include "tool_stderr.h" #include "tool_msgs.h" diff --git a/src/tool_stderr.h b/src/tool_stderr.h index 94c5085792..47fc7ca1ca 100644 --- a/src/tool_stderr.h +++ b/src/tool_stderr.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_cfgable.h" void tool_init_stderr(void); diff --git a/src/tool_writeout.h b/src/tool_writeout.h index 70b3cd148b..4025eaeef6 100644 --- a/src/tool_writeout.h +++ b/src/tool_writeout.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_operate.h" typedef enum { diff --git a/src/tool_writeout_json.h b/src/tool_writeout_json.h index 48c330dfaa..7318367c17 100644 --- a/src/tool_writeout_json.h +++ b/src/tool_writeout_json.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_writeout.h" int jsonquoted(const char *in, size_t len, struct dynbuf *out, bool lowercase); diff --git a/src/tool_xattr.c b/src/tool_xattr.c index b111c7b843..cdf8296307 100644 --- a/src/tool_xattr.c +++ b/src/tool_xattr.c @@ -22,6 +22,7 @@ * ***************************************************************************/ #include "tool_setup.h" + #include "tool_xattr.h" #ifdef USE_XATTR diff --git a/src/var.h b/src/var.h index 40defea8ac..bb191ce09e 100644 --- a/src/var.h +++ b/src/var.h @@ -23,7 +23,6 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ - #include "tool_getparam.h" struct tool_var { diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index 74c7ec4fa9..e33f87c993 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -2652,7 +2652,7 @@ sub PORT_ftp { sendcontrol "500 silly you, go away\r\n"; return; } - $port = ($5<<8)+$6; + $port = ($5 << 8) + $6; $addr = "$1.$2.$3.$4"; } # EPRT |2|::1|49706| diff --git a/tests/libtest/lib1308.c b/tests/libtest/lib1308.c index c794559428..aaddbf04ed 100644 --- a/tests/libtest/lib1308.c +++ b/tests/libtest/lib1308.c @@ -26,7 +26,7 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len) { fwrite(buf, len, 1, stdout); - (*(size_t *)arg) += len; + *((size_t *)arg) += len; return len; } diff --git a/tests/libtest/lib1901.c b/tests/libtest/lib1901.c index ba88719b0a..80d06080de 100644 --- a/tests/libtest/lib1901.c +++ b/tests/libtest/lib1901.c @@ -33,7 +33,6 @@ static size_t t1901_read_cb(char *ptr, size_t size, size_t nmemb, void *stream) NULL }; static int ix = 0; - (void)nmemb; (void)stream; if(chunks[ix]) { size_t len = strlen(chunks[ix]); diff --git a/tests/libtest/testutil.h b/tests/libtest/testutil.h index 3dcd7e3417..e66dbdc1c1 100644 --- a/tests/libtest/testutil.h +++ b/tests/libtest/testutil.h @@ -36,4 +36,4 @@ char *tutil_suburl(const char *base, int i); void tutil_rlim2str(char *buf, size_t len, rlim_t val); #endif -#endif /* HEADER_CURL_LIBTEST_TESTUTIL_H */ +#endif /* HEADER_CURL_LIBTEST_TESTUTIL_H */ diff --git a/tests/unit/unit1658.c b/tests/unit/unit1658.c index db97c48aed..d879ea5b79 100644 --- a/tests/unit/unit1658.c +++ b/tests/unit/unit1658.c @@ -541,7 +541,7 @@ static CURLcode test_unit1658(const char *arg) UNITTEST_END(curl_global_cleanup()) } -#else /* CURL_DISABLE_DOH or not HTTPSRR enabled */ +#else /* CURL_DISABLE_DOH || !USE_HTTPSRR */ static CURLcode test_unit1658(const char *arg) { -- 2.43.0