diff --git a/CMake/CurlTests.c b/CMake/CurlTests.c index a06c7701f5..425fb4bb78 100644 --- a/CMake/CurlTests.c +++ b/CMake/CurlTests.c @@ -27,7 +27,7 @@ #include #include #include -/* */ + #if defined(sun) || defined(__sun__) || \ defined(__SUNPRO_C) || defined(__SUNPRO_CC) # if defined(__SVR4) || defined(__srv4__) @@ -39,7 +39,7 @@ #if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41) # define PLATFORM_AIX_V3 #endif -/* */ + #if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3) #error "O_NONBLOCK does not work on this platform" #endif diff --git a/CMakeLists.txt b/CMakeLists.txt index cb294a8036..b13ba6248c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2335,8 +2335,7 @@ if(NOT CURL_DISABLE_INSTALL) FILES_MATCHING PATTERN "*.h") include(CMakePackageConfigHelpers) - write_basic_package_version_file( - "${_version_config}" + write_basic_package_version_file("${_version_config}" VERSION ${_curl_version} COMPATIBILITY SameMajorVersion) file(READ "${_version_config}" _generated_version_config) diff --git a/docs/DEPRECATE.md b/docs/DEPRECATE.md index 79569f86f3..a040842baf 100644 --- a/docs/DEPRECATE.md +++ b/docs/DEPRECATE.md @@ -34,7 +34,7 @@ We remove support for CMake <3.18 in April 2026. CMake 3.18 was released on 2020-07-15. -## TLS SRP Authentication +## TLS-SRP Authentication Transport Layer Security Secure Remote Password is a TLS feature that does not work with TLS 1.3 or QUIC and is virtually unused by curl users and in diff --git a/docs/examples/chkspeed.c b/docs/examples/chkspeed.c index f69215da4b..869d9f95c4 100644 --- a/docs/examples/chkspeed.c +++ b/docs/examples/chkspeed.c @@ -172,7 +172,7 @@ int main(int argc, const char *argv[]) /* specify URL to get */ curl_easy_setopt(curl, CURLOPT_URL, url); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* some servers do not like requests that are made without a user-agent diff --git a/docs/examples/externalsocket.c b/docs/examples/externalsocket.c index 959fbf7f11..b35f7aad63 100644 --- a/docs/examples/externalsocket.c +++ b/docs/examples/externalsocket.c @@ -100,7 +100,7 @@ int main(void) { CURL *curl; CURLcode result; - struct sockaddr_in servaddr; /* socket address structure */ + struct sockaddr_in servaddr; /* socket address structure */ curl_socket_t sockfd; result = curl_global_init(CURL_GLOBAL_ALL); @@ -141,7 +141,7 @@ int main(void) /* no progress meter please */ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* call this function to get a socket */ diff --git a/docs/examples/getinmemory.c b/docs/examples/getinmemory.c index 1743b203f5..899704bc5c 100644 --- a/docs/examples/getinmemory.c +++ b/docs/examples/getinmemory.c @@ -78,7 +78,7 @@ int main(void) /* specify URL to get */ curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* we pass our 'chunk' struct to the callback function */ diff --git a/docs/examples/htmltidy.c b/docs/examples/htmltidy.c index c73e5385e9..2e2def59c3 100644 --- a/docs/examples/htmltidy.c +++ b/docs/examples/htmltidy.c @@ -35,7 +35,7 @@ #include -/* curl write callback, to fill tidy's input buffer... */ +/* curl write callback, to fill tidy's input buffer... */ static uint write_cb(char *in, uint size, uint nmemb, TidyBuffer *out) { uint r; diff --git a/docs/examples/http2-pushinmemory.c b/docs/examples/http2-pushinmemory.c index e99fe746d0..f52309561f 100644 --- a/docs/examples/http2-pushinmemory.c +++ b/docs/examples/http2-pushinmemory.c @@ -77,7 +77,7 @@ static void setup(CURL *curl) curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); - /* write data to a struct */ + /* write data to a struct */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); init_memory(&files[0]); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &files[0]); diff --git a/docs/examples/imap-search.c b/docs/examples/imap-search.c index f06f6a551d..ae944bb9ec 100644 --- a/docs/examples/imap-search.c +++ b/docs/examples/imap-search.c @@ -56,7 +56,7 @@ int main(void) * this can contain a message sequence set and a number of search criteria * keywords including flags such as ANSWERED, DELETED, DRAFT, FLAGGED, NEW, * RECENT and SEEN. For more information about the search criteria please - * see RFC-3501 section 6.4.4. */ + * see RFC-3501 section 6.4.4. */ curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "SEARCH NEW"); /* Perform the custom request */ diff --git a/docs/examples/maxconnects.c b/docs/examples/maxconnects.c index 3c6f3c8b3d..7ef29828ea 100644 --- a/docs/examples/maxconnects.c +++ b/docs/examples/maxconnects.c @@ -47,7 +47,7 @@ int main(void) }; int i = 0; - /* Change the maximum number of persistent connection */ + /* Change the maximum number of persistent connection */ curl_easy_setopt(curl, CURLOPT_MAXCONNECTS, 1L); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); diff --git a/docs/examples/postinmemory.c b/docs/examples/postinmemory.c index 5b3251f506..16fabb8d22 100644 --- a/docs/examples/postinmemory.c +++ b/docs/examples/postinmemory.c @@ -74,7 +74,7 @@ int main(void) if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.org/"); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* we pass our 'chunk' struct to the callback function */ diff --git a/docs/examples/sepheaders.c b/docs/examples/sepheaders.c index e300205223..a315766d90 100644 --- a/docs/examples/sepheaders.c +++ b/docs/examples/sepheaders.c @@ -64,7 +64,7 @@ int main(void) /* no progress meter please */ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* open the header file */ diff --git a/docs/examples/smtp-expn.c b/docs/examples/smtp-expn.c index 42a7480625..25b560f3ec 100644 --- a/docs/examples/smtp-expn.c +++ b/docs/examples/smtp-expn.c @@ -53,7 +53,7 @@ int main(void) /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); - /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ + /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ recipients = curl_slist_append(recipients, "Friends"); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); diff --git a/docs/examples/smtp-vrfy.c b/docs/examples/smtp-vrfy.c index b60dfef25e..65783d6903 100644 --- a/docs/examples/smtp-vrfy.c +++ b/docs/examples/smtp-vrfy.c @@ -56,7 +56,7 @@ int main(void) /* This is the URL for your mailserver */ curl_easy_setopt(curl, CURLOPT_URL, "smtp://mail.example.com"); - /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ + /* Note that the CURLOPT_MAIL_RCPT takes a list, not a char array */ recipients = curl_slist_append(recipients, ""); curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients); diff --git a/docs/examples/url2file.c b/docs/examples/url2file.c index 9ff0dd4fca..d871083073 100644 --- a/docs/examples/url2file.c +++ b/docs/examples/url2file.c @@ -74,7 +74,7 @@ int main(int argc, const char *argv[]) /* disable progress meter, set to 0L to enable it */ curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L); - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_cb); /* open the file */ diff --git a/docs/examples/version-check.pl b/docs/examples/version-check.pl index bc065770bc..e6ad784fc8 100755 --- a/docs/examples/version-check.pl +++ b/docs/examples/version-check.pl @@ -58,7 +58,6 @@ while() { $rem{$sym}=$a[2]; } } - } close(S); diff --git a/docs/libcurl/curl_mime_data.md b/docs/libcurl/curl_mime_data.md index 9af7a91d8a..a03f6b555b 100644 --- a/docs/libcurl/curl_mime_data.md +++ b/docs/libcurl/curl_mime_data.md @@ -68,7 +68,7 @@ int main(void) /* add a part */ part = curl_mime_addpart(mime); - /* add data to the part */ + /* add data to the part */ curl_mime_data(part, "raw contents to send", CURL_ZERO_TERMINATED); } } diff --git a/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md b/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md index d86210b3e2..c8f59321ca 100644 --- a/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md +++ b/docs/libcurl/opts/CURLOPT_PROGRESSDATA.md @@ -63,7 +63,7 @@ int main(void) if(curl) { struct progress data; - /* pass struct to callback */ + /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &data); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); diff --git a/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md b/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md index 5334edbe22..47718002da 100644 --- a/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_PROGRESSFUNCTION.md @@ -109,7 +109,7 @@ int main(void) CURL *curl = curl_easy_init(); if(curl) { - /* pass struct to callback */ + /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &data); curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, progress_callback); diff --git a/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md b/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md index 8ff3d95c58..89dd79ebc9 100644 --- a/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md +++ b/docs/libcurl/opts/CURLOPT_TLSAUTH_PASSWORD.md @@ -41,7 +41,7 @@ option. Using this option multiple times makes the last set string override the previous ones. Set it to NULL to disable its use again. -This feature relies on TLS SRP which does not work with TLS 1.3. +This feature relies on TLS-SRP which does not work with TLS 1.3. # DEFAULT diff --git a/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md b/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md index 078c41c253..35ae6bf467 100644 --- a/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md +++ b/docs/libcurl/opts/CURLOPT_TLSAUTH_TYPE.md @@ -45,7 +45,7 @@ defined in RFC 5054 and provides mutual authentication if both sides have a shared secret. To use TLS-SRP, you must also set the CURLOPT_TLSAUTH_USERNAME(3) and CURLOPT_TLSAUTH_PASSWORD(3) options. -TLS SRP does not work with TLS 1.3. +TLS-SRP does not work with TLS 1.3. # DEFAULT diff --git a/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md b/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md index 654d858f83..b1d352e80e 100644 --- a/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md +++ b/docs/libcurl/opts/CURLOPT_TLSAUTH_USERNAME.md @@ -40,7 +40,7 @@ option. Using this option multiple times makes the last set string override the previous ones. Set it to NULL to disable its use again. -This feature relies on TLS SRP which does not work with TLS 1.3. +This feature relies on TLS-SRP which does not work with TLS 1.3. # DEFAULT diff --git a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md index 8cc97a6e40..407484debb 100644 --- a/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_WRITEFUNCTION.md @@ -110,7 +110,7 @@ int main(void) CURLcode result; CURL *curl = curl_easy_init(); if(curl) { - /* send all data to this function */ + /* send all data to this function */ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cb); /* we pass our 'chunk' struct to the callback function */ diff --git a/docs/libcurl/opts/CURLOPT_XFERINFODATA.md b/docs/libcurl/opts/CURLOPT_XFERINFODATA.md index 3cc0ddd1ca..5099e0a469 100644 --- a/docs/libcurl/opts/CURLOPT_XFERINFODATA.md +++ b/docs/libcurl/opts/CURLOPT_XFERINFODATA.md @@ -65,7 +65,7 @@ int main(void) if(curl) { struct progress data; - /* pass struct to callback */ + /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data); curl_easy_setopt(curl, CURLOPT_XFERINFOFUNCTION, progress_cb); } diff --git a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md index 67f48afcb2..161be8fd4b 100644 --- a/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_XFERINFOFUNCTION.md @@ -105,7 +105,7 @@ int main(void) if(curl) { struct progress data; - /* pass struct to callback */ + /* pass struct to callback */ curl_easy_setopt(curl, CURLOPT_XFERINFODATA, &data); /* enable progress callback getting called */ diff --git a/docs/libcurl/symbols.pl b/docs/libcurl/symbols.pl index d20554ab93..4126fe54e1 100755 --- a/docs/libcurl/symbols.pl +++ b/docs/libcurl/symbols.pl @@ -100,6 +100,5 @@ EOS EOS ; } - } } diff --git a/include/curl/curl.h b/include/curl/curl.h index 99b517adb3..632333d799 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -59,7 +59,7 @@ #define CURL_IGNORE_DEPRECATION(statements) statements #endif -#include "curlver.h" /* libcurl version defines */ +#include "curlver.h" /* libcurl version defines */ #include "system.h" /* determine things runtime */ #include @@ -1358,7 +1358,7 @@ typedef enum { /* Set the krb4/5 security level, this also enables krb4/5 awareness. This * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string - * is set but does not match one of these, 'private' will be used. */ + * is set but does not match one of these, 'private' will be used. */ CURLOPTDEPRECATED(CURLOPT_KRBLEVEL, CURLOPTTYPE_STRINGPOINT, 63, 8.17.0, "removed"), @@ -2203,7 +2203,7 @@ typedef enum { CURLOPT(CURLOPT_SSH_HOST_PUBLIC_KEY_SHA256, CURLOPTTYPE_STRINGPOINT, 311), /* Function that will be called immediately before the initial request - is made on a connection (after any protocol negotiation step). */ + is made on a connection (after any protocol negotiation step). */ CURLOPT(CURLOPT_PREREQFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 312), /* Data passed to the CURLOPT_PREREQFUNCTION callback */ @@ -2283,7 +2283,6 @@ typedef enum { #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL -/* */ #define CURLOPT_FTP_RESPONSE_TIMEOUT CURLOPT_SERVER_RESPONSE_TIMEOUT /* Added in 8.2.0 */ @@ -3310,7 +3309,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle, #endif /* unfortunately, the easy.h and multi.h include files need options and info - stuff before they can be included! */ + stuff before they can be included! */ #include "easy.h" /* nothing in curl is fun without the easy stuff */ #include "multi.h" #include "urlapi.h" @@ -3330,7 +3329,7 @@ CURL_EXTERN CURLcode curl_easy_ssls_export(CURL *handle, /* This preprocessor magic that replaces a call with the exact same call is only done to make sure application authors pass exactly three arguments to these functions. Use recursive macros to allow using these symbols via - the C++ global namespace '::' or reuse them as method names. */ + the C++ global namespace '::' or reusing them as method names. */ #define curl_easy_setopt(handle, opt, param) \ curl_easy_setopt(handle, opt, param) #define curl_easy_getinfo(handle, info, arg) \ diff --git a/include/curl/header.h b/include/curl/header.h index e7334b5a3a..85c10c8d78 100644 --- a/include/curl/header.h +++ b/include/curl/header.h @@ -31,7 +31,7 @@ extern "C" { struct curl_header { char *name; /* this might not use the same case */ char *value; - size_t amount; /* number of headers using this name */ + size_t amount; /* number of headers using this name */ size_t index; /* ... of this instance, 0 or higher */ unsigned int origin; /* see bits below */ void *anchor; /* handle privately used by libcurl */ diff --git a/include/curl/system.h b/include/curl/system.h index a5b3e9eba7..064833d6e1 100644 --- a/include/curl/system.h +++ b/include/curl/system.h @@ -367,20 +367,20 @@ #define CURL_PULL_SYS_POLL_H #endif -/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file */ -/* sys/types.h is required here to properly make type definitions below. */ +/* CURL_PULL_SYS_TYPES_H is defined above when inclusion of header file + sys/types.h is required here to properly make type definitions below. */ #ifdef CURL_PULL_SYS_TYPES_H # include #endif -/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file */ -/* sys/socket.h is required here to properly make type definitions below. */ +/* CURL_PULL_SYS_SOCKET_H is defined above when inclusion of header file + sys/socket.h is required here to properly make type definitions below. */ #ifdef CURL_PULL_SYS_SOCKET_H # include #endif -/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file */ -/* sys/poll.h is required here to properly make type definitions below. */ +/* CURL_PULL_SYS_POLL_H is defined above when inclusion of header file + sys/poll.h is required here to properly make type definitions below. */ #ifdef CURL_PULL_SYS_POLL_H # include #endif diff --git a/include/curl/typecheck-gcc.h b/include/curl/typecheck-gcc.h index 7e6ef5baf4..3ac3182c50 100644 --- a/include/curl/typecheck-gcc.h +++ b/include/curl/typecheck-gcc.h @@ -43,186 +43,186 @@ #define curl_easy_setopt(handle, option, value) \ __extension__({ \ - if(__builtin_constant_p(option)) { \ - CURL_IGNORE_DEPRECATION( \ - if(curlcheck_long_option(option)) \ - if(!curlcheck_long(value)) \ - Wcurl_easy_setopt_err_long(); \ - if(curlcheck_off_t_option(option)) \ - if(!curlcheck_off_t(value)) \ - Wcurl_easy_setopt_err_curl_off_t(); \ - if(curlcheck_string_option(option)) \ - if(!curlcheck_string(value)) \ - Wcurl_easy_setopt_err_string(); \ - if((option) == CURLOPT_PRIVATE) { } \ - if(curlcheck_write_cb_option(option)) \ - if(!curlcheck_write_cb(value)) \ - Wcurl_easy_setopt_err_write_callback(); \ - if(curlcheck_curl_option(option)) \ - if(!curlcheck_curl(value)) \ - Wcurl_easy_setopt_err_curl(); \ - if((option) == CURLOPT_RESOLVER_START_FUNCTION) \ - if(!curlcheck_resolver_start_callback(value)) \ - Wcurl_easy_setopt_err_resolver_start_callback(); \ - if((option) == CURLOPT_READFUNCTION) \ - if(!curlcheck_read_cb(value)) \ - Wcurl_easy_setopt_err_read_cb(); \ - if((option) == CURLOPT_IOCTLFUNCTION) \ - if(!curlcheck_ioctl_cb(value)) \ - Wcurl_easy_setopt_err_ioctl_cb(); \ - if((option) == CURLOPT_SOCKOPTFUNCTION) \ - if(!curlcheck_sockopt_cb(value)) \ - Wcurl_easy_setopt_err_sockopt_cb(); \ - if((option) == CURLOPT_OPENSOCKETFUNCTION) \ - if(!curlcheck_opensocket_cb(value)) \ - Wcurl_easy_setopt_err_opensocket_cb(); \ - if((option) == CURLOPT_PROGRESSFUNCTION) \ - if(!curlcheck_progress_cb(value)) \ - Wcurl_easy_setopt_err_progress_cb(); \ - if((option) == CURLOPT_XFERINFOFUNCTION) \ - if(!curlcheck_xferinfo_cb(value)) \ - Wcurl_easy_setopt_err_xferinfo_cb(); \ - if((option) == CURLOPT_DEBUGFUNCTION) \ - if(!curlcheck_debug_cb(value)) \ - Wcurl_easy_setopt_err_debug_cb(); \ - if((option) == CURLOPT_SSL_CTX_FUNCTION) \ - if(!curlcheck_ssl_ctx_cb(value)) \ - Wcurl_easy_setopt_err_ssl_ctx_cb(); \ - if(curlcheck_conv_cb_option(option)) \ - if(!curlcheck_conv_cb(value)) \ - Wcurl_easy_setopt_err_conv_cb(); \ - if((option) == CURLOPT_SEEKFUNCTION) \ - if(!curlcheck_seek_cb(value)) \ - Wcurl_easy_setopt_err_seek_cb(); \ - if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \ - if(!curlcheck_chunk_bgn_cb(value)) \ - Wcurl_easy_setopt_err_chunk_bgn_cb(); \ - if((option) == CURLOPT_CHUNK_END_FUNCTION) \ - if(!curlcheck_chunk_end_cb(value)) \ - Wcurl_easy_setopt_err_chunk_end_cb(); \ - if((option) == CURLOPT_CLOSESOCKETFUNCTION) \ - if(!curlcheck_close_socket_cb(value)) \ - Wcurl_easy_setopt_err_close_socket_cb(); \ - if((option) == CURLOPT_FNMATCH_FUNCTION) \ - if(!curlcheck_fnmatch_cb(value)) \ - Wcurl_easy_setopt_err_fnmatch_cb(); \ - if((option) == CURLOPT_HSTSREADFUNCTION) \ - if(!curlcheck_hstsread_cb(value)) \ - Wcurl_easy_setopt_err_hstsread_cb(); \ - if((option) == CURLOPT_HSTSWRITEFUNCTION) \ - if(!curlcheck_hstswrite_cb(value)) \ - Wcurl_easy_setopt_err_hstswrite_cb(); \ - if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \ - if(!curlcheck_ssh_hostkey_cb(value)) \ - Wcurl_easy_setopt_err_ssh_hostkey_cb(); \ - if((option) == CURLOPT_SSH_KEYFUNCTION) \ - if(!curlcheck_ssh_key_cb(value)) \ - Wcurl_easy_setopt_err_ssh_key_cb(); \ - if((option) == CURLOPT_INTERLEAVEFUNCTION) \ - if(!curlcheck_interleave_cb(value)) \ - Wcurl_easy_setopt_err_interleave_cb(); \ - if((option) == CURLOPT_PREREQFUNCTION) \ - if(!curlcheck_prereq_cb(value)) \ - Wcurl_easy_setopt_err_prereq_cb(); \ - if((option) == CURLOPT_TRAILERFUNCTION) \ - if(!curlcheck_trailer_cb(value)) \ - Wcurl_easy_setopt_err_trailer_cb(); \ - if(curlcheck_cb_data_option(option)) \ - if(!curlcheck_cb_data(value)) \ - Wcurl_easy_setopt_err_cb_data(); \ - if((option) == CURLOPT_ERRORBUFFER) \ - if(!curlcheck_error_buffer(value)) \ - Wcurl_easy_setopt_err_error_buffer(); \ - if((option) == CURLOPT_CURLU) \ - if(!curlcheck_ptr((value), CURLU)) \ - Wcurl_easy_setopt_err_curlu(); \ - if((option) == CURLOPT_STDERR) \ - if(!curlcheck_FILE(value)) \ - Wcurl_easy_setopt_err_FILE(); \ - if(curlcheck_postfields_option(option)) \ - if(!curlcheck_postfields(value)) \ - Wcurl_easy_setopt_err_postfields(); \ - if((option) == CURLOPT_HTTPPOST) \ - if(!curlcheck_arr((value), struct curl_httppost)) \ - Wcurl_easy_setopt_err_curl_httpost(); \ - if((option) == CURLOPT_MIMEPOST) \ - if(!curlcheck_ptr((value), curl_mime)) \ - Wcurl_easy_setopt_err_curl_mimepost(); \ - if(curlcheck_slist_option(option)) \ - if(!curlcheck_arr((value), struct curl_slist)) \ - Wcurl_easy_setopt_err_curl_slist(); \ - if((option) == CURLOPT_SHARE) \ - if(!curlcheck_ptr((value), CURLSH)) \ - Wcurl_easy_setopt_err_CURLSH(); \ - ) \ - } \ - (curl_easy_setopt)(handle, option, value); \ - }) + if(__builtin_constant_p(option)) { \ + CURL_IGNORE_DEPRECATION( \ + if(curlcheck_long_option(option)) \ + if(!curlcheck_long(value)) \ + Wcurl_easy_setopt_err_long(); \ + if(curlcheck_off_t_option(option)) \ + if(!curlcheck_off_t(value)) \ + Wcurl_easy_setopt_err_curl_off_t(); \ + if(curlcheck_string_option(option)) \ + if(!curlcheck_string(value)) \ + Wcurl_easy_setopt_err_string(); \ + if((option) == CURLOPT_PRIVATE) { } \ + if(curlcheck_write_cb_option(option)) \ + if(!curlcheck_write_cb(value)) \ + Wcurl_easy_setopt_err_write_callback(); \ + if(curlcheck_curl_option(option)) \ + if(!curlcheck_curl(value)) \ + Wcurl_easy_setopt_err_curl(); \ + if((option) == CURLOPT_RESOLVER_START_FUNCTION) \ + if(!curlcheck_resolver_start_callback(value)) \ + Wcurl_easy_setopt_err_resolver_start_callback(); \ + if((option) == CURLOPT_READFUNCTION) \ + if(!curlcheck_read_cb(value)) \ + Wcurl_easy_setopt_err_read_cb(); \ + if((option) == CURLOPT_IOCTLFUNCTION) \ + if(!curlcheck_ioctl_cb(value)) \ + Wcurl_easy_setopt_err_ioctl_cb(); \ + if((option) == CURLOPT_SOCKOPTFUNCTION) \ + if(!curlcheck_sockopt_cb(value)) \ + Wcurl_easy_setopt_err_sockopt_cb(); \ + if((option) == CURLOPT_OPENSOCKETFUNCTION) \ + if(!curlcheck_opensocket_cb(value)) \ + Wcurl_easy_setopt_err_opensocket_cb(); \ + if((option) == CURLOPT_PROGRESSFUNCTION) \ + if(!curlcheck_progress_cb(value)) \ + Wcurl_easy_setopt_err_progress_cb(); \ + if((option) == CURLOPT_XFERINFOFUNCTION) \ + if(!curlcheck_xferinfo_cb(value)) \ + Wcurl_easy_setopt_err_xferinfo_cb(); \ + if((option) == CURLOPT_DEBUGFUNCTION) \ + if(!curlcheck_debug_cb(value)) \ + Wcurl_easy_setopt_err_debug_cb(); \ + if((option) == CURLOPT_SSL_CTX_FUNCTION) \ + if(!curlcheck_ssl_ctx_cb(value)) \ + Wcurl_easy_setopt_err_ssl_ctx_cb(); \ + if(curlcheck_conv_cb_option(option)) \ + if(!curlcheck_conv_cb(value)) \ + Wcurl_easy_setopt_err_conv_cb(); \ + if((option) == CURLOPT_SEEKFUNCTION) \ + if(!curlcheck_seek_cb(value)) \ + Wcurl_easy_setopt_err_seek_cb(); \ + if((option) == CURLOPT_CHUNK_BGN_FUNCTION) \ + if(!curlcheck_chunk_bgn_cb(value)) \ + Wcurl_easy_setopt_err_chunk_bgn_cb(); \ + if((option) == CURLOPT_CHUNK_END_FUNCTION) \ + if(!curlcheck_chunk_end_cb(value)) \ + Wcurl_easy_setopt_err_chunk_end_cb(); \ + if((option) == CURLOPT_CLOSESOCKETFUNCTION) \ + if(!curlcheck_close_socket_cb(value)) \ + Wcurl_easy_setopt_err_close_socket_cb(); \ + if((option) == CURLOPT_FNMATCH_FUNCTION) \ + if(!curlcheck_fnmatch_cb(value)) \ + Wcurl_easy_setopt_err_fnmatch_cb(); \ + if((option) == CURLOPT_HSTSREADFUNCTION) \ + if(!curlcheck_hstsread_cb(value)) \ + Wcurl_easy_setopt_err_hstsread_cb(); \ + if((option) == CURLOPT_HSTSWRITEFUNCTION) \ + if(!curlcheck_hstswrite_cb(value)) \ + Wcurl_easy_setopt_err_hstswrite_cb(); \ + if((option) == CURLOPT_SSH_HOSTKEYFUNCTION) \ + if(!curlcheck_ssh_hostkey_cb(value)) \ + Wcurl_easy_setopt_err_ssh_hostkey_cb(); \ + if((option) == CURLOPT_SSH_KEYFUNCTION) \ + if(!curlcheck_ssh_key_cb(value)) \ + Wcurl_easy_setopt_err_ssh_key_cb(); \ + if((option) == CURLOPT_INTERLEAVEFUNCTION) \ + if(!curlcheck_interleave_cb(value)) \ + Wcurl_easy_setopt_err_interleave_cb(); \ + if((option) == CURLOPT_PREREQFUNCTION) \ + if(!curlcheck_prereq_cb(value)) \ + Wcurl_easy_setopt_err_prereq_cb(); \ + if((option) == CURLOPT_TRAILERFUNCTION) \ + if(!curlcheck_trailer_cb(value)) \ + Wcurl_easy_setopt_err_trailer_cb(); \ + if(curlcheck_cb_data_option(option)) \ + if(!curlcheck_cb_data(value)) \ + Wcurl_easy_setopt_err_cb_data(); \ + if((option) == CURLOPT_ERRORBUFFER) \ + if(!curlcheck_error_buffer(value)) \ + Wcurl_easy_setopt_err_error_buffer(); \ + if((option) == CURLOPT_CURLU) \ + if(!curlcheck_ptr((value), CURLU)) \ + Wcurl_easy_setopt_err_curlu(); \ + if((option) == CURLOPT_STDERR) \ + if(!curlcheck_FILE(value)) \ + Wcurl_easy_setopt_err_FILE(); \ + if(curlcheck_postfields_option(option)) \ + if(!curlcheck_postfields(value)) \ + Wcurl_easy_setopt_err_postfields(); \ + if((option) == CURLOPT_HTTPPOST) \ + if(!curlcheck_arr((value), struct curl_httppost)) \ + Wcurl_easy_setopt_err_curl_httpost(); \ + if((option) == CURLOPT_MIMEPOST) \ + if(!curlcheck_ptr((value), curl_mime)) \ + Wcurl_easy_setopt_err_curl_mimepost(); \ + if(curlcheck_slist_option(option)) \ + if(!curlcheck_arr((value), struct curl_slist)) \ + Wcurl_easy_setopt_err_curl_slist(); \ + if((option) == CURLOPT_SHARE) \ + if(!curlcheck_ptr((value), CURLSH)) \ + Wcurl_easy_setopt_err_CURLSH(); \ + ) \ + } \ + (curl_easy_setopt)(handle, option, value); \ + }) /* wraps curl_easy_getinfo() with type checking */ #define curl_easy_getinfo(handle, info, arg) \ __extension__({ \ - if(__builtin_constant_p(info)) { \ - CURL_IGNORE_DEPRECATION( \ - if(curlcheck_string_info(info)) \ - if(!curlcheck_arr((arg), char *)) \ - Wcurl_easy_getinfo_err_string(); \ - if(curlcheck_long_info(info)) \ - if(!curlcheck_arr((arg), long)) \ - Wcurl_easy_getinfo_err_long(); \ - if(curlcheck_double_info(info)) \ - if(!curlcheck_arr((arg), double)) \ - Wcurl_easy_getinfo_err_double(); \ - if(curlcheck_slist_info(info)) \ - if(!curlcheck_arr((arg), struct curl_slist *)) \ - Wcurl_easy_getinfo_err_curl_slist(); \ - if(curlcheck_tlssessioninfo_info(info)) \ - if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \ - Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \ - if(curlcheck_certinfo_info(info)) \ - if(!curlcheck_arr((arg), struct curl_certinfo *)) \ - Wcurl_easy_getinfo_err_curl_certinfo(); \ - if(curlcheck_socket_info(info)) \ - if(!curlcheck_arr((arg), curl_socket_t)) \ - Wcurl_easy_getinfo_err_curl_socket(); \ - if(curlcheck_off_t_info(info)) \ - if(!curlcheck_arr((arg), curl_off_t)) \ - Wcurl_easy_getinfo_err_curl_off_t(); \ - ) \ - } \ - (curl_easy_getinfo)(handle, info, arg); \ - }) + if(__builtin_constant_p(info)) { \ + CURL_IGNORE_DEPRECATION( \ + if(curlcheck_string_info(info)) \ + if(!curlcheck_arr((arg), char *)) \ + Wcurl_easy_getinfo_err_string(); \ + if(curlcheck_long_info(info)) \ + if(!curlcheck_arr((arg), long)) \ + Wcurl_easy_getinfo_err_long(); \ + if(curlcheck_double_info(info)) \ + if(!curlcheck_arr((arg), double)) \ + Wcurl_easy_getinfo_err_double(); \ + if(curlcheck_slist_info(info)) \ + if(!curlcheck_arr((arg), struct curl_slist *)) \ + Wcurl_easy_getinfo_err_curl_slist(); \ + if(curlcheck_tlssessioninfo_info(info)) \ + if(!curlcheck_arr((arg), struct curl_tlssessioninfo *)) \ + Wcurl_easy_getinfo_err_curl_tlssessioninfo(); \ + if(curlcheck_certinfo_info(info)) \ + if(!curlcheck_arr((arg), struct curl_certinfo *)) \ + Wcurl_easy_getinfo_err_curl_certinfo(); \ + if(curlcheck_socket_info(info)) \ + if(!curlcheck_arr((arg), curl_socket_t)) \ + Wcurl_easy_getinfo_err_curl_socket(); \ + if(curlcheck_off_t_info(info)) \ + if(!curlcheck_arr((arg), curl_off_t)) \ + Wcurl_easy_getinfo_err_curl_off_t(); \ + ) \ + } \ + (curl_easy_getinfo)(handle, info, arg); \ + }) #define curl_multi_setopt(handle, option, value) \ __extension__({ \ - if(__builtin_constant_p(option)) { \ - if(curlcheck_long_option(option)) \ - if(!curlcheck_long(value)) \ - Wcurl_multi_setopt_err_long(); \ - if(curlcheck_off_t_option(option)) \ - if(!curlcheck_off_t(value)) \ - Wcurl_multi_setopt_err_curl_off_t(); \ - if(curlcheck_multicb_data_option(option)) \ - if(!curlcheck_cb_data(value)) \ - Wcurl_multi_setopt_err_cb_data(); \ - if(curlcheck_charpp_option(option)) \ - if(!curlcheck_ptrptr(value, char)) \ - Wcurl_multi_setopt_err_charpp(); \ - if((option) == CURLMOPT_NOTIFYFUNCTION) \ - if(!curlcheck_multinotify_cb(value)) \ - Wcurl_multi_setopt_err_notifycb(); \ - if((option) == CURLMOPT_PUSHFUNCTION) \ - if(!curlcheck_multipush_cb(value)) \ - Wcurl_multi_setopt_err_pushcb(); \ - if((option) == CURLMOPT_SOCKETFUNCTION) \ - if(!curlcheck_multisocket_cb(value)) \ - Wcurl_multi_setopt_err_socketcb(); \ - if((option) == CURLMOPT_TIMERFUNCTION) \ - if(!curlcheck_multitimer_cb(value)) \ - Wcurl_multi_setopt_err_timercb(); \ - } \ - (curl_multi_setopt)(handle, option, value); \ - }) + if(__builtin_constant_p(option)) { \ + if(curlcheck_long_option(option)) \ + if(!curlcheck_long(value)) \ + Wcurl_multi_setopt_err_long(); \ + if(curlcheck_off_t_option(option)) \ + if(!curlcheck_off_t(value)) \ + Wcurl_multi_setopt_err_curl_off_t(); \ + if(curlcheck_multicb_data_option(option)) \ + if(!curlcheck_cb_data(value)) \ + Wcurl_multi_setopt_err_cb_data(); \ + if(curlcheck_charpp_option(option)) \ + if(!curlcheck_ptrptr(value, char)) \ + Wcurl_multi_setopt_err_charpp(); \ + if((option) == CURLMOPT_NOTIFYFUNCTION) \ + if(!curlcheck_multinotify_cb(value)) \ + Wcurl_multi_setopt_err_notifycb(); \ + if((option) == CURLMOPT_PUSHFUNCTION) \ + if(!curlcheck_multipush_cb(value)) \ + Wcurl_multi_setopt_err_pushcb(); \ + if((option) == CURLMOPT_SOCKETFUNCTION) \ + if(!curlcheck_multisocket_cb(value)) \ + Wcurl_multi_setopt_err_socketcb(); \ + if((option) == CURLMOPT_TIMERFUNCTION) \ + if(!curlcheck_multitimer_cb(value)) \ + Wcurl_multi_setopt_err_timercb(); \ + } \ + (curl_multi_setopt)(handle, option, value); \ + }) /* evaluates to true if the option takes a data argument to pass to a callback */ @@ -512,82 +512,84 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) /* evaluates to true if option takes a data argument to pass to a callback */ -#define curlcheck_cb_data_option(option) \ - ((option) == CURLOPT_CHUNK_DATA || \ - (option) == CURLOPT_CLOSESOCKETDATA || \ - (option) == CURLOPT_DEBUGDATA || \ - (option) == CURLOPT_FNMATCH_DATA || \ - (option) == CURLOPT_HEADERDATA || \ - (option) == CURLOPT_HSTSREADDATA || \ - (option) == CURLOPT_HSTSWRITEDATA || \ - (option) == CURLOPT_INTERLEAVEDATA || \ - (option) == CURLOPT_IOCTLDATA || \ - (option) == CURLOPT_OPENSOCKETDATA || \ - (option) == CURLOPT_PREREQDATA || \ - (option) == CURLOPT_XFERINFODATA || \ - (option) == CURLOPT_READDATA || \ - (option) == CURLOPT_SEEKDATA || \ - (option) == CURLOPT_SOCKOPTDATA || \ - (option) == CURLOPT_SSH_KEYDATA || \ - (option) == CURLOPT_SSL_CTX_DATA || \ - (option) == CURLOPT_WRITEDATA || \ - (option) == CURLOPT_RESOLVER_START_DATA || \ - (option) == CURLOPT_TRAILERDATA || \ - (option) == CURLOPT_SSH_HOSTKEYDATA || \ +#define curlcheck_cb_data_option(option) \ + ((option) == CURLOPT_CHUNK_DATA || \ + (option) == CURLOPT_CLOSESOCKETDATA || \ + (option) == CURLOPT_DEBUGDATA || \ + (option) == CURLOPT_FNMATCH_DATA || \ + (option) == CURLOPT_HEADERDATA || \ + (option) == CURLOPT_HSTSREADDATA || \ + (option) == CURLOPT_HSTSWRITEDATA || \ + (option) == CURLOPT_INTERLEAVEDATA || \ + (option) == CURLOPT_IOCTLDATA || \ + (option) == CURLOPT_OPENSOCKETDATA || \ + (option) == CURLOPT_PREREQDATA || \ + (option) == CURLOPT_XFERINFODATA || \ + (option) == CURLOPT_READDATA || \ + (option) == CURLOPT_SEEKDATA || \ + (option) == CURLOPT_SOCKOPTDATA || \ + (option) == CURLOPT_SSH_KEYDATA || \ + (option) == CURLOPT_SSL_CTX_DATA || \ + (option) == CURLOPT_WRITEDATA || \ + (option) == CURLOPT_RESOLVER_START_DATA || \ + (option) == CURLOPT_TRAILERDATA || \ + (option) == CURLOPT_SSH_HOSTKEYDATA || \ 0) /* evaluates to true if option takes a POST data argument (void* or char*) */ -#define curlcheck_postfields_option(option) \ - ((option) == CURLOPT_POSTFIELDS || \ - (option) == CURLOPT_COPYPOSTFIELDS || \ +#define curlcheck_postfields_option(option) \ + ((option) == CURLOPT_POSTFIELDS || \ + (option) == CURLOPT_COPYPOSTFIELDS || \ 0) /* evaluates to true if option takes a struct curl_slist * argument */ -#define curlcheck_slist_option(option) \ - ((option) == CURLOPT_HTTP200ALIASES || \ - (option) == CURLOPT_HTTPHEADER || \ - (option) == CURLOPT_MAIL_RCPT || \ - (option) == CURLOPT_POSTQUOTE || \ - (option) == CURLOPT_PREQUOTE || \ - (option) == CURLOPT_PROXYHEADER || \ - (option) == CURLOPT_QUOTE || \ - (option) == CURLOPT_RESOLVE || \ - (option) == CURLOPT_TELNETOPTIONS || \ - (option) == CURLOPT_CONNECT_TO || \ +#define curlcheck_slist_option(option) \ + ((option) == CURLOPT_HTTP200ALIASES || \ + (option) == CURLOPT_HTTPHEADER || \ + (option) == CURLOPT_MAIL_RCPT || \ + (option) == CURLOPT_POSTQUOTE || \ + (option) == CURLOPT_PREQUOTE || \ + (option) == CURLOPT_PROXYHEADER || \ + (option) == CURLOPT_QUOTE || \ + (option) == CURLOPT_RESOLVE || \ + (option) == CURLOPT_TELNETOPTIONS || \ + (option) == CURLOPT_CONNECT_TO || \ 0) /* groups of curl_easy_getinfo infos that take the same type of argument */ /* evaluates to true if info expects a pointer to char * argument */ -#define curlcheck_string_info(info) \ - (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \ +#define curlcheck_string_info(info) \ + (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG && \ (info) != CURLINFO_PRIVATE) /* evaluates to true if info expects a pointer to long argument */ -#define curlcheck_long_info(info) \ +#define curlcheck_long_info(info) \ (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) /* evaluates to true if info expects a pointer to double argument */ -#define curlcheck_double_info(info) \ +#define curlcheck_double_info(info) \ (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) /* true if info expects a pointer to struct curl_slist * argument */ #define curlcheck_slist_info(info) \ - (((info) == CURLINFO_SSL_ENGINES) || ((info) == CURLINFO_COOKIELIST)) + (((info) == CURLINFO_SSL_ENGINES) || \ + ((info) == CURLINFO_COOKIELIST)) /* true if info expects a pointer to struct curl_tlssessioninfo * argument */ -#define curlcheck_tlssessioninfo_info(info) \ - (((info) == CURLINFO_TLS_SSL_PTR) || ((info) == CURLINFO_TLS_SESSION)) +#define curlcheck_tlssessioninfo_info(info) \ + (((info) == CURLINFO_TLS_SSL_PTR) || \ + ((info) == CURLINFO_TLS_SESSION)) /* true if info expects a pointer to struct curl_certinfo * argument */ #define curlcheck_certinfo_info(info) ((info) == CURLINFO_CERTINFO) /* true if info expects a pointer to struct curl_socket_t argument */ -#define curlcheck_socket_info(info) \ +#define curlcheck_socket_info(info) \ (CURLINFO_SOCKET < (info) && (info) < CURLINFO_OFF_T) /* true if info expects a pointer to curl_off_t argument */ -#define curlcheck_off_t_info(info) \ +#define curlcheck_off_t_info(info) \ (CURLINFO_OFF_T < (info)) /* @@ -604,7 +606,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, */ /* XXX: should evaluate to true if expr is a pointer */ -#define curlcheck_any_ptr(expr) \ +#define curlcheck_any_ptr(expr) \ (sizeof(expr) == sizeof(void *)) /* evaluates to true if expr is NULL */ @@ -668,7 +670,7 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, ) /* evaluates to true if expr is of type curl_off_t */ -#define curlcheck_off_t(expr) \ +#define curlcheck_off_t(expr) \ (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ @@ -706,8 +708,8 @@ CURLWARNING(Wcurl_easy_getinfo_err_curl_off_t, __builtin_types_compatible_p(__typeof__(func) *, type)) /* evaluates to true if expr is of type curl_resolver_start_callback */ -#define curlcheck_resolver_start_callback(expr) \ - (curlcheck_NULL(expr) || \ +#define curlcheck_resolver_start_callback(expr) \ + (curlcheck_NULL(expr) || \ curlcheck_cb_compatible((expr), curl_resolver_start_callback)) /* evaluates to true if expr is of type curl_read_callback or "similar" */ @@ -741,11 +743,11 @@ typedef size_t (*Wcurl_read_callback6)(void *, size_t, size_t, FILE *); curlcheck_cb_compatible((expr), Wcurl_write_callback6)) typedef size_t (*Wcurl_write_callback1)(const char *, size_t, size_t, void *); typedef size_t (*Wcurl_write_callback2)(const char *, size_t, size_t, - const void *); + const void *); typedef size_t (*Wcurl_write_callback3)(const char *, size_t, size_t, FILE *); typedef size_t (*Wcurl_write_callback4)(const void *, size_t, size_t, void *); typedef size_t (*Wcurl_write_callback5)(const void *, size_t, size_t, - const void *); + const void *); typedef size_t (*Wcurl_write_callback6)(const void *, size_t, size_t, FILE *); /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ @@ -769,7 +771,7 @@ typedef curlioerr (*Wcurl_ioctl_callback4)(CURL *, curliocmd, const void *); curlcheck_cb_compatible((expr), Wcurl_sockopt_callback2)) typedef int (*Wcurl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); typedef int (*Wcurl_sockopt_callback2)(const void *, curl_socket_t, - curlsocktype); + curlsocktype); /* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ @@ -817,21 +819,21 @@ typedef int (*Wcurl_progress_callback2)(const void *, curlcheck_cb_compatible((expr), Wcurl_debug_callback6) || \ curlcheck_cb_compatible((expr), Wcurl_debug_callback7) || \ curlcheck_cb_compatible((expr), Wcurl_debug_callback8)) -typedef int (*Wcurl_debug_callback1) (CURL *, +typedef int (*Wcurl_debug_callback1)(CURL *, curl_infotype, char *, size_t, void *); -typedef int (*Wcurl_debug_callback2) (CURL *, +typedef int (*Wcurl_debug_callback2)(CURL *, curl_infotype, char *, size_t, const void *); -typedef int (*Wcurl_debug_callback3) (CURL *, +typedef int (*Wcurl_debug_callback3)(CURL *, curl_infotype, const char *, size_t, void *); -typedef int (*Wcurl_debug_callback4) (CURL *, +typedef int (*Wcurl_debug_callback4)(CURL *, curl_infotype, const char *, size_t, const void *); -typedef int (*Wcurl_debug_callback5) (CURL *, +typedef int (*Wcurl_debug_callback5)(CURL *, curl_infotype, unsigned char *, size_t, void *); -typedef int (*Wcurl_debug_callback6) (CURL *, +typedef int (*Wcurl_debug_callback6)(CURL *, curl_infotype, unsigned char *, size_t, const void *); -typedef int (*Wcurl_debug_callback7) (CURL *, +typedef int (*Wcurl_debug_callback7)(CURL *, curl_infotype, const unsigned char *, size_t, void *); -typedef int (*Wcurl_debug_callback8) (CURL *, +typedef int (*Wcurl_debug_callback8)(CURL *, curl_infotype, const unsigned char *, size_t, const void *); /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ diff --git a/lib/altsvc.c b/lib/altsvc.c index 3d3de12700..78d2a5083a 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -229,7 +229,6 @@ static CURLcode altsvc_load(struct altsvcinfo *asi, const char *file) /* * Write this single altsvc entry to a single output line */ - static CURLcode altsvc_out(struct altsvc *as, FILE *fp) { struct tm stamp; diff --git a/lib/asyn-ares.c b/lib/asyn-ares.c index a9e697ff60..2d710f56da 100644 --- a/lib/asyn-ares.c +++ b/lib/asyn-ares.c @@ -600,8 +600,8 @@ async_ares_node2addr(struct ares_addrinfo_node *node) for(ai = node; ai != NULL; ai = ai->ai_next) { size_t ss_size; struct Curl_addrinfo *ca; - /* ignore elements with unsupported address family, */ - /* settle family-specific sockaddr structure size. */ + /* ignore elements with unsupported address family, + settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); #ifdef USE_IPV6 @@ -625,8 +625,8 @@ async_ares_node2addr(struct ares_addrinfo_node *node) break; } - /* copy each structure member individually, member ordering, */ - /* size, or padding might be different for each platform. */ + /* copy each structure member individually, member ordering, + size, or padding might be different for each platform. */ ca->ai_flags = ai->ai_flags; ca->ai_family = ai->ai_family; diff --git a/lib/cfilters.h b/lib/cfilters.h index e3ce9577f9..c7546344af 100644 --- a/lib/cfilters.h +++ b/lib/cfilters.h @@ -117,7 +117,7 @@ typedef CURLcode Curl_cft_conn_keep_alive(struct Curl_cfilter *cf, */ /* data event arg1 arg2 return */ #define CF_CTRL_DATA_SETUP 4 /* 0 NULL first fail */ -/* unused now 5 */ +/* unused now 5 */ #define CF_CTRL_DATA_PAUSE 6 /* on/off NULL first fail */ #define CF_CTRL_DATA_DONE 7 /* premature NULL ignored */ #define CF_CTRL_DATA_DONE_SEND 8 /* 0 NULL ignored */ @@ -170,7 +170,7 @@ typedef CURLcode Curl_cft_cntrl(struct Curl_cfilter *cf, #define CF_QUERY_STREAM_ERROR 6 /* error code - */ #define CF_QUERY_NEED_FLUSH 7 /* TRUE/FALSE - */ #define CF_QUERY_IP_INFO 8 /* TRUE/FALSE struct ip_quadruple */ -#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */ +#define CF_QUERY_HTTP_VERSION 9 /* number (10/11/20/30) - */ /* pass in a `const struct Curl_sockaddr_ex **` as `pres2`. Gets set * to NULL when not connected. */ #define CF_QUERY_REMOTE_ADDR 10 /* - `Curl_sockaddr_ex *` */ diff --git a/lib/config-win32.h b/lib/config-win32.h index 25409d02f3..dd93c04579 100644 --- a/lib/config-win32.h +++ b/lib/config-win32.h @@ -284,7 +284,6 @@ /* ---------------------------------------------------------------- */ #ifndef CURL_WINDOWS_UWP -#undef HAVE_LDAP_URL_PARSE #define HAVE_LDAP_SSL 1 #define USE_WIN32_LDAP 1 #endif diff --git a/lib/connect.c b/lib/connect.c index 4b363ebe31..78c9370804 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -61,7 +61,7 @@ #include "multiif.h" #include "curlx/inet_ntop.h" #include "curlx/strparse.h" -#include "vtls/vtls.h" /* for vtsl cfilters */ +#include "vtls/vtls.h" /* for vtls cfilters */ #include "progress.h" #include "conncache.h" #include "multihandle.h" diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 63540c168d..43d398d119 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -115,8 +115,8 @@ int Curl_getaddrinfo_ex(const char *nodename, for(ai = aihead; ai != NULL; ai = ai->ai_next) { size_t namelen = ai->ai_canonname ? strlen(ai->ai_canonname) + 1 : 0; - /* ignore elements with unsupported address family, */ - /* settle family-specific sockaddr structure size. */ + /* ignore elements with unsupported address family, + settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); #ifdef USE_IPV6 @@ -140,8 +140,8 @@ int Curl_getaddrinfo_ex(const char *nodename, break; } - /* copy each structure member individually, member ordering, */ - /* size, or padding might be different for each platform. */ + /* copy each structure member individually, member ordering, + size, or padding might be different for each platform. */ ca->ai_flags = ai->ai_flags; ca->ai_family = ai->ai_family; diff --git a/lib/curl_config-cmake.h.in b/lib/curl_config-cmake.h.in index 8742ad64af..1dcab9d897 100644 --- a/lib/curl_config-cmake.h.in +++ b/lib/curl_config-cmake.h.in @@ -725,13 +725,13 @@ ${SIZEOF_TIME_T_CODE} automatically */ #cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1 -/* to enable NGHTTP2 */ +/* to enable NGHTTP2 */ #cmakedefine USE_NGHTTP2 1 /* to enable NGTCP2 */ #cmakedefine USE_NGTCP2 1 -/* to enable NGHTTP3 */ +/* to enable NGHTTP3 */ #cmakedefine USE_NGHTTP3 1 /* to enable quiche */ @@ -743,13 +743,13 @@ ${SIZEOF_TIME_T_CODE} /* Define to 1 if you have the quiche_conn_set_qlog_fd function. */ #cmakedefine HAVE_QUICHE_CONN_SET_QLOG_FD 1 -/* if Unix domain sockets are enabled */ +/* if Unix domain sockets are enabled */ #cmakedefine USE_UNIX_SOCKETS 1 /* to enable SSPI support */ #cmakedefine USE_WINDOWS_SSPI 1 -/* to enable Windows SSL */ +/* to enable Windows SSL */ #cmakedefine USE_SCHANNEL 1 /* if Watt-32 is in use */ diff --git a/lib/curl_printf.h b/lib/curl_printf.h index 207ba7125d..3b1a5af3b4 100644 --- a/lib/curl_printf.h +++ b/lib/curl_printf.h @@ -28,10 +28,10 @@ #define MERR_MEM 1 #define MERR_TOO_LARGE 2 -/* Lower-case digits. */ +/* Lower-case digits. */ extern const unsigned char Curl_ldigits[]; -/* Upper-case digits. */ +/* Upper-case digits. */ extern const unsigned char Curl_udigits[]; #endif /* HEADER_CURL_PRINTF_H */ diff --git a/lib/curl_sasl.h b/lib/curl_sasl.h index 5e03bf3565..8a97f52adc 100644 --- a/lib/curl_sasl.h +++ b/lib/curl_sasl.h @@ -147,11 +147,11 @@ void Curl_sasl_init(struct SASL *sasl, struct Curl_easy *data, /* Check if we have enough auth data and capabilities to authenticate */ bool Curl_sasl_can_authenticate(struct SASL *sasl, struct Curl_easy *data); -/* Calculate the required login details for SASL authentication */ +/* Calculate the required login details for SASL authentication */ CURLcode Curl_sasl_start(struct SASL *sasl, struct Curl_easy *data, bool force_ir, saslprogress *progress); -/* Continue an SASL authentication */ +/* Continue an SASL authentication */ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, int code, saslprogress *progress); diff --git a/lib/curlx/timeval.c b/lib/curlx/timeval.c index ae67e9bb42..03eb80341c 100644 --- a/lib/curlx/timeval.c +++ b/lib/curlx/timeval.c @@ -194,7 +194,6 @@ timediff_t curlx_ptimediff_ms(const struct curltime *newer, return (diff * 1000) + ((newer->tv_usec - older->tv_usec) / 1000); } - timediff_t curlx_timediff_ms(struct curltime newer, struct curltime older) { return curlx_ptimediff_ms(&newer, &older); diff --git a/lib/escape.h b/lib/escape.h index 2ea06c444f..9f9a89e402 100644 --- a/lib/escape.h +++ b/lib/escape.h @@ -24,7 +24,7 @@ * ***************************************************************************/ /* Escape and unescape URL encoding in strings. The functions return a new - * allocated string or NULL if an error occurred. */ + * allocated string or NULL if an error occurred. */ enum urlreject { REJECT_NADA = 2, diff --git a/lib/fake_addrinfo.c b/lib/fake_addrinfo.c index bf5a44892c..d8b139830b 100644 --- a/lib/fake_addrinfo.c +++ b/lib/fake_addrinfo.c @@ -67,8 +67,8 @@ static struct addrinfo *mk_getaddrinfo(const struct ares_addrinfo *aihead) for(ai = aihead->nodes; ai != NULL; ai = ai->ai_next) { size_t ss_size; size_t namelen = name ? strlen(name) + 1 : 0; - /* ignore elements with unsupported address family, */ - /* settle family-specific sockaddr structure size. */ + /* ignore elements with unsupported address family, + settle family-specific sockaddr structure size. */ if(ai->ai_family == AF_INET) ss_size = sizeof(struct sockaddr_in); else if(ai->ai_family == AF_INET6) @@ -90,8 +90,8 @@ static struct addrinfo *mk_getaddrinfo(const struct ares_addrinfo *aihead) return NULL; } - /* copy each structure member individually, member ordering, */ - /* size, or padding might be different for each platform. */ + /* copy each structure member individually, member ordering, + size, or padding might be different for each platform. */ ca->ai_flags = ai->ai_flags; ca->ai_family = ai->ai_family; diff --git a/lib/ftp.c b/lib/ftp.c index fd10b07629..c234f35bac 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -637,7 +637,7 @@ static CURLcode getftpresponse(struct Curl_easy *data, * the OpenSSL read() does not grok that properly. * * Alas, read as much as possible, split up into lines, use the ending - * line in a response or continue reading. */ + * line in a response or continue reading. */ struct connectdata *conn = data->conn; curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; @@ -1801,7 +1801,7 @@ static CURLcode ftp_state_retr(struct Curl_easy *data, } else { /* We got a file size report, so we check that there actually is a - part of the file left to get, or else we go home. */ + part of the file left to get, or else we go home. */ if(data->state.resume_from < 0) { /* We are supposed to download the last abs(from) bytes */ if(filesize < -data->state.resume_from) { diff --git a/lib/http.c b/lib/http.c index 183a39966e..50b128c531 100644 --- a/lib/http.c +++ b/lib/http.c @@ -684,11 +684,12 @@ static CURLcode output_auth_headers(struct Curl_easy *data, /* Basic */ if( #ifndef CURL_DISABLE_PROXY - (proxy && conn->bits.proxy_user_passwd && - !Curl_checkProxyheaders(data, conn, STRCONST("Proxy-authorization"))) || + (proxy && conn->bits.proxy_user_passwd && + !Curl_checkProxyheaders(data, conn, + STRCONST("Proxy-authorization"))) || #endif - (!proxy && data->state.aptr.user && - !Curl_checkheaders(data, STRCONST("Authorization")))) { + (!proxy && data->state.aptr.user && + !Curl_checkheaders(data, STRCONST("Authorization")))) { auth = "Basic"; result = http_output_basic(data, proxy); if(result) @@ -703,8 +704,8 @@ static CURLcode output_auth_headers(struct Curl_easy *data, #ifndef CURL_DISABLE_BEARER_AUTH if(authstatus->picked == CURLAUTH_BEARER) { /* Bearer */ - if((!proxy && data->set.str[STRING_BEARER] && - !Curl_checkheaders(data, STRCONST("Authorization")))) { + if(!proxy && data->set.str[STRING_BEARER] && + !Curl_checkheaders(data, STRCONST("Authorization"))) { auth = "Bearer"; result = http_output_bearer(data); if(result) @@ -2625,7 +2626,6 @@ static CURLcode http_range(struct Curl_easy *data, data->state.aptr.rangeline = curl_maprintf("Content-Range: bytes 0-%" FMT_OFF_T "/" "%" FMT_OFF_T "\r\n", req_clen - 1, req_clen); - } else if(data->state.resume_from) { /* This is because "resume" was selected */ @@ -3776,7 +3776,7 @@ static CURLcode http_statusline(struct Curl_easy *data, /* (quote from RFC2616, section 10.3.5): The 304 response * MUST NOT contain a message-body, and thus is always * terminated by the first empty line after the header - * fields. */ + * fields. */ if(data->set.timecondition) data->info.timecond = TRUE; FALLTHROUGH(); @@ -4345,7 +4345,7 @@ void Curl_http_to_fold(struct dynbuf *bf) len--; if(len && (hd[len - 1] == '\r')) len--; - while(len && (ISBLANK(hd[len - 1]))) /* strip off trailing whitespace */ + while(len && ISBLANK(hd[len - 1])) /* strip off trailing whitespace */ len--; curlx_dyn_setlen(bf, len); } diff --git a/lib/http2.c b/lib/http2.c index fa160c1cf6..27f60b7656 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -65,7 +65,7 @@ #define H2_NW_RECV_CHUNKS (H2_CONN_WINDOW_SIZE / H2_CHUNK_SIZE) /* on send into TLS, we just want to accumulate small frames */ #define H2_NW_SEND_CHUNKS 1 -/* this is how much we want "in flight" for a stream, unthrottled */ +/* this is how much we want "in flight" for a stream, unthrottled */ #define H2_STREAM_WINDOW_SIZE_MAX (10 * 1024 * 1024) /* this is how much we want "in flight" for a stream, initially, IFF * nghttp2 allows us to tweak the local window size. */ @@ -888,7 +888,6 @@ static void h2_xfer_write_resp_hd(struct Curl_cfilter *cf, struct h2_stream_ctx *stream, const char *buf, size_t blen, bool eos) { - /* If we already encountered an error, skip further writes */ if(!stream->xfer_result) { stream->xfer_result = Curl_xfer_write_resp_hd(data, buf, blen, eos); @@ -905,7 +904,6 @@ static void h2_xfer_write_resp(struct Curl_cfilter *cf, struct h2_stream_ctx *stream, const char *buf, size_t blen, bool eos) { - /* If we already encountered an error, skip further writes */ if(!stream->xfer_result) stream->xfer_result = Curl_xfer_write_resp(data, buf, blen, eos); diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index 40edcf315c..492be1ab58 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -645,7 +645,6 @@ fail: static int compare_func(const void *a, const void *b) { - const struct pair *aa = a; const struct pair *bb = b; const size_t aa_key_len = curlx_dyn_len(&aa->key); diff --git a/lib/imap.c b/lib/imap.c index 06244b6dac..8aa0afb8d2 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -1176,7 +1176,7 @@ static CURLcode imap_state_login_resp(struct Curl_easy *data, return result; } -/* Detect IMAP listings vs. downloading a single email */ +/* Detect IMAP listings vs. downloading a single email */ static bool is_custom_fetch_listing_match(const char *params) { /* match " 1:* (FLAGS ..." or " 1,2,3 (FLAGS ..." */ @@ -2324,7 +2324,6 @@ static const struct Curl_protocol Curl_protocol_imap = { #endif /* CURL_DISABLE_IMAP */ - /* * IMAP protocol handler. */ diff --git a/lib/mprintf.c b/lib/mprintf.c index 6d267e18cd..d874efe81a 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -32,10 +32,10 @@ #define MAX_PARAMETERS 128 /* number of input arguments */ #define MAX_SEGMENTS 128 /* number of output segments */ -/* Lower-case digits. */ +/* Lower-case digits. */ const unsigned char Curl_ldigits[] = "0123456789abcdef"; -/* Upper-case digits. */ +/* Upper-case digits. */ const unsigned char Curl_udigits[] = "0123456789ABCDEF"; #define OUTCHAR(x) \ @@ -131,9 +131,9 @@ struct asprintf { }; /* the provided input number is 1-based but this returns the number 0-based. - - returns -1 if no valid number was provided. -*/ + * + * returns -1 if no valid number was provided. + */ static int dollarstring(const char *p, const char **end) { curl_off_t num; @@ -596,8 +596,8 @@ static int parsefmt(const char *format, } struct mproperty { - int width; /* Width of a field. */ - int prec; /* Precision of a field. */ + int width; /* Width of a field. */ + int prec; /* Precision of a field. */ unsigned int flags; }; @@ -722,7 +722,7 @@ static bool out_number(void *userp, char *w; if(flags & FLAGS_CHAR) { - /* Character. */ + /* Character. */ if(!(flags & FLAGS_LEFT)) while(--width > 0) OUTCHAR(' '); @@ -746,11 +746,11 @@ static bool out_number(void *userp, ; else { - /* Decimal integer. */ + /* Decimal integer. */ is_neg = (nums < 0); if(is_neg) { /* signed_num might fail to hold absolute negative minimum by 1 */ - int64_t signed_num; /* Used to convert negative in positive. */ + int64_t signed_num; /* Used to convert negative in positive. */ signed_num = nums + (int64_t)1; signed_num = -signed_num; num = (uint64_t)signed_num; @@ -758,11 +758,11 @@ static bool out_number(void *userp, } } - /* Supply a default precision if none was given. */ + /* Supply a default precision if none was given. */ if(prec == -1) prec = 1; - /* Put the number in WORK. */ + /* Put the number in WORK. */ w = workend; DEBUGASSERT(base <= 16); switch(base) { @@ -822,7 +822,7 @@ static bool out_number(void *userp, while(width-- > 0) OUTCHAR('0'); - /* Write the number. */ + /* Write the number. */ while(++w <= workend) { OUTCHAR(*w); } @@ -848,7 +848,7 @@ static bool out_string(void *userp, size_t len; if(!str) { - /* Write null string if there is space. */ + /* Write null string if there is space. */ if(prec == -1 || prec >= (int)sizeof(nilstr) - 1) { str = nilstr; len = sizeof(nilstr) - 1; @@ -895,17 +895,17 @@ static bool out_pointer(void *userp, char *work, int *donep) { - /* Generic pointer. */ + /* Generic pointer. */ if(ptr) { size_t num = (size_t)ptr; - /* If the pointer is not NULL, write it as a %#x spec. */ + /* If the pointer is not NULL, write it as a %#x spec. */ p->flags |= FLAGS_HEX | FLAGS_ALT; if(out_number(userp, stream, p, num, 0, work, donep)) return TRUE; } else { - /* Write "(nil)" for a nil pointer. */ + /* Write "(nil)" for a nil pointer. */ const char *point; int width = p->width; int flags = p->flags; @@ -946,7 +946,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the const char *format, /* %-formatted string */ va_list ap_save) /* list of parameters */ { - int done = 0; /* number of characters written */ + int done = 0; /* number of characters written */ int i; int ocount = 0; /* number of output segments */ int icount = 0; /* number of input arguments */ @@ -1042,7 +1042,7 @@ static int formatf(void *userp, /* untouched by format(), just sent to the break; case MTYPE_INTPTR: - /* Answer the count of characters written. */ + /* Answer the count of characters written. */ if(p.flags & FLAGS_LONGLONG) *(int64_t *)iptr->val.ptr = (int64_t)done; else diff --git a/lib/mqtt.c b/lib/mqtt.c index 446918cc44..ef373c0638 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -962,7 +962,6 @@ static CURLcode mqtts_connecting(struct Curl_easy *data, bool *done) /* * MQTTS protocol. */ - static const struct Curl_protocol Curl_protocol_mqtts = { mqtt_setup_conn, /* setup_connection */ mqtt_do, /* do_it */ @@ -988,7 +987,6 @@ static const struct Curl_protocol Curl_protocol_mqtts = { /* * MQTT protocol. */ - static const struct Curl_protocol Curl_protocol_mqtt = { mqtt_setup_conn, /* setup_connection */ mqtt_do, /* do_it */ @@ -1011,7 +1009,6 @@ static const struct Curl_protocol Curl_protocol_mqtt = { #endif /* CURL_DISABLE_MQTT */ - const struct Curl_scheme Curl_scheme_mqtts = { "mqtts", /* scheme */ #if defined(CURL_DISABLE_MQTT) || !defined(USE_SSL) @@ -1028,7 +1025,6 @@ const struct Curl_scheme Curl_scheme_mqtts = { /* * MQTT protocol. */ - const struct Curl_scheme Curl_scheme_mqtt = { "mqtt", /* scheme */ #ifdef CURL_DISABLE_MQTT diff --git a/lib/netrc.c b/lib/netrc.c index 031660c531..1073cc5365 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -151,7 +151,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, } if(!*tok || (*tok == '\n')) - /* end of line */ + /* end of line */ break; /* leading double-quote means quoted string */ diff --git a/lib/openldap.c b/lib/openldap.c index 83ae013593..8dd984132c 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -114,7 +114,6 @@ struct ldapreqinfo { /* meta key for storing ldapconninfo at connection */ #define CURL_META_LDAP_CONN "meta:proto:ldap:conn" - /* * oldap_state() * diff --git a/lib/select.h b/lib/select.h index 4069f78b52..ffcd44cfcf 100644 --- a/lib/select.h +++ b/lib/select.h @@ -169,14 +169,11 @@ CURLcode Curl_pollset_set(struct Curl_easy *data, #define Curl_pollset_remove_out(data, ps, sock) \ Curl_pollset_change(data, ps, sock, 0, CURL_POLL_OUT) #define Curl_pollset_add_inout(data, ps, sock) \ - Curl_pollset_change(data, ps, sock, \ - CURL_POLL_IN | CURL_POLL_OUT, 0) + Curl_pollset_change(data, ps, sock, CURL_POLL_IN | CURL_POLL_OUT, 0) #define Curl_pollset_set_in_only(data, ps, sock) \ - Curl_pollset_change(data, ps, sock, \ - CURL_POLL_IN, CURL_POLL_OUT) + Curl_pollset_change(data, ps, sock, CURL_POLL_IN, CURL_POLL_OUT) #define Curl_pollset_set_out_only(data, ps, sock) \ - Curl_pollset_change(data, ps, sock, \ - CURL_POLL_OUT, CURL_POLL_IN) + Curl_pollset_change(data, ps, sock, CURL_POLL_OUT, CURL_POLL_IN) /* return < = on error, 0 on timeout or how many sockets are ready */ int Curl_pollset_poll(struct Curl_easy *data, diff --git a/lib/sendf.h b/lib/sendf.h index 952ed4c123..75c6e248ea 100644 --- a/lib/sendf.h +++ b/lib/sendf.h @@ -55,7 +55,7 @@ struct Curl_cwriter; struct Curl_easy; /** - * Write `len` bytes at `prt` to the client. `type` indicates what + * Write `len` bytes at `buf` to the client. `type` indicates what * kind of data is being written. */ CURLcode Curl_client_write(struct Curl_easy *data, int type, const char *buf, diff --git a/lib/setup-vms.h b/lib/setup-vms.h index dd460223b9..331d5edcae 100644 --- a/lib/setup-vms.h +++ b/lib/setup-vms.h @@ -24,11 +24,10 @@ * ***************************************************************************/ -/* */ -/* JEM, 12/30/12, VMS now generates config.h, so only define wrappers for */ -/* getenv(), getpwuid() and provide is_vms_shell() */ -/* Also need upper case symbols for system services, and */ -/* OpenSSL, and some Kerberos image */ +/* JEM, 2012-12-30, VMS now generates config.h, so only define wrappers for */ +/* getenv(), getpwuid() and provide is_vms_shell() */ +/* Also need upper case symbols for system services, and */ +/* OpenSSL, and some Kerberos image */ #ifdef __DECC #pragma message save diff --git a/lib/sha256.c b/lib/sha256.c index e35aa30649..b438b2cc01 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -232,8 +232,8 @@ static void my_sha256_final(unsigned char *digest, void *in) (a)[3] = (unsigned char) (((unsigned long)(val)) & 0xff); \ } while(0) -#define WPA_PUT_BE64(a, val) \ - do { \ +#define WPA_PUT_BE64(a, val) \ + do { \ (a)[0] = (unsigned char)(((uint64_t)(val)) >> 56); \ (a)[1] = (unsigned char)(((uint64_t)(val)) >> 48); \ (a)[2] = (unsigned char)(((uint64_t)(val)) >> 40); \ diff --git a/lib/smb.c b/lib/smb.c index 8e76edc83d..41ba48fe89 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -1249,7 +1249,7 @@ const struct Curl_scheme Curl_scheme_smb = { */ const struct Curl_scheme Curl_scheme_smbs = { "smbs", /* scheme */ -#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \ +#if defined(CURL_DISABLE_SMB) || !defined(USE_CURL_NTLM_CORE) || \ !defined(USE_SSL) ZERO_NULL, #else diff --git a/lib/smtp.c b/lib/smtp.c index 93f1211ab0..7b0d242afb 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1061,9 +1061,9 @@ static CURLcode smtp_perform_mail(struct Curl_easy *data, "MAIL FROM:%s%s%s%s%s%s", from, /* Mandatory */ auth ? " AUTH=" : "", /* Optional on AUTH support */ - auth ? auth : "", /* */ + auth ? auth : "", size ? " SIZE=" : "", /* Optional on SIZE support */ - size ? size : "", /* */ + size ? size : "", utf8 ? " SMTPUTF8" /* Internationalised mailbox */ : ""); /* included in our envelope */ diff --git a/lib/socks.c b/lib/socks.c index 569d10945c..912e8c52f5 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -1339,7 +1339,6 @@ static CURLcode socks_cf_adjust_pollset(struct Curl_cfilter *cf, static void socks_proxy_cf_close(struct Curl_cfilter *cf, struct Curl_easy *data) { - DEBUGASSERT(cf->next); cf->connected = FALSE; socks_proxy_cf_free(cf); diff --git a/lib/socks_sspi.c b/lib/socks_sspi.c index 84a974db6a..cc0e043887 100644 --- a/lib/socks_sspi.c +++ b/lib/socks_sspi.c @@ -281,7 +281,7 @@ static CURLcode socks5_sspi_encrypt(struct Curl_cfilter *cf, infof(data, "SOCKS5 server supports GSS-API %s data protection.", (gss_enc == 0) ? "no" : - ((gss_enc == 1) ? "integrity" : "confidentiality") ); + ((gss_enc == 1) ? "integrity" : "confidentiality")); sspi_w_token[0].pvBuffer = sspi_w_token[1].pvBuffer = diff --git a/lib/system_win32.c b/lib/system_win32.c index 2f24fe5c0c..c951da9d99 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -45,7 +45,7 @@ CURLcode Curl_win32_init(long flags) if(res) /* Tell the user that we could not find a usable */ - /* winsock.dll. */ + /* winsock.dll. */ return CURLE_FAILED_INIT; /* Confirm that the Windows Sockets DLL supports what we need.*/ diff --git a/lib/url.c b/lib/url.c index 7e7408a5d7..0e594681ea 100644 --- a/lib/url.c +++ b/lib/url.c @@ -1844,7 +1844,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, #ifdef USE_IPV6 if(data->set.scope_id) - /* Override any scope that was set above. */ + /* Override any scope that was set above. */ conn->scope_id = data->set.scope_id; #endif @@ -2538,7 +2538,6 @@ error: static CURLcode parse_remote_port(struct Curl_easy *data, struct connectdata *conn) { - if(data->set.use_port && data->state.allow_port) { /* if set, we use this instead of the port possibly given in the URL */ char portbuf[16]; diff --git a/lib/urldata.h b/lib/urldata.h index 2ca2233c56..b437771517 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -217,7 +217,7 @@ typedef CURLcode (Curl_recv)(struct Curl_easy *data, /* transfer */ * us early warning on things only discovered by valgrind otherwise. */ #define GOOD_EASY_HANDLE(x) \ (((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) ? TRUE : \ - (DEBUGASSERT(!(x)), FALSE)) + (DEBUGASSERT(!(x)), FALSE)) #else #define GOOD_EASY_HANDLE(x) \ ((x) && ((x)->magic == CURLEASY_MAGIC_NUMBER)) @@ -1303,7 +1303,7 @@ struct UserDefined { curl_write_callback fwrite_header; /* function that stores headers */ curl_write_callback fwrite_rtp; /* function that stores interleaved RTP */ curl_read_callback fread_func_set; /* function that reads the input */ - curl_progress_callback fprogress; /* OLD and deprecated progress callback */ + curl_progress_callback fprogress; /* OLD and deprecated progress callback */ curl_xferinfo_callback fxferinfo; /* progress callback */ curl_debug_callback fdebug; /* function that write informational data */ curl_ioctl_callback ioctl_func; /* function for I/O control */ @@ -1373,7 +1373,7 @@ struct UserDefined { curl_off_t max_filesize; /* Maximum file size to download */ #ifndef CURL_DISABLE_FTP timediff_t accepttimeout; /* in milliseconds, 0 means no timeout */ - uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */ + uint8_t ftp_filemethod; /* how to get to a file: curl_ftpfile */ uint8_t ftpsslauth; /* what AUTH XXX to try: curl_ftpauth */ uint8_t ftp_ccc; /* FTP CCC options: curl_ftpccc */ #endif @@ -1443,7 +1443,7 @@ struct UserDefined { #endif uint32_t maxconnects; /* Max idle connections in the connection cache */ #ifdef USE_ECH - int tls_ech; /* TLS ECH configuration */ + int tls_ech; /* TLS ECH configuration */ #endif short maxredirs; /* maximum no. of http(s) redirects to follow, set to -1 for infinity */ @@ -1460,7 +1460,7 @@ struct UserDefined { uint16_t tftp_blksize; /* in bytes, 0 means use default */ #endif #ifndef CURL_DISABLE_NETRC - uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */ + uint8_t use_netrc; /* enum CURL_NETRC_OPTION values */ #endif #if !defined(CURL_DISABLE_FTP) || defined(USE_SSH) /* Despite the name, ftp_create_missing_dirs is for FTP(S) and SFTP @@ -1543,7 +1543,7 @@ struct UserDefined { BIT(opt_no_body); /* as set with CURLOPT_NOBODY */ BIT(verbose); /* output verbosity */ BIT(reuse_forbid); /* forbidden to be reused, close after use */ - BIT(reuse_fresh); /* do not reuse an existing connection */ + BIT(reuse_fresh); /* do not reuse an existing connection */ BIT(no_signal); /* do not use any signal/alarm handler */ BIT(tcp_nodelay); /* whether to enable TCP_NODELAY or not */ BIT(ignorecl); /* ignore content length */ diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index ad08f34a8f..53617773b5 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1227,7 +1227,7 @@ static int myssh_in_SFTP_CLOSE(struct Curl_easy *data, /* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT After nextstate is executed, the control should come back to - SSH_SFTP_CLOSE to pass the correct result back */ + SSH_SFTP_CLOSE to pass the correct result back */ if(sshc->nextstate != SSH_NO_STATE && sshc->nextstate != SSH_SFTP_CLOSE) { myssh_to(data, sshc, sshc->nextstate); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 61086d6f68..db52d1e703 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -2297,7 +2297,7 @@ static CURLcode ssh_state_sftp_close(struct Curl_easy *data, /* Check if nextstate is set and move .nextstate could be POSTQUOTE_INIT After nextstate is executed, the control should come back to - SSH_SFTP_CLOSE to pass the correct result back */ + SSH_SFTP_CLOSE to pass the correct result back */ if(sshc->nextstate != SSH_NO_STATE && sshc->nextstate != SSH_SFTP_CLOSE) { myssh_to(data, sshc, sshc->nextstate); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 014aadd17d..b5263d398b 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -5384,7 +5384,7 @@ static CURLcode ossl_random(struct Curl_easy *data, if(!rand_enough()) return CURLE_FAILED_INIT; } - /* RAND_bytes() returns 1 on success, 0 otherwise. */ + /* RAND_bytes() returns 1 on success, 0 otherwise. */ rc = RAND_bytes(entropy, (ossl_valsize_t)curlx_uztosi(length)); return rc == 1 ? CURLE_OK : CURLE_FAILED_INIT; } diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 5f0bdcc8ac..f9b475b122 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -416,7 +416,7 @@ static CURLcode get_client_cert(struct Curl_easy *data, } if(fInCert || blob) { - /* Reading a .P12 or .pfx file, like the example at bottom of + /* Reading a .p12 or .pfx file, like the example at bottom of https://learn.microsoft.com/archive/msdn-technet-forums/3e7bc95f-b21a-4bcd-bd2c-7f996718cae5 */ CRYPT_DATA_BLOB datablob; @@ -2030,8 +2030,8 @@ static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, timediff_t timeout_ms = Curl_timeleft_ms(data); if(timeout_ms < 0) { /* we already got the timeout */ - failf(data, "schannel: timed out sending data " - "(bytes sent: %zu)", *pnwritten); + failf(data, "schannel: timed out sending data (bytes sent: %zu)", + *pnwritten); result = CURLE_OPERATION_TIMEDOUT; break; } @@ -2045,8 +2045,8 @@ static CURLcode schannel_send(struct Curl_cfilter *cf, struct Curl_easy *data, break; } else if(what == 0) { - failf(data, "schannel: timed out sending data " - "(bytes sent: %zu)", *pnwritten); + failf(data, "schannel: timed out sending data (bytes sent: %zu)", + *pnwritten); result = CURLE_OPERATION_TIMEDOUT; break; } diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 8533e9ccc1..414b2e915a 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -38,20 +38,20 @@ #include "vtls/schannel.h" #include "vtls/schannel_int.h" -#include "curlx/fopen.h" -#include "curlx/inet_pton.h" +#include "vtls/hostcheck.h" #include "vtls/vtls.h" #include "vtls/vtls_int.h" #include "curl_trc.h" #include "strerror.h" -#include "curlx/winapi.h" +#include "curlx/fopen.h" +#include "curlx/inet_pton.h" #include "curlx/multibyte.h" -#include "vtls/hostcheck.h" #include "curlx/version_win32.h" +#include "curlx/winapi.h" #define BACKEND ((struct schannel_ssl_backend_data *)connssl->backend) -#define MAX_CAFILE_SIZE 1048576 /* 1 MiB */ +#define MAX_CAFILE_SIZE (1024 * 1024) /* 1 MiB */ #define BEGIN_CERT "-----BEGIN CERTIFICATE-----" #define END_CERT "\n-----END CERTIFICATE-----" @@ -438,10 +438,8 @@ static DWORD cert_get_name_string(struct Curl_easy *data, static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname) { - struct in_addr ia; - struct in6_addr ia6; bool result = FALSE; - + struct in_addr ia; int res = curlx_inet_pton(AF_INET, hostname, &ia); if(res) { ip_blob->size = sizeof(struct in_addr); @@ -449,6 +447,7 @@ static bool get_num_host_info(struct num_ip_data *ip_blob, LPCSTR hostname) result = TRUE; } else { + struct in6_addr ia6; res = curlx_inet_pton(AF_INET6, hostname, &ia6); if(res) { ip_blob->size = sizeof(struct in6_addr); diff --git a/lib/vtls/vtls.h b/lib/vtls/vtls.h index 0850f5306d..83e2a7ca54 100644 --- a/lib/vtls/vtls.h +++ b/lib/vtls/vtls.h @@ -97,7 +97,7 @@ struct ssl_peer { CURLsslset Curl_init_sslset_nolock(curl_sslbackend id, const char *name, const curl_ssl_backend ***avail); -#define MAX_PINNED_PUBKEY_SIZE 1048576 /* 1 MiB */ +#define MAX_PINNED_PUBKEY_SIZE (1024 * 1024) /* 1 MiB */ curl_sslbackend Curl_ssl_backend(void); diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index 377175d56d..89310adfae 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -1424,7 +1424,6 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx, result = CURLE_SSL_CONNECT_ERROR; goto out; } - } #endif /* HAVE_WOLFSSL_CTX_GENERATEECHCONFIG */ diff --git a/projects/vms/curlmsg_vms.h b/projects/vms/curlmsg_vms.h index 29a38db493..83af6400f0 100644 --- a/projects/vms/curlmsg_vms.h +++ b/projects/vms/curlmsg_vms.h @@ -37,20 +37,6 @@ #include "curlmsg.h" -/* -#define FAC_CURL 0xC01 -#define FAC_SYSTEM 0 -#define MSG_NORMAL 0 -*/ - -/* -#define SEV_WARNING 0 -#define SEV_SUCCESS 1 -#define SEV_ERROR 2 -#define SEV_INFO 3 -#define SEV_FATAL 4 -*/ - static const long vms_cond[] = { CURL_OK, diff --git a/scripts/checksrc.pl b/scripts/checksrc.pl index 14d94d09bb..2ae5232f4b 100755 --- a/scripts/checksrc.pl +++ b/scripts/checksrc.pl @@ -1230,7 +1230,6 @@ sub scanfile { checksrc_endoffile($file); close($R); - } if($errors || $warnings || $verbose) { diff --git a/scripts/managen b/scripts/managen index 13a2302865..d70df2fbfd 100755 --- a/scripts/managen +++ b/scripts/managen @@ -529,7 +529,6 @@ sub render { my $qstr = $quote ? "q" : ""; push @desc, "[".(1 + $level)."$qstr]$d" if(!$manpage); $header = 0; - } if($finalblank) { print STDERR "$f:$line:1:ERROR: trailing blank line\n"; diff --git a/scripts/spacecheck.pl b/scripts/spacecheck.pl index 2fb2c9793f..ff8d866198 100755 --- a/scripts/spacecheck.pl +++ b/scripts/spacecheck.pl @@ -180,6 +180,26 @@ while(my $filename = <$git_ls_files>) { $linepos += $line; } + $search = $content; + $linepos = 0; + while($search =~ /\n\n *}\n/) { + my $part = substr($search, 0, $+[0] - 1); + $search = substr($search, $+[0]); + my $line = ($part =~ tr/\n//); + push @err, sprintf("line %d: '}' preceded by empty line", $linepos + $line); + $linepos += $line + 1; + } + + $search = $content; + $linepos = 0; + while($search =~ /\n\{\n\n/) { + my $part = substr($search, 0, $+[0]); + $search = substr($search, $+[0]); + my $line = ($part =~ tr/\n//); + push @err, sprintf("line %d: top-level '{' followed by empty line", $linepos + $line); + $linepos += $line; + } + if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) { push @err, "content: has binary contents"; } diff --git a/scripts/top-complexity b/scripts/top-complexity index 26fa20ee87..69a9256bb8 100755 --- a/scripts/top-complexity +++ b/scripts/top-complexity @@ -111,7 +111,6 @@ for my $l (@output) { $alllines += $len; $allscore += ($len * $score); } - } my $showncutoff; diff --git a/src/tool_doswin.c b/src/tool_doswin.c index 45886952d6..2f7630059c 100644 --- a/src/tool_doswin.c +++ b/src/tool_doswin.c @@ -185,12 +185,12 @@ static SANITIZEcode msdosify(char ** const sanitized, const char *file_name, and a filename cannot have more than a single dot. We leave the first non-leading dot alone, unless it comes too close to the beginning of the name: we want sh.lex.c to become sh_lex.c, not - sh.lex-c. */ + sh.lex-c. */ else if(*s == '.') { if((flags & SANITIZE_ALLOW_PATH) && idx == 0 && (s[1] == '/' || s[1] == '\\' || (s[1] == '.' && (s[2] == '/' || s[2] == '\\')))) { - /* Copy "./" and "../" verbatim. */ + /* Copy "./" and "../" verbatim. */ *d++ = *s++; if(d == dlimit) break; @@ -225,7 +225,7 @@ static SANITIZEcode msdosify(char ** const sanitized, const char *file_name, *d = 'x'; } else { - /* libg++ etc. */ + /* libg++ etc. */ if(dlimit - d < 4) { *d++ = 'x'; if(d == dlimit) @@ -326,7 +326,7 @@ static SANITIZEcode rename_if_reserved_dos(char ** const sanitized, Examples: CON => _CON, CON.EXT => CON_EXT, CON:ADS => CON_ADS https://web.archive.org/web/20160314141551/support.microsoft.com/en-us/kb/74496 https://learn.microsoft.com/windows/win32/fileio/naming-a-file - */ + */ for(p = buffer; p; p = (p == buffer && buffer != base ? base : NULL)) { size_t p_len; int x = (curl_strnequal(p, "CON", 3) || diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 511a48bf03..e30a4ad815 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -456,7 +456,7 @@ UNITTEST ParameterError parse_cert_parameter(const char *cert_parameter, #ifdef _WIN32 if((param_place == &cert_parameter[1]) && (cert_parameter[2] == '\\' || cert_parameter[2] == '/') && - (ISALPHA(cert_parameter[0]))) { + ISALPHA(cert_parameter[0])) { /* colon in the second column, followed by a backslash, and the first character is an alphabetic letter: @@ -559,7 +559,7 @@ static const struct sizeunit *getunit(char unit) We support P, T, G, M and K (case insensitive) suffixes. Unit test 1623 - */ + */ UNITTEST ParameterError GetSizeParameter(const char *arg, curl_off_t *out) { const char *unit = arg; @@ -1016,7 +1016,7 @@ static ParameterError set_rate(const char *nextarg) /m == per minute /h == per hour (default) /d == per day (24 hours) - */ + */ ParameterError err = PARAM_OK; const char *p = nextarg; curl_off_t denominator; @@ -1256,7 +1256,7 @@ static ParameterError parse_ech(struct OperationConfig *config, warnf("Could not read file \"%s\" " "specified for \"--ech ecl:\" option", nextarg); - return PARAM_BAD_USE; /* */ + return PARAM_BAD_USE; } err = file2string(&tmpcfg, file); if(file != stdin) @@ -2791,7 +2791,7 @@ static ParameterError opt_string(struct OperationConfig *config, /* use or <192.168.10.10> style addresses. Anything except this will make us try to get the "default" address. NOTE: this is a changed behavior since the released 4.1! - */ + */ err = getstr(&config->ftpport, nextarg, DENY_BLANK); break; case C_FTP_SSL_CCC_MODE: /* --ftp-ssl-ccc-mode */ @@ -2809,11 +2809,11 @@ static ParameterError opt_string(struct OperationConfig *config, err = add2list(&config->telnet_options, nextarg); break; case C_USER: /* --user */ - /* user:password */ + /* user:password */ err = getstr(&config->userpwd, nextarg, ALLOW_BLANK); break; case C_PROXY_USER: /* --proxy-user */ - /* Proxy user:password */ + /* Proxy user:password */ err = getstr(&config->proxyuserpwd, nextarg, ALLOW_BLANK); break; case C_WRITE_OUT: /* --write-out */ diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index d5421136c4..f5910f404e 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -209,7 +209,8 @@ ParameterError parseconfig(const char *filename, int max_recursive, } #ifdef DEBUG_CONFIG - curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",(param ? param : "(null)")); + curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n", + (param ? param : "(null)")); #endif res = getparameter(option, param, &usedarg, config, max_recursive); config = global->last; diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index f9389b48e5..cbd97c4e23 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -93,7 +93,7 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp, { /* processes a set expression with the point behind the opening '{' ','-separated elements are collected until the next closing '}' - */ + */ struct URLPattern *pat; bool done = FALSE; const char *pattern = *patternp; @@ -217,7 +217,7 @@ static CURLcode glob_range(struct URLGlob *glob, const char **patternp, - num range: e.g. "0-9]", "17-2000]" - num range with leading zeros: e.g. "001-999]" expression is checked for well-formedness and collected until the next ']' - */ + */ struct URLPattern *pat; const char *pattern = *patternp; const char *c; @@ -460,7 +460,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern, curlx_dyn_reset(&glob->buf); } else { - if(!*pattern) /* done */ + if(!*pattern) /* done */ break; else if(*pattern == '{') { /* process set pattern */ diff --git a/src/tool_vms.c b/src/tool_vms.c index 71606f3d66..74eb210ab5 100644 --- a/src/tool_vms.c +++ b/src/tool_vms.c @@ -97,7 +97,7 @@ void vms_special_exit(int code, int vms_show) #endif if(code > CURL_LAST) { /* If CURL_LAST exceeded then */ - vms_code = CURL_LAST; /* curlmsg.h is out of sync. */ + vms_code = CURL_LAST; /* curlmsg.h is out of sync. */ } else { vms_code = vms_cond[code] | vms_show; diff --git a/tests/libtest/lib2405.c b/tests/libtest/lib2405.c index f0a3b9aded..f19a7ee4e1 100644 --- a/tests/libtest/lib2405.c +++ b/tests/libtest/lib2405.c @@ -322,7 +322,7 @@ static CURLcode empty_multi_test(void) multi_init(multi); - /* calling curl_multi_waitfds() on an empty multi handle. */ + /* calling curl_multi_waitfds() on an empty multi handle. */ mresult = curl_multi_waitfds(multi, ufds, 10, &fd_count); if(mresult != CURLM_OK) { diff --git a/tests/libtest/mk-lib1521.pl b/tests/libtest/mk-lib1521.pl index 72bfce4294..b8ff7ef06c 100755 --- a/tests/libtest/mk-lib1521.pl +++ b/tests/libtest/mk-lib1521.pl @@ -330,15 +330,15 @@ static bool bad_long(CURLcode res, int check) static bool bad_neg(int check) { switch(check) { - case CURLOPT_DNS_CACHE_TIMEOUT: - case CURLOPT_INFILESIZE: - case CURLOPT_INFILESIZE_LARGE: - case CURLOPT_MAXREDIRS: - case CURLOPT_POSTFIELDSIZE: - case CURLOPT_POSTFIELDSIZE_LARGE: - case CURLOPT_RESUME_FROM: - case CURLOPT_RESUME_FROM_LARGE: - return TRUE; + case CURLOPT_DNS_CACHE_TIMEOUT: + case CURLOPT_INFILESIZE: + case CURLOPT_INFILESIZE_LARGE: + case CURLOPT_MAXREDIRS: + case CURLOPT_POSTFIELDSIZE: + case CURLOPT_POSTFIELDSIZE_LARGE: + case CURLOPT_RESUME_FROM: + case CURLOPT_RESUME_FROM_LARGE: + return TRUE; } return FALSE; } diff --git a/tests/libtest/test613.pl b/tests/libtest/test613.pl index 3cccb6ed7f..813052cb70 100755 --- a/tests/libtest/test613.pl +++ b/tests/libtest/test613.pl @@ -146,7 +146,7 @@ elsif($ARGV[0] eq "postprocess") { } close(IN); - @canondir = sort {substr($a,57) cmp substr($b,57)} @canondir; + @canondir = sort {substr($a, 57) cmp substr($b, 57)} @canondir; my $newfile = $logfile . ".new"; open(OUT, ">$newfile") || die "$!"; print OUT join('', @canondir); diff --git a/tests/memanalyzer.pm b/tests/memanalyzer.pm index d33f56419a..e9a847c8cf 100644 --- a/tests/memanalyzer.pm +++ b/tests/memanalyzer.pm @@ -154,7 +154,6 @@ sub memanalyze { $sizeataddr{$addr}=-1; # set -1 to mark as freed $getmem{$addr}="$source:$linenum"; - } } elsif($function =~ /malloc\((\d*)\) = 0x([0-9a-f]*)/) { @@ -380,7 +379,6 @@ sub memanalyze { push @res, "FREEADDRINFO ($source:$linenum)\n"; } } - } else { push @res, "Not recognized prefix line: $line\n"; diff --git a/tests/runtests.pl b/tests/runtests.pl index e8612d2756..28eb0bd799 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -1447,7 +1447,6 @@ sub singletest_check { } $ok .= "p"; - } else { $ok .= "-"; # protocol not checked @@ -1609,7 +1608,6 @@ sub singletest_check { } $ok .= "P"; - } else { $ok .= "-"; # proxy not checked diff --git a/tests/server/socksd.c b/tests/server/socksd.c index f9bff8d5f3..8a4840ce69 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -519,7 +519,6 @@ static curl_socket_t sockit(curl_socket_t fd) rep = s_config.connectrep; } - /* */ response[SOCKS5_VERSION] = s_config.responseversion; /* diff --git a/tests/servers.pm b/tests/servers.pm index 0cc13874cc..f45afe9f30 100644 --- a/tests/servers.pm +++ b/tests/servers.pm @@ -311,7 +311,7 @@ sub serverfortest { push @lprotocols, "dns"; if(! grep /^\Q$server\E$/, @lprotocols) { - if(substr($server,0,5) ne "socks") { + if(substr($server, 0, 5) ne "socks") { if($tlsext) { return ("curl lacks $tlsext support", 4); } diff --git a/tests/test1139.pl b/tests/test1139.pl index 8b0cda8820..c1e4651420 100755 --- a/tests/test1139.pl +++ b/tests/test1139.pl @@ -279,7 +279,6 @@ while(<$r>) { push @toolhelp, $combo; $opts{$combo} |= 4; } - } } close($r); diff --git a/tests/unit/unit1664.c b/tests/unit/unit1664.c index b434462feb..4a94b6975e 100644 --- a/tests/unit/unit1664.c +++ b/tests/unit/unit1664.c @@ -315,7 +315,7 @@ static CURLcode test_unit1664(const char *arg) /* CURL_OFF_T is typically 9223372036854775807 */ static const char *nums[] = { "9223372036854775807", /* 2^63 -1 */ - "9223372036854775808", /* 2^63 */ + "9223372036854775808", /* 2^63 */ "18446744073709551615", /* 2^64 - 1 */ "18446744073709551616", /* 2^64 */ "18446744073709551617", /* 2^64 + 1 */ @@ -429,7 +429,7 @@ static CURLcode test_unit1664(const char *arg) /* CURL_OFF_T is typically 2^63-1 */ static const char *nums[] = { "777777777777777777777", /* 2^63 -1 */ - "1000000000000000000000", /* 2^63 */ + "1000000000000000000000", /* 2^63 */ "111111111111111111111", "222222222222222222222", "333333333333333333333", @@ -453,7 +453,7 @@ static CURLcode test_unit1664(const char *arg) /* CURL_OFF_T is typically 2^63-1 */ static const char *nums[] = { "7FFFFFFFFFFFFFFF", /* 2^63 -1 */ - "8000000000000000", /* 2^63 */ + "8000000000000000", /* 2^63 */ "1111111111111111", "2222222222222222", "3333333333333333", diff --git a/tests/unit/unit2600.c b/tests/unit/unit2600.c index a0e6eadf10..97d4caed96 100644 --- a/tests/unit/unit2600.c +++ b/tests/unit/unit2600.c @@ -360,17 +360,17 @@ static CURLcode test_unit2600(const char *arg) /* CNCT HE v4 v6 v4 v6 MIN MAX */ { 1, TURL, "test.com:123:192.0.2.1", CURL_IPRESOLVE_WHATEVER, CNCT_TMOT, 150, 250, 250, 1, 0, 200, TC_TMOT, R_FAIL, NULL }, - /* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */ + /* 1 ipv4, fails after ~200ms, reports COULDNT_CONNECT */ { 2, TURL, "test.com:123:192.0.2.1,192.0.2.2", CURL_IPRESOLVE_WHATEVER, CNCT_TMOT, 150, 250, 250, 2, 0, 400, TC_TMOT, R_FAIL, NULL }, - /* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */ + /* 2 ipv4, fails after ~400ms, reports COULDNT_CONNECT */ #ifdef USE_IPV6 { 3, TURL, "test.com:123:::1", CURL_IPRESOLVE_WHATEVER, CNCT_TMOT, 150, 250, 250, 0, 1, 200, TC_TMOT, R_FAIL, NULL }, - /* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */ + /* 1 ipv6, fails after ~200ms, reports COULDNT_CONNECT */ { 4, TURL, "test.com:123:::1,::2", CURL_IPRESOLVE_WHATEVER, CNCT_TMOT, 150, 250, 250, 0, 2, 400, TC_TMOT, R_FAIL, NULL }, - /* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */ + /* 2 ipv6, fails after ~400ms, reports COULDNT_CONNECT */ { 5, TURL, "test.com:123:192.0.2.1,::1", CURL_IPRESOLVE_WHATEVER, CNCT_TMOT, 150, 250, 250, 1, 1, 350, TC_TMOT, R_FAIL, "v6" }, /* mixed ip4+6, v6 always first, v4 kicks in on HE, fails after ~350ms */