From: Viktor Szakats Date: Mon, 14 Jul 2025 15:08:05 +0000 (+0200) Subject: tidy-up: more whitespace/indent, comments X-Git-Tag: curl-8_16_0~398 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d977fe55200a491da447c40fc7b426ba343c2b7;p=thirdparty%2Fcurl.git tidy-up: more whitespace/indent, comments Also a couple of minor formatting updates in the root `CMakeLists.txt`. One swap to `#ifdef`. Closes #17929 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5f51997f2e..8d6a475f53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -476,10 +476,10 @@ option(CURL_DISABLE_VERBOSE_STRINGS "Disable verbose strings" OFF) mark_as_advanced(CURL_DISABLE_VERBOSE_STRINGS) if(CURL_DISABLE_HTTP) - set(CURL_DISABLE_IPFS ON) - set(CURL_DISABLE_RTSP ON) set(CURL_DISABLE_ALTSVC ON) set(CURL_DISABLE_HSTS ON) + set(CURL_DISABLE_IPFS ON) + set(CURL_DISABLE_RTSP ON) set(CURL_DISABLE_WEBSOCKETS ON) endif() @@ -493,11 +493,11 @@ if(HTTP_ONLY) set(CURL_DISABLE_FTP ON) set(CURL_DISABLE_GOPHER ON) set(CURL_DISABLE_IMAP ON) + set(CURL_DISABLE_IPFS ON) set(CURL_DISABLE_LDAP ON) set(CURL_DISABLE_LDAPS ON) set(CURL_DISABLE_MQTT ON) set(CURL_DISABLE_POP3 ON) - set(CURL_DISABLE_IPFS ON) set(CURL_DISABLE_RTSP ON) set(CURL_DISABLE_SMB ON) set(CURL_DISABLE_SMTP ON) @@ -1499,7 +1499,7 @@ endif() option(ENABLE_UNIX_SOCKETS "Enable Unix domain sockets support" ON) if(ENABLE_UNIX_SOCKETS AND NOT WINCE) if(WIN32 OR DOS) - set(USE_UNIX_SOCKETS ON) + set(USE_UNIX_SOCKETS 1) else() include(CheckStructHasMember) check_struct_has_member("struct sockaddr_un" "sun_path" "sys/un.h" USE_UNIX_SOCKETS) diff --git a/configure.ac b/configure.ac index 27c46bbffc..373e859f8c 100644 --- a/configure.ac +++ b/configure.ac @@ -1271,13 +1271,13 @@ if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set; then AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ - #define __USE_INLINE__ - #include - #ifdef __amigaos4__ - struct SocketIFace *ISocket = NULL; - #else - struct Library *SocketBase = NULL; - #endif + #define __USE_INLINE__ + #include + #ifdef __amigaos4__ + struct SocketIFace *ISocket = NULL; + #else + struct Library *SocketBase = NULL; + #endif ]],[[ unsigned char host[] = "localhost"; gethostbyname(host); diff --git a/docs/examples/htmltitle.cpp b/docs/examples/htmltitle.cpp index 52dbdf1535..8d75f588fc 100644 --- a/docs/examples/htmltitle.cpp +++ b/docs/examples/htmltitle.cpp @@ -144,7 +144,7 @@ static void StartElement(void *voidContext, context->title = ""; context->addTitle = true; } - (void) attributes; + (void)attributes; } // diff --git a/docs/examples/sessioninfo.c b/docs/examples/sessioninfo.c index bb5721aca6..225b1ae5a5 100644 --- a/docs/examples/sessioninfo.c +++ b/docs/examples/sessioninfo.c @@ -102,7 +102,7 @@ int main(void) curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L); - (void) curl_easy_perform(curl); + (void)curl_easy_perform(curl); curl_easy_cleanup(curl); } diff --git a/lib/asyn-thrdd.c b/lib/asyn-thrdd.c index 1752f3ada0..19d1336854 100644 --- a/lib/asyn-thrdd.c +++ b/lib/asyn-thrdd.c @@ -159,7 +159,7 @@ addr_ctx_create(const char *hostname, int port, DEBUGASSERT(hints); addr_ctx->hints = *hints; #else - (void) hints; + (void)hints; #endif Curl_mutex_init(&addr_ctx->mutx); diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 9ea4a047c8..3a0549c4b1 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -96,7 +96,7 @@ struct zlib_writer { static voidpf zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) { - (void) opaque; + (void)opaque; /* not a typo, keep it calloc() */ return (voidpf) calloc(items, size); } @@ -104,7 +104,7 @@ zalloc_cb(voidpf opaque, unsigned int items, unsigned int size) static void zfree_cb(voidpf opaque, voidpf ptr) { - (void) opaque; + (void)opaque; free(ptr); } @@ -411,7 +411,7 @@ static CURLcode brotli_do_init(struct Curl_easy *data, struct Curl_cwriter *writer) { struct brotli_writer *bp = (struct brotli_writer *) writer; - (void) data; + (void)data; bp->br = BrotliDecoderCreateInstance(NULL, NULL, NULL); return bp->br ? CURLE_OK : CURLE_OUT_OF_MEMORY; @@ -466,7 +466,7 @@ static void brotli_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { struct brotli_writer *bp = (struct brotli_writer *) writer; - (void) data; + (void)data; if(bp->br) { BrotliDecoderDestroyInstance(bp->br); @@ -671,9 +671,9 @@ static CURLcode error_do_write(struct Curl_easy *data, struct Curl_cwriter *writer, int type, const char *buf, size_t nbytes) { - (void) writer; - (void) buf; - (void) nbytes; + (void)writer; + (void)buf; + (void)nbytes; if(!(type & CLIENTWRITE_BODY) || !nbytes) return Curl_cwriter_write(data, writer->next, type, buf, nbytes); @@ -689,8 +689,8 @@ static CURLcode error_do_write(struct Curl_easy *data, static void error_do_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - (void) data; - (void) writer; + (void)data; + (void)writer; } static const struct Curl_cwtype error_writer = { @@ -843,9 +843,9 @@ CURLcode Curl_build_unencoding_stack(struct Curl_easy *data, CURLcode Curl_build_unencoding_stack(struct Curl_easy *data, const char *enclist, int is_transfer) { - (void) data; - (void) enclist; - (void) is_transfer; + (void)data; + (void)enclist; + (void)is_transfer; return CURLE_NOT_BUILT_IN; } diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c index fb418b400d..c3fa864eff 100644 --- a/lib/curl_gethostname.c +++ b/lib/curl_gethostname.c @@ -46,8 +46,8 @@ int Curl_gethostname(char * const name, GETHOSTNAME_TYPE_ARG2 namelen) #ifndef HAVE_GETHOSTNAME /* Allow compilation and return failure when unavailable */ - (void) name; - (void) namelen; + (void)name; + (void)namelen; return -1; #else diff --git a/lib/curl_md5.h b/lib/curl_md5.h index ec27503b14..16272c7591 100644 --- a/lib/curl_md5.h +++ b/lib/curl_md5.h @@ -24,8 +24,8 @@ * ***************************************************************************/ -#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) \ - || !defined(CURL_DISABLE_DIGEST_AUTH) +#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ + !defined(CURL_DISABLE_DIGEST_AUTH) #include "curl_hmac.h" diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 766de44b85..be21a35a0a 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -222,7 +222,7 @@ static void sasl_state(struct SASL *sasl, struct Curl_easy *data, infof(data, "SASL %p state change from %s to %s", (void *)sasl, names[sasl->state], names[newstate]); #else - (void) data; + (void)data; #endif sasl->state = newstate; @@ -615,8 +615,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct Curl_easy *data, struct bufref resp; const char *hostname; int port; -#if defined(USE_KERBEROS5) || defined(USE_NTLM) \ - || !defined(CURL_DISABLE_DIGEST_AUTH) +#if defined(USE_KERBEROS5) || defined(USE_NTLM) || \ + !defined(CURL_DISABLE_DIGEST_AUTH) const char *service = data->set.str[STRING_SERVICE_NAME] ? data->set.str[STRING_SERVICE_NAME] : sasl->params->service; diff --git a/lib/curl_sha256.h b/lib/curl_sha256.h index f532939d05..caa5080b3f 100644 --- a/lib/curl_sha256.h +++ b/lib/curl_sha256.h @@ -25,8 +25,8 @@ * ***************************************************************************/ -#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) \ - || defined(USE_LIBSSH2) || defined(USE_SSL) +#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \ + defined(USE_LIBSSH2) || defined(USE_SSL) #include #include "curl_hmac.h" diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c index 81bfddc711..d730c59a1b 100644 --- a/lib/curl_sha512_256.c +++ b/lib/curl_sha512_256.c @@ -110,8 +110,7 @@ typedef EVP_MD_CTX *Curl_sha512_256_ctx; * @return CURLE_OK if succeed, * error code otherwise */ -static CURLcode -Curl_sha512_256_init(void *context) +static CURLcode Curl_sha512_256_init(void *context) { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -142,10 +141,9 @@ Curl_sha512_256_init(void *context) * @return CURLE_OK if succeed, * error code otherwise */ -static CURLcode -Curl_sha512_256_update(void *context, - const unsigned char *data, - size_t length) +static CURLcode Curl_sha512_256_update(void *context, + const unsigned char *data, + size_t length) { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -165,9 +163,7 @@ Curl_sha512_256_update(void *context, * @return CURLE_OK if succeed, * error code otherwise */ -static CURLcode -Curl_sha512_256_finish(unsigned char *digest, - void *context) +static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { CURLcode ret; Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -207,8 +203,7 @@ typedef struct sha512_256_ctx Curl_sha512_256_ctx; * @param context the calculation context * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_init(void *context) +static CURLcode Curl_sha512_256_init(void *context) { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -229,10 +224,9 @@ Curl_sha512_256_init(void *context) * @param length number of bytes in @a data * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_update(void *context, - const unsigned char *data, - size_t length) +static CURLcode Curl_sha512_256_update(void *context, + const unsigned char *data, + size_t length) { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -252,9 +246,8 @@ Curl_sha512_256_update(void *context, # bytes * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_finish(unsigned char *digest, - void *context) +static CURLcode Curl_sha512_256_finish(unsigned char *digest, + void *context) { Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; @@ -284,13 +277,13 @@ Curl_sha512_256_finish(unsigned char *digest, #if !defined(CURL_FORCEINLINE) && \ defined(_MSC_VER) && !defined(__GNUC__) && !defined(__clang__) -# define CURL_FORCEINLINE __forceinline +#define CURL_FORCEINLINE __forceinline #endif -#if !defined(CURL_FORCEINLINE) - /* Assume that 'CURL_INLINE' keyword works or the - * macro was already defined correctly. */ -# define CURL_FORCEINLINE CURL_INLINE +/* Assume that 'CURL_INLINE' keyword works or the + * macro was already defined correctly. */ +#ifndef CURL_FORCEINLINE +#define CURL_FORCEINLINE CURL_INLINE #endif /* Bits manipulation macros and functions. @@ -320,8 +313,8 @@ Curl_sha512_256_finish(unsigned char *digest, /* Defined as a function. The macro version may duplicate the binary code * size as each argument is used twice, so if any calculation is used * as an argument, the calculation could be done twice. */ -static CURL_FORCEINLINE curl_uint64_t -Curl_rotr64(curl_uint64_t value, unsigned int bits) +static CURL_FORCEINLINE curl_uint64_t Curl_rotr64(curl_uint64_t value, + unsigned int bits) { bits %= 64; if(0 == bits) @@ -380,8 +373,7 @@ Curl_rotr64(curl_uint64_t value, unsigned int bits) /** * SHA-512/256 calculation context */ -struct Curl_sha512_256ctx -{ +struct Curl_sha512_256ctx { /** * Intermediate hash value. The variable is properly aligned. Smart * compilers may automatically use fast load/store instruction for big @@ -417,8 +409,7 @@ typedef struct Curl_sha512_256ctx Curl_sha512_256_ctx; * @param context the calculation context * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_init(void *context) +static CURLcode Curl_sha512_256_init(void *context) { struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; @@ -453,9 +444,9 @@ Curl_sha512_256_init(void *context) * @param H hash values * @param data the data buffer with #CURL_SHA512_256_BLOCK_SIZE bytes block */ -static void -Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], - const void *data) +static +void Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], + const void *data) { /* Working variables, see FIPS PUB 180-4 section 6.7, 6.4. */ @@ -619,10 +610,9 @@ Curl_sha512_256_transform(curl_uint64_t H[SHA512_256_HASH_SIZE_WORDS], * @param length number of bytes in @a data * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_update(void *context, - const unsigned char *data, - size_t length) +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 */ struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; @@ -696,9 +686,7 @@ Curl_sha512_256_update(void *context, # bytes * @return always CURLE_OK */ -static CURLcode -Curl_sha512_256_finish(unsigned char *digest, - void *context) +static CURLcode Curl_sha512_256_finish(unsigned char *digest, void *context) { struct Curl_sha512_256ctx *const ctx = (struct Curl_sha512_256ctx *)context; curl_uint64_t num_bits; /**< Number of processed bits */ @@ -746,14 +734,14 @@ Curl_sha512_256_finish(unsigned char *digest, 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_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, \ + 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); @@ -782,9 +770,8 @@ Curl_sha512_256_finish(unsigned char *digest, * @param input_size the size of the data pointed by @a input * @return always #CURLE_OK */ -CURLcode -Curl_sha512_256it(unsigned char *output, const unsigned char *input, - size_t input_size) +CURLcode Curl_sha512_256it(unsigned char *output, const unsigned char *input, + size_t input_size) { Curl_sha512_256_ctx ctx; CURLcode res; @@ -796,7 +783,7 @@ Curl_sha512_256it(unsigned char *output, const unsigned char *input, res = Curl_sha512_256_update(&ctx, (const void *) input, input_size); if(res != CURLE_OK) { - (void) Curl_sha512_256_finish(output, &ctx); + (void)Curl_sha512_256_finish(output, &ctx); return res; } @@ -804,22 +791,19 @@ Curl_sha512_256it(unsigned char *output, const unsigned char *input, } /* Wrapper function, takes 'unsigned int' as length type, returns void */ -static void -Curl_sha512_256_update_i(void *context, - const unsigned char *data, - unsigned int length) +static void Curl_sha512_256_update_i(void *context, + const unsigned char *data, + unsigned int length) { /* Hypothetically the function may fail, but assume it does not */ - (void) Curl_sha512_256_update(context, data, length); + (void)Curl_sha512_256_update(context, data, length); } /* Wrapper function, returns void */ -static void -Curl_sha512_256_finish_v(unsigned char *result, - void *context) +static void Curl_sha512_256_finish_v(unsigned char *result, void *context) { /* Hypothetically the function may fail, but assume it does not */ - (void) Curl_sha512_256_finish(result, context); + (void)Curl_sha512_256_finish(result, context); } /* Wrapper function, takes 'unsigned int' as length type, returns void */ diff --git a/lib/curl_sspi.h b/lib/curl_sspi.h index 540cdfd19c..3f997876f4 100644 --- a/lib/curl_sspi.h +++ b/lib/curl_sspi.h @@ -289,13 +289,13 @@ extern PSecurityFunctionTable Curl_pSecFn; #endif #endif /* __MINGW32CE__ */ #ifndef SEC_E_INVALID_PARAMETER -# define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL) +#define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL) #endif #ifndef SEC_E_DELEGATION_POLICY -# define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL) +#define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL) #endif #ifndef SEC_E_POLICY_NLTM_ONLY -# define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL) +#define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL) #endif #ifdef __MINGW32CE__ diff --git a/lib/curlx/multibyte.h b/lib/curlx/multibyte.h index 7835fdc3b5..c60ce258c9 100644 --- a/lib/curlx/multibyte.h +++ b/lib/curlx/multibyte.h @@ -26,14 +26,10 @@ #include "../curl_setup.h" #ifdef _WIN32 - - /* - * MultiByte conversions using Windows kernel32 library. - */ - +/* MultiByte conversions using Windows kernel32 library. */ wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8); char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w); -#endif /* _WIN32 */ +#endif /* * Macros curlx_convert_UTF8_to_tchar(), curlx_convert_tchar_to_UTF8() diff --git a/lib/curlx/timeval.c b/lib/curlx/timeval.c index a767d1ac72..01393bd528 100644 --- a/lib/curlx/timeval.c +++ b/lib/curlx/timeval.c @@ -169,7 +169,7 @@ struct curltime curlx_now(void) uint64_t usecs; if(0 == timebase.denom) - (void) mach_timebase_info(&timebase); + (void)mach_timebase_info(&timebase); usecs = mach_absolute_time(); usecs *= timebase.numer; /* spellchecker:disable-line */ diff --git a/lib/easy.c b/lib/easy.c index c67bedfca2..b751e1e436 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -466,7 +466,7 @@ static int events_socket(CURL *easy, /* easy handle */ struct Curl_easy *data = easy; #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) easy; + (void)easy; #endif (void)socketp; diff --git a/lib/easygetopt.c b/lib/easygetopt.c index 0113121632..7ac39bc634 100644 --- a/lib/easygetopt.c +++ b/lib/easygetopt.c @@ -82,7 +82,7 @@ const struct curl_easyoption *curl_easy_option_by_name(const char *name) return NULL; } -const struct curl_easyoption *curl_easy_option_by_id (CURLoption id) +const struct curl_easyoption *curl_easy_option_by_id(CURLoption id) { (void)id; return NULL; diff --git a/lib/formdata.c b/lib/formdata.c index 5a4b52ea57..d8553e3256 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -186,22 +186,24 @@ static void free_formlist(struct FormInfo *ptr) * Examples: * * Simple name/value pair with copied contents: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_COPYCONTENTS, "value", CURLFORM_END); + * curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", + * CURLFORM_COPYCONTENTS, "value", CURLFORM_END); * * name/value pair where only the content pointer is remembered: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_PTRCONTENTS, ptr, CURLFORM_CONTENTSLENGTH, 10, CURLFORM_END); + * curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", + * CURLFORM_PTRCONTENTS, ptr, CURLFORM_CONTENTSLENGTH, 10, + * CURLFORM_END); * (if CURLFORM_CONTENTSLENGTH is missing strlen () is used) * * storing a filename (CONTENTTYPE is optional!): - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_FILE, "filename1", CURLFORM_CONTENTTYPE, "plain/text", - * CURLFORM_END); + * curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", + * CURLFORM_FILE, "filename1", CURLFORM_CONTENTTYPE, "plain/text", + * CURLFORM_END); * * storing multiple filenames: - * curl_formadd (&post, &last, CURLFORM_COPYNAME, "name", - * CURLFORM_FILE, "filename1", CURLFORM_FILE, "filename2", CURLFORM_END); + * curl_formadd(&post, &last, CURLFORM_COPYNAME, "name", + * CURLFORM_FILE, "filename1", CURLFORM_FILE, "filename2", + * CURLFORM_END); * * Returns: * CURL_FORMADD_OK on success @@ -926,9 +928,9 @@ CURLFORMcode curl_formadd(struct curl_httppost **httppost, int curl_formget(struct curl_httppost *form, void *arg, curl_formget_callback append) { - (void) form; - (void) arg; - (void) append; + (void)form; + (void)arg; + (void)append; return CURL_FORMADD_DISABLED; } diff --git a/lib/http2.c b/lib/http2.c index 395195fc53..1037d5f94f 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -3015,15 +3015,15 @@ void *Curl_nghttp2_realloc(void *ptr, size_t size, void *user_data) char *curl_pushheader_bynum(struct curl_pushheaders *h, size_t num) { - (void) h; - (void) num; + (void)h; + (void)num; return NULL; } char *curl_pushheader_byname(struct curl_pushheaders *h, const char *header) { - (void) h; - (void) header; + (void)h; + (void)header; return NULL; } diff --git a/lib/if2ip.c b/lib/if2ip.c index d685290889..5e721510de 100644 --- a/lib/if2ip.c +++ b/lib/if2ip.c @@ -109,7 +109,7 @@ if2ip_result_t Curl_if2ip(int af, #if defined(USE_IPV6) && \ !defined(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID) - (void) local_scope_id; + (void)local_scope_id; #endif if(getifaddrs(&head) >= 0) { @@ -252,14 +252,14 @@ if2ip_result_t Curl_if2ip(int af, const char *interf, char *buf, size_t buf_size) { - (void) af; + (void)af; #ifdef USE_IPV6 - (void) remote_scope; - (void) local_scope_id; + (void)remote_scope; + (void)local_scope_id; #endif - (void) interf; - (void) buf; - (void) buf_size; + (void)interf; + (void)buf; + (void)buf_size; return IF2IP_NOT_FOUND; } diff --git a/lib/krb5.c b/lib/krb5.c index b5effa2a1b..40243bddb5 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -718,7 +718,7 @@ int Curl_sec_read_msg(struct Curl_easy *data, struct connectdata *conn, size_t decoded_sz = 0; CURLcode error; - (void) data; + (void)data; if(!conn->mech) /* not initialized, return error */ diff --git a/lib/md4.c b/lib/md4.c index 3b8698e65c..fa35924f46 100644 --- a/lib/md4.c +++ b/lib/md4.c @@ -223,7 +223,7 @@ static void MD4_Final(unsigned char *result, MD4_CTX *ctx) #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) mbedtls_md4(ctx->data, ctx->size, result); #else - (void) mbedtls_md4_ret(ctx->data, ctx->size, result); + (void)mbedtls_md4_ret(ctx->data, ctx->size, result); #endif Curl_safefree(ctx->data); diff --git a/lib/md5.c b/lib/md5.c index 6a273c56c0..c95e5f19cf 100644 --- a/lib/md5.c +++ b/lib/md5.c @@ -24,8 +24,8 @@ #include "curl_setup.h" -#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) \ - || !defined(CURL_DISABLE_DIGEST_AUTH) +#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ + !defined(CURL_DISABLE_DIGEST_AUTH) #include #include @@ -178,18 +178,18 @@ static void my_md5_update(void *ctx, unsigned int length) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) - (void) mbedtls_md5_update(ctx, data, length); + (void)mbedtls_md5_update(ctx, data, length); #else - (void) mbedtls_md5_update_ret(ctx, data, length); + (void)mbedtls_md5_update_ret(ctx, data, length); #endif } static void my_md5_final(unsigned char *digest, void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) - (void) mbedtls_md5_finish(ctx, digest); + (void)mbedtls_md5_finish(ctx, digest); #else - (void) mbedtls_md5_finish_ret(ctx, digest); + (void)mbedtls_md5_finish_ret(ctx, digest); #endif } diff --git a/lib/mime.c b/lib/mime.c index 06cd221abf..3d4eef767f 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -36,9 +36,10 @@ struct Curl_easy; #include "strdup.h" #include "curlx/base64.h" -#if !defined(CURL_DISABLE_MIME) && (!defined(CURL_DISABLE_HTTP) || \ - !defined(CURL_DISABLE_SMTP) || \ - !defined(CURL_DISABLE_IMAP)) +#if !defined(CURL_DISABLE_MIME) && \ + (!defined(CURL_DISABLE_HTTP) || \ + !defined(CURL_DISABLE_SMTP) || \ + !defined(CURL_DISABLE_IMAP)) #if defined(HAVE_LIBGEN_H) && defined(HAVE_BASENAME) #include @@ -53,14 +54,13 @@ struct Curl_easy; #include "memdebug.h" #ifdef _WIN32 -# ifndef R_OK +# ifndef R_OK # define R_OK 4 -# endif +# endif #endif - -#define READ_ERROR ((size_t) -1) -#define STOP_FILLING ((size_t) -2) +#define READ_ERROR ((size_t) -1) +#define STOP_FILLING ((size_t) -2) static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, void *instream, bool *hasread); @@ -97,30 +97,30 @@ static const struct mime_encoder encoders[] = { #define QP_CR 3 /* Carriage return. */ #define QP_LF 4 /* Line-feed. */ static const unsigned char qp_class[] = { - 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 07 */ - 0, QP_SP, QP_LF, 0, 0, QP_CR, 0, 0, /* 08 - 0F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 17 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 18 - 1F */ - QP_SP, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 20 - 27 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 28 - 2F */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 30 - 37 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, 0 , QP_OK, QP_OK, /* 38 - 3F */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 40 - 47 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 48 - 4F */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 50 - 57 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 58 - 5F */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 60 - 67 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 68 - 6F */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 70 - 77 */ - QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, 0, /* 78 - 7F */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 07 */ + 0, QP_SP, QP_LF, 0, 0, QP_CR, 0, 0, /* 08 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 17 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 18 - 1F */ + QP_SP, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 20 - 27 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 28 - 2F */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 30 - 37 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, 0 , QP_OK, QP_OK, /* 38 - 3F */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 40 - 47 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 48 - 4F */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 50 - 57 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 58 - 5F */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 60 - 67 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 68 - 6F */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, /* 70 - 77 */ + QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, QP_OK, 0, /* 78 - 7F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */ }; @@ -384,7 +384,7 @@ static size_t encoder_nop_read(char *buffer, size_t size, bool ateof, struct mime_encoder_state *st = &part->encstate; size_t insize = st->bufend - st->bufbeg; - (void) ateof; + (void)ateof; if(!size) return STOP_FILLING; @@ -412,7 +412,7 @@ static size_t encoder_7bit_read(char *buffer, size_t size, bool ateof, struct mime_encoder_state *st = &part->encstate; size_t cursize = st->bufend - st->bufbeg; - (void) ateof; + (void)ateof; if(!size) return STOP_FILLING; @@ -661,7 +661,7 @@ static size_t mime_mem_read(char *buffer, size_t size, size_t nitems, { curl_mimepart *part = (curl_mimepart *) instream; size_t sz = curlx_sotouz(part->datasize - part->state.offset); - (void) size; /* Always 1.*/ + (void)size; /* Always 1.*/ if(!nitems) return STOP_FILLING; @@ -1000,7 +1000,7 @@ static size_t mime_subparts_read(char *buffer, size_t size, size_t nitems, { curl_mime *mime = (curl_mime *) instream; size_t cursize = 0; - (void) size; /* Always 1. */ + (void)size; /* Always 1. */ while(nitems) { size_t sz = 0; @@ -1593,7 +1593,7 @@ size_t Curl_mime_read(char *buffer, size_t size, size_t nitems, void *instream) size_t ret; bool hasread; - (void) size; /* Always 1. */ + (void)size; /* Always 1. */ /* If `nitems` is <= 4, some encoders will return STOP_FILLING without * adding any data and this loops infinitely. */ @@ -2220,62 +2220,62 @@ CURLcode Curl_creader_set_mime(struct Curl_easy *data, curl_mimepart *part) /* Mime not compiled in: define stubs for externally-referenced functions. */ curl_mime *curl_mime_init(CURL *easy) { - (void) easy; + (void)easy; return NULL; } void curl_mime_free(curl_mime *mime) { - (void) mime; + (void)mime; } curl_mimepart *curl_mime_addpart(curl_mime *mime) { - (void) mime; + (void)mime; return NULL; } CURLcode curl_mime_name(curl_mimepart *part, const char *name) { - (void) part; - (void) name; + (void)part; + (void)name; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_filename(curl_mimepart *part, const char *filename) { - (void) part; - (void) filename; + (void)part; + (void)filename; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_type(curl_mimepart *part, const char *mimetype) { - (void) part; - (void) mimetype; + (void)part; + (void)mimetype; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_encoder(curl_mimepart *part, const char *encoding) { - (void) part; - (void) encoding; + (void)part; + (void)encoding; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_data(curl_mimepart *part, const char *data, size_t datasize) { - (void) part; - (void) data; - (void) datasize; + (void)part; + (void)data; + (void)datasize; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_filedata(curl_mimepart *part, const char *filename) { - (void) part; - (void) filename; + (void)part; + (void)filename; return CURLE_NOT_BUILT_IN; } @@ -2286,28 +2286,28 @@ CURLcode curl_mime_data_cb(curl_mimepart *part, curl_free_callback freefunc, void *arg) { - (void) part; - (void) datasize; - (void) readfunc; - (void) seekfunc; - (void) freefunc; - (void) arg; + (void)part; + (void)datasize; + (void)readfunc; + (void)seekfunc; + (void)freefunc; + (void)arg; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_subparts(curl_mimepart *part, curl_mime *subparts) { - (void) part; - (void) subparts; + (void)part; + (void)subparts; return CURLE_NOT_BUILT_IN; } CURLcode curl_mime_headers(curl_mimepart *part, struct curl_slist *headers, int take_ownership) { - (void) part; - (void) headers; - (void) take_ownership; + (void)part; + (void)headers; + (void)take_ownership; return CURLE_NOT_BUILT_IN; } diff --git a/lib/multi_ev.c b/lib/multi_ev.c index d759ae6cb0..4cde603805 100644 --- a/lib/multi_ev.c +++ b/lib/multi_ev.c @@ -71,14 +71,14 @@ struct mev_sh_entry { static size_t mev_sh_entry_hash(void *key, size_t key_length, size_t slots_num) { curl_socket_t fd = *((curl_socket_t *) key); - (void) key_length; + (void)key_length; return (fd % (curl_socket_t)slots_num); } static size_t mev_sh_entry_compare(void *k1, size_t k1_len, void *k2, size_t k2_len) { - (void) k1_len; (void) k2_len; + (void)k1_len; (void)k2_len; return (*((curl_socket_t *) k1)) == (*((curl_socket_t *) k2)); } diff --git a/lib/openldap.c b/lib/openldap.c index e4714b5580..b0cb26c7ff 100644 --- a/lib/openldap.c +++ b/lib/openldap.c @@ -924,7 +924,7 @@ static CURLcode oldap_disconnect(struct Curl_easy *data, bool dead_connection) { struct ldapconninfo *li = Curl_conn_meta_get(conn, CURL_META_LDAP_CONN); - (void) dead_connection; + (void)dead_connection; #ifndef USE_SSL (void)data; #endif diff --git a/lib/sendf.c b/lib/sendf.c index 339a8773b4..9b6908f92d 100644 --- a/lib/sendf.c +++ b/lib/sendf.c @@ -203,8 +203,8 @@ CURLcode Curl_cwriter_def_write(struct Curl_easy *data, void Curl_cwriter_def_close(struct Curl_easy *data, struct Curl_cwriter *writer) { - (void) data; - (void) writer; + (void)data; + (void)writer; } static size_t get_max_body_write_len(struct Curl_easy *data, curl_off_t limit) diff --git a/lib/sha256.c b/lib/sha256.c index d73e0ef093..e78ad1f5d3 100644 --- a/lib/sha256.c +++ b/lib/sha256.c @@ -25,8 +25,8 @@ #include "curl_setup.h" -#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) \ - || defined(USE_LIBSSH2) || defined(USE_SSL) +#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \ + defined(USE_LIBSSH2) || defined(USE_SSL) #include "curlx/warnless.h" #include "curl_sha256.h" @@ -135,9 +135,9 @@ typedef mbedtls_sha256_context my_sha256_ctx; static CURLcode my_sha256_init(void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) - (void) mbedtls_sha256_starts(ctx, 0); + (void)mbedtls_sha256_starts(ctx, 0); #else - (void) mbedtls_sha256_starts_ret(ctx, 0); + (void)mbedtls_sha256_starts_ret(ctx, 0); #endif return CURLE_OK; } @@ -147,18 +147,18 @@ static void my_sha256_update(void *ctx, unsigned int length) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) - (void) mbedtls_sha256_update(ctx, data, length); + (void)mbedtls_sha256_update(ctx, data, length); #else - (void) mbedtls_sha256_update_ret(ctx, data, length); + (void)mbedtls_sha256_update_ret(ctx, data, length); #endif } static void my_sha256_final(unsigned char *digest, void *ctx) { #if !defined(HAS_MBEDTLS_RESULT_CODE_BASED_FUNCTIONS) - (void) mbedtls_sha256_finish(ctx, digest); + (void)mbedtls_sha256_finish(ctx, digest); #else - (void) mbedtls_sha256_finish_ret(ctx, digest); + (void)mbedtls_sha256_finish_ret(ctx, digest); #endif } @@ -167,7 +167,7 @@ typedef CC_SHA256_CTX my_sha256_ctx; static CURLcode my_sha256_init(void *ctx) { - (void) CC_SHA256_Init(ctx); + (void)CC_SHA256_Init(ctx); return CURLE_OK; } @@ -175,12 +175,12 @@ static void my_sha256_update(void *ctx, const unsigned char *data, unsigned int length) { - (void) CC_SHA256_Update(ctx, data, length); + (void)CC_SHA256_Update(ctx, data, length); } static void my_sha256_final(unsigned char *digest, void *ctx) { - (void) CC_SHA256_Final(digest, ctx); + (void)CC_SHA256_Final(digest, ctx); } #elif defined(USE_WIN32_CRYPTO) diff --git a/lib/smb.c b/lib/smb.c index 3eee16468d..3b839fdffb 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -496,7 +496,7 @@ static CURLcode smb_connect(struct Curl_easy *data, bool *done) struct smb_conn *smbc = Curl_conn_meta_get(conn, CURL_META_SMB_CONN); char *slash; - (void) done; + (void)done; if(!smbc) return CURLE_FAILED_INIT; diff --git a/lib/smtp.c b/lib/smtp.c index 7bfe0631ea..af8e69de5a 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1892,7 +1892,7 @@ static CURLcode smtp_parse_address(const char *fqma, char **address, host->name = host->name + 1; /* Attempt to convert the hostname to IDN ACE */ - (void) Curl_idnconvert_hostname(host); + (void)Curl_idnconvert_hostname(host); /* If Curl_idnconvert_hostname() fails then we shall attempt to continue and send the hostname using UTF-8 rather than as 7-bit ACE (which is diff --git a/lib/url.c b/lib/url.c index df2a332061..68b3706679 100644 --- a/lib/url.c +++ b/lib/url.c @@ -2955,7 +2955,7 @@ static CURLcode parse_connect_to_host_port(struct Curl_easy *data, CURLcode result = CURLE_OK; #ifdef CURL_DISABLE_VERBOSE_STRINGS - (void) data; + (void)data; #endif *hostname_result = NULL; diff --git a/lib/vauth/digest_sspi.c b/lib/vauth/digest_sspi.c index 28d0b3599c..815ae60f13 100644 --- a/lib/vauth/digest_sspi.c +++ b/lib/vauth/digest_sspi.c @@ -411,7 +411,7 @@ CURLcode Curl_auth_create_digest_http_message(struct Curl_easy *data, SecBufferDesc chlg_desc; SECURITY_STATUS status; - (void) data; + (void)data; /* Query the security package for DigestSSP */ status = diff --git a/lib/vauth/krb5_gssapi.c b/lib/vauth/krb5_gssapi.c index 78f4be3dc9..fd46619d84 100644 --- a/lib/vauth/krb5_gssapi.c +++ b/lib/vauth/krb5_gssapi.c @@ -99,8 +99,8 @@ CURLcode Curl_auth_create_gssapi_user_message(struct Curl_easy *data, gss_buffer_desc input_token = GSS_C_EMPTY_BUFFER; gss_buffer_desc output_token = GSS_C_EMPTY_BUFFER; - (void) userp; - (void) passwdp; + (void)userp; + (void)passwdp; if(!krb5->spn) { gss_buffer_desc spn_token = GSS_C_EMPTY_BUFFER; diff --git a/lib/vauth/krb5_sspi.c b/lib/vauth/krb5_sspi.c index a29358569d..070a44fe12 100644 --- a/lib/vauth/krb5_sspi.c +++ b/lib/vauth/krb5_sspi.c @@ -271,7 +271,7 @@ CURLcode Curl_auth_create_gssapi_security_message(struct Curl_easy *data, SECURITY_STATUS status; #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; + (void)data; #endif /* Ensure we have a valid challenge message */ diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 5cda790dda..f06ee45831 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -235,7 +235,7 @@ static void ntlm_print_hex(FILE *handle, const char *buf, size_t len) { const char *p = buf; - (void) handle; + (void)handle; fprintf(stderr, "0x"); while(len-- > 0) @@ -269,7 +269,7 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data, size_t type2len = Curl_bufref_len(type2ref); #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; + (void)data; #endif if(type2len >= 48) { diff --git a/lib/vauth/ntlm_sspi.c b/lib/vauth/ntlm_sspi.c index 86b4bccfdf..aac9b721a2 100644 --- a/lib/vauth/ntlm_sspi.c +++ b/lib/vauth/ntlm_sspi.c @@ -206,7 +206,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data, struct ntlmdata *ntlm) { #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; + (void)data; #endif /* Ensure we have a valid type-2 message */ @@ -258,10 +258,10 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data, TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */ #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; + (void)data; #endif - (void) passwdp; - (void) userp; + (void)passwdp; + (void)userp; /* Setup the type-2 "input" security buffer */ type_2_desc.ulVersion = SECBUFFER_VERSION; diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 1e576c7134..4ed02a398c 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -98,8 +98,8 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, gss_channel_bindings_t chan_bindings = GSS_C_NO_CHANNEL_BINDINGS; struct gss_channel_bindings_struct chan; - (void) user; - (void) password; + (void)user; + (void)password; if(nego->context && nego->status == GSS_S_COMPLETE) { /* We finished successfully our part of authentication, but server diff --git a/lib/vauth/spnego_sspi.c b/lib/vauth/spnego_sspi.c index c19a1ff423..b350a68189 100644 --- a/lib/vauth/spnego_sspi.c +++ b/lib/vauth/spnego_sspi.c @@ -108,7 +108,7 @@ CURLcode Curl_auth_decode_spnego_message(struct Curl_easy *data, TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */ #if defined(CURL_DISABLE_VERBOSE_STRINGS) - (void) data; + (void)data; #endif if(nego->context && nego->status == SEC_E_OK) { diff --git a/lib/vauth/vauth.c b/lib/vauth/vauth.c index 7a85b7041f..7dd800d0c0 100644 --- a/lib/vauth/vauth.c +++ b/lib/vauth/vauth.c @@ -79,7 +79,7 @@ TCHAR *Curl_auth_build_spn(const char *service, const char *host, TCHAR *tchar_spn = NULL; TCHAR *dupe_tchar_spn = NULL; - (void) realm; + (void)realm; /* Note: We could use DsMakeSPN() or DsClientMakeSpnForTargetServer() rather than doing this ourselves but the first is only available in Windows XP diff --git a/lib/version.c b/lib/version.c index ebf20aa30a..d77197add4 100644 --- a/lib/version.c +++ b/lib/version.c @@ -428,7 +428,7 @@ static int idn_present(curl_version_info_data *info) !defined(CURL_DISABLE_HTTP) static int https_proxy_present(curl_version_info_data *info) { - (void) info; + (void)info; return Curl_ssl_supports(NULL, SSLSUPP_HTTPS_PROXY); } #endif @@ -436,7 +436,7 @@ static int https_proxy_present(curl_version_info_data *info) #if defined(USE_SSL) && defined(USE_ECH) static int ech_present(curl_version_info_data *info) { - (void) info; + (void)info; return Curl_ssl_supports(NULL, SSLSUPP_ECH); } #endif diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 0e8d8ebf14..3d937e785c 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -2487,8 +2487,8 @@ static CURLcode myssh_block_statemach(struct Curl_easy *data, if(block) { curl_socket_t fd_read = conn->sock[FIRSTSOCKET]; /* wait for the socket to become ready */ - (void) Curl_socket_check(fd_read, CURL_SOCKET_BAD, - CURL_SOCKET_BAD, left > 1000 ? 1000 : left); + (void)Curl_socket_check(fd_read, CURL_SOCKET_BAD, + CURL_SOCKET_BAD, left > 1000 ? 1000 : left); } } @@ -2807,7 +2807,7 @@ static CURLcode scp_disconnect(struct Curl_easy *data, CURLcode result = CURLE_OK; struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); - (void) dead_connection; + (void)dead_connection; if(sshc && sshc->ssh_session && sshp) { /* only if there is a session still around to use! */ @@ -2848,7 +2848,7 @@ static CURLcode scp_done(struct Curl_easy *data, CURLcode status, bool premature) { struct ssh_conn *sshc = Curl_conn_meta_get(data->conn, CURL_META_SSH_CONN); - (void) premature; /* not used */ + (void)premature; /* not used */ if(!sshc) return CURLE_FAILED_INIT; @@ -2866,7 +2866,7 @@ static CURLcode scp_send(struct Curl_easy *data, int sockindex, struct connectdata *conn = data->conn; struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); - (void) sockindex; /* we only support SCP on the fixed known primary socket */ + (void)sockindex; /* we only support SCP on the fixed known primary socket */ (void)eos; *pnwritten = 0; @@ -2899,7 +2899,7 @@ static CURLcode scp_recv(struct Curl_easy *data, int sockindex, struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); ssize_t nread; - (void) sockindex; /* we only support SCP on the fixed known primary socket */ + (void)sockindex; /* we only support SCP on the fixed known primary socket */ *pnread = 0; if(!sshc) @@ -2984,7 +2984,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); CURLcode result = CURLE_OK; - (void) dead_connection; + (void)dead_connection; DEBUGF(infof(data, "SSH DISCONNECT starts now")); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index d599d3cc50..ab57dd87f5 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3695,7 +3695,7 @@ static CURLcode scp_disconnect(struct Curl_easy *data, CURLcode result = CURLE_OK; struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); - (void) dead_connection; + (void)dead_connection; if(sshc && sshc->ssh_session && sshp) { /* only if there is a session still around to use! */ @@ -3867,7 +3867,7 @@ static CURLcode sftp_disconnect(struct Curl_easy *data, CURLcode result = CURLE_OK; struct ssh_conn *sshc = Curl_conn_meta_get(conn, CURL_META_SSH_CONN); struct SSHPROTO *sshp = Curl_meta_get(data, CURL_META_SSH_EASY); - (void) dead_connection; + (void)dead_connection; DEBUGF(infof(data, "SSH DISCONNECT starts now")); diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index 8aa073e8cc..9f5ab46659 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -2121,7 +2121,7 @@ static void gtls_close(struct Curl_cfilter *cf, struct gtls_ssl_backend_data *backend = (struct gtls_ssl_backend_data *)connssl->backend; - (void) data; + (void)data; DEBUGASSERT(backend); CURL_TRC_CF(data, cf, "close"); if(backend->gtls.session) { diff --git a/lib/vtls/hostcheck.c b/lib/vtls/hostcheck.c index 68af9be57d..23ba33951f 100644 --- a/lib/vtls/hostcheck.c +++ b/lib/vtls/hostcheck.c @@ -24,8 +24,7 @@ #include "../curl_setup.h" -#if defined(USE_OPENSSL) \ - || defined(USE_SCHANNEL) +#if defined(USE_OPENSSL) || defined(USE_SCHANNEL) /* these backends use functions from this file */ #ifdef HAVE_NETINET_IN_H diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 75190d30f3..5094d8a121 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -104,8 +104,7 @@ struct mbed_ssl_backend_data { }; /* apply threading? */ -#if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || \ - defined(_WIN32) +#if (defined(USE_THREADS_POSIX) && defined(HAVE_PTHREAD_H)) || defined(_WIN32) #define HAS_THREADING_SUPPORT #endif @@ -171,9 +170,9 @@ static void mbed_debug(void *context, int level, const char *f_name, int line_nb, const char *line) { struct Curl_easy *data = (struct Curl_easy *)context; - (void) level; - (void) line_nb; - (void) f_name; + (void)level; + (void)line_nb; + (void)f_name; if(data) { size_t len = strlen(line); @@ -412,7 +411,7 @@ mbed_set_selected_ciphers(struct Curl_easy *data, return CURLE_OUT_OF_MEMORY; #ifndef HAS_TLS13_SUPPORT - (void) ciphers13, (void) j; + (void)ciphers13, (void)j; #else if(!ciphers13) { /* Add default TLSv1.3 ciphers to selection */ @@ -501,8 +500,8 @@ static void mbed_dump_cert_info(struct Curl_easy *data, const mbedtls_x509_crt *crt) { #if defined(CURL_DISABLE_VERBOSE_STRINGS) || \ - (MBEDTLS_VERSION_NUMBER >= 0x03000000 && defined(MBEDTLS_X509_REMOVE_INFO)) - (void) data, (void) crt; + (MBEDTLS_VERSION_NUMBER >= 0x03000000 && defined(MBEDTLS_X509_REMOVE_INFO)) + (void)data, (void)crt; #else const size_t bufsize = 16384; char *p, *buffer = malloc(bufsize); diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index d47365c0b5..ebe762a89a 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1940,7 +1940,7 @@ static CURLcode ossl_set_engine_default(struct Curl_easy *data) } } #else - (void) data; + (void)data; #endif return CURLE_OK; } @@ -1963,7 +1963,7 @@ static struct curl_slist *ossl_engines_list(struct Curl_easy *data) list = beg; } #endif - (void) data; + (void)data; return list; } @@ -2819,7 +2819,7 @@ static void ossl_trace(int direction, int ssl_ver, int content_type, Curl_debug(data, (direction == 1) ? CURLINFO_SSL_DATA_OUT : CURLINFO_SSL_DATA_IN, (const char *)buf, len); - (void) ssl; + (void)ssl; } #endif @@ -2941,7 +2941,7 @@ ossl_set_ssl_version_min_max_legacy(ctx_option_t *ctx_options, long ssl_version = conn_config->version; long ssl_version_max = conn_config->version_max; - (void) data; /* In case it is unused. */ + (void)data; /* In case it is unused. */ switch(ssl_version) { case CURL_SSLVERSION_TLSv1_3: @@ -5598,7 +5598,7 @@ static CURLcode ossl_sha256sum(const unsigned char *tmp, /* input */ { EVP_MD_CTX *mdctx; unsigned int len = 0; - (void) unused; + (void)unused; mdctx = EVP_MD_CTX_create(); if(!mdctx) diff --git a/lib/vtls/schannel_int.h b/lib/vtls/schannel_int.h index cc478e4174..8717919259 100644 --- a/lib/vtls/schannel_int.h +++ b/lib/vtls/schannel_int.h @@ -30,13 +30,13 @@ #include "vtls.h" -#if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) \ - && !defined(CURL_WINDOWS_UWP) +#if (defined(__MINGW32__) || defined(CERT_CHAIN_REVOCATION_CHECK_CHAIN)) && \ + !defined(CURL_WINDOWS_UWP) #define HAS_MANUAL_VERIFY_API #endif -#if defined(CryptStringToBinary) && defined(CRYPT_STRING_HEX) \ - && !defined(DISABLE_SCHANNEL_CLIENT_CERT) +#if defined(CryptStringToBinary) && defined(CRYPT_STRING_HEX) && \ + !defined(DISABLE_SCHANNEL_CLIENT_CERT) #define HAS_CLIENT_CERT_PATH #endif diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index 7db13f2a25..a083922169 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -801,8 +801,8 @@ CURLcode Curl_verify_certificate(struct Curl_cfilter *cf, #ifndef UNDER_CE if(result == CURLE_OK && - (conn_config->CAfile || conn_config->ca_info_blob) && - BACKEND->use_manual_cred_validation) { + (conn_config->CAfile || conn_config->ca_info_blob) && + BACKEND->use_manual_cred_validation) { /* * Create a chain engine that uses the certificates in the CA file as * trusted certificates. This is only supported on Windows 7+. diff --git a/lib/vtls/wolfssl.c b/lib/vtls/wolfssl.c index bfc218d547..f6e1e6446a 100644 --- a/lib/vtls/wolfssl.c +++ b/lib/vtls/wolfssl.c @@ -931,7 +931,7 @@ wssl_legacy_CTX_set_min_proto_version(WOLFSSL_CTX* ctx, int version) static int wssl_legacy_CTX_set_max_proto_version(WOLFSSL_CTX* ctx, int version) { - (void) ctx, (void) version; + (void)ctx, (void)version; return WOLFSSL_NOT_IMPLEMENTED; } #define wolfSSL_CTX_set_min_proto_version wssl_legacy_CTX_set_min_proto_version @@ -1967,7 +1967,7 @@ static void wssl_close(struct Curl_cfilter *cf, struct Curl_easy *data) struct ssl_connect_data *connssl = cf->ctx; struct wssl_ctx *wssl = (struct wssl_ctx *)connssl->backend; - (void) data; + (void)data; DEBUGASSERT(wssl); diff --git a/lib/ws.c b/lib/ws.c index 1f05189a6e..829ccfc822 100644 --- a/lib/ws.c +++ b/lib/ws.c @@ -587,7 +587,7 @@ static CURLcode ws_cw_init(struct Curl_easy *data, static void ws_cw_close(struct Curl_easy *data, struct Curl_cwriter *writer) { struct ws_cw_ctx *ctx = writer->ctx; - (void) data; + (void)data; Curl_bufq_free(&ctx->buf); } diff --git a/packages/vms/gnv_conftest.c_first b/packages/vms/gnv_conftest.c_first index 317b1abfc7..a40f763a19 100644 --- a/packages/vms/gnv_conftest.c_first +++ b/packages/vms/gnv_conftest.c_first @@ -35,7 +35,7 @@ char RAND_status(void) {return 0;} /* char RAND_screen(void) {return 0;} In headers, but not present */ char CRYPTO_cleanup_all_ex_data(void) {return 0;} char SSL_get_shutdown(void) {return 0;} -char ENGINE_load_builtin_engines (void) {return 0;} +char ENGINE_load_builtin_engines(void) {return 0;} /* And these are to pass the test that uses headers. */ /* Because the HP OpenSSL transfer vectors are currently in Upper case only */ diff --git a/src/config2setopts.c b/src/config2setopts.c index 8e4af65bae..55e30ee761 100644 --- a/src/config2setopts.c +++ b/src/config2setopts.c @@ -640,7 +640,7 @@ static void gen_cb_setopts(struct OperationConfig *config, CURL *curl) { struct GlobalConfig *global = config->global; - (void) config; + (void)config; /* where to store */ my_setopt(curl, CURLOPT_WRITEDATA, per); my_setopt(curl, CURLOPT_INTERLEAVEDATA, per); diff --git a/src/curlinfo.c b/src/curlinfo.c index 054dcd251b..d601904f3e 100644 --- a/src/curlinfo.c +++ b/src/curlinfo.c @@ -244,8 +244,8 @@ int main(int argc, char **argv) { int i; - (void) argc; - (void) argv; + (void)argc; + (void)argv; for(i = 0; disabled[i]; i++) printf("%s\n", disabled[i]); diff --git a/src/mkhelp.pl b/src/mkhelp.pl index e104e49f18..782c466524 100755 --- a/src/mkhelp.pl +++ b/src/mkhelp.pl @@ -98,13 +98,13 @@ HEAD #define BUF_SIZE 0x10000 static voidpf zalloc_func(voidpf opaque, unsigned int items, unsigned int size) { - (void) opaque; + (void)opaque; /* not a typo, keep it calloc() */ return (voidpf) calloc(items, size); } static void zfree_func(voidpf opaque, voidpf ptr) { - (void) opaque; + (void)opaque; free(ptr); } diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 2904ea7c7b..e988224ac8 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -56,7 +56,7 @@ static char *parse_filename(const char *ptr, size_t len); #ifdef LINK static void write_linked_location(CURL *curl, const char *location, - size_t loclen, FILE *stream); + size_t loclen, FILE *stream); #endif int tool_write_headers(struct HdrCbData *hdrcbdata, FILE *stream) @@ -81,7 +81,6 @@ fail: /* ** callback for CURLOPT_HEADERFUNCTION */ - size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) { struct per_transfer *per = userdata; @@ -402,9 +401,9 @@ static char *parse_filename(const char *ptr, size_t len) * should not be needed but the real world returns plenty of relative * URLs here. */ -static -void write_linked_location(CURL *curl, const char *location, size_t loclen, - FILE *stream) { +static void write_linked_location(CURL *curl, const char *location, + size_t loclen, FILE *stream) +{ /* This would so simple if CURLINFO_REDIRECT_URL were available here */ CURLU *u = NULL; char *copyloc = NULL, *locurl = NULL, *scheme = NULL, *finalurl = NULL; diff --git a/src/tool_dirhie.c b/src/tool_dirhie.c index e4e3e859e7..24759a642b 100644 --- a/src/tool_dirhie.c +++ b/src/tool_dirhie.c @@ -35,7 +35,7 @@ #if defined(_WIN32) || (defined(MSDOS) && !defined(__DJGPP__)) # define mkdir(x,y) (mkdir)((x)) # ifndef F_OK -# define F_OK 0 +# define F_OK 0 # endif #endif diff --git a/src/tool_filetime.c b/src/tool_filetime.c index 1b62e7add7..f4ff3a4291 100644 --- a/src/tool_filetime.c +++ b/src/tool_filetime.c @@ -151,5 +151,4 @@ void setfiletime(curl_off_t filetime, const char *filename, #endif } } -#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || \ - defined(_WIN32) */ +#endif /* defined(HAVE_UTIME) || defined(HAVE_UTIMES) || defined(_WIN32) */ diff --git a/src/tool_formparse.c b/src/tool_formparse.c index f93ba03bfc..84d6a029ba 100644 --- a/src/tool_formparse.c +++ b/src/tool_formparse.c @@ -204,7 +204,7 @@ size_t tool_mime_stdin_read(char *buffer, { struct tool_mime *sip = (struct tool_mime *) arg; curl_off_t bytesleft; - (void) size; /* Always 1: ignored. */ + (void)size; /* Always 1: ignored. */ if(sip->size >= 0) { if(sip->curpos >= sip->size) diff --git a/src/tool_setopt.c b/src/tool_setopt.c index 48fc4e8e37..9e4f6e59fc 100644 --- a/src/tool_setopt.c +++ b/src/tool_setopt.c @@ -217,7 +217,7 @@ static char *c_escape(const char *str, curl_off_t len) result = curlx_dyn_addn(&escaped, str, s - str); if(!result) - (void) !curlx_dyn_addn(&escaped, "...", cutoff); + (void)!curlx_dyn_addn(&escaped, "...", cutoff); return curlx_dyn_ptr(&escaped); } diff --git a/src/tool_setopt.h b/src/tool_setopt.h index 93c33f4b70..8869f2e781 100644 --- a/src/tool_setopt.h +++ b/src/tool_setopt.h @@ -143,7 +143,7 @@ CURLcode tool_setopt(CURL *curl, bool str, #define my_setopt_offt(x,y,z) \ curl_easy_setopt(x, y, (curl_off_t)(z)) -#define my_setopt_str(x,y,z) \ +#define my_setopt_str(x,y,z) \ curl_easy_setopt(x, y, z) #define my_setopt_enum(x,y,z) \ diff --git a/src/tool_vms.c b/src/tool_vms.c index 143b2f0d53..5beb89d2ec 100644 --- a/src/tool_vms.c +++ b/src/tool_vms.c @@ -26,7 +26,7 @@ #ifdef __VMS #if defined(__DECC) && !defined(__VAX) && \ - defined(__CRTL_VER) && (__CRTL_VER >= 70301000) + defined(__CRTL_VER) && (__CRTL_VER >= 70301000) #include #endif @@ -107,7 +107,7 @@ void vms_special_exit(int code, int vms_show) } #if defined(__DECC) && !defined(__VAX) && \ - defined(__CRTL_VER) && (__CRTL_VER >= 70301000) + defined(__CRTL_VER) && (__CRTL_VER >= 70301000) /* * 2004-09-19 SMS. diff --git a/src/tool_vms.h b/src/tool_vms.h index cc2d31d053..3da816cf67 100644 --- a/src/tool_vms.h +++ b/src/tool_vms.h @@ -40,8 +40,8 @@ void vms_special_exit(int code, int vms_show); #undef exit #define exit(__code) vms_special_exit((__code), (0)) -#define VMS_STS(c,f,e,s) (((c&0xF)<<28)|((f&0xFFF)<<16)|((e&0x1FFF)<3)|(s&7)) -#define VMSSTS_HIDE VMS_STS(1,0,0,0) +#define VMS_STS(c,f,e,s) (((c&0xF)<<28)|((f&0xFFF)<<16)|((e&0x1FFF)<3)|(s&7)) +#define VMSSTS_HIDE VMS_STS(1,0,0,0) #endif /* __VMS */ diff --git a/tests/libtest/lib1156.c b/tests/libtest/lib1156.c index 986dcb57ad..a3e0815372 100644 --- a/tests/libtest/lib1156.c +++ b/tests/libtest/lib1156.c @@ -71,12 +71,12 @@ static const struct testparams testparams[] = { CURLE_OK } }; -static int hasbody; +static int hasbody; static size_t writedata(char *data, size_t size, size_t nmemb, void *userdata) { - (void) data; - (void) userdata; + (void)data; + (void)userdata; if(size && nmemb) hasbody = 1; diff --git a/tests/libtest/lib1522.c b/tests/libtest/lib1522.c index f714b9f555..1057ef7e3d 100644 --- a/tests/libtest/lib1522.c +++ b/tests/libtest/lib1522.c @@ -33,8 +33,8 @@ static int sockopt_callback(void *clientp, curl_socket_t curlfd, { #if defined(SOL_SOCKET) && defined(SO_SNDBUF) int sndbufsize = 4 * 1024; /* 4KB send buffer */ - (void) clientp; - (void) purpose; + (void)clientp; + (void)purpose; setsockopt(curlfd, SOL_SOCKET, SO_SNDBUF, (char *)&sndbufsize, sizeof(sndbufsize)); #else diff --git a/tests/libtest/lib3026.c b/tests/libtest/lib3026.c index 781d9cfb8b..0aefd9b724 100644 --- a/tests/libtest/lib3026.c +++ b/tests/libtest/lib3026.c @@ -54,7 +54,7 @@ static CURLcode test_lib3026(char *URL) unsigned tid_count = NUM_THREADS, i; CURLcode test_failure = CURLE_OK; curl_version_info_data *ver; - (void) URL; + (void)URL; ver = curl_version_info(CURLVERSION_NOW); if((ver->features & CURL_VERSION_THREADSAFE) == 0) { @@ -118,7 +118,7 @@ static CURLcode test_lib3026(char *URL) unsigned tid_count = NUM_THREADS, i; CURLcode test_failure = CURLE_OK; curl_version_info_data *ver; - (void) URL; + (void)URL; ver = curl_version_info(CURLVERSION_NOW); if((ver->features & CURL_VERSION_THREADSAFE) == 0) { diff --git a/tests/libtest/lib3207.c b/tests/libtest/lib3207.c index b5fb4481d9..177230a82b 100644 --- a/tests/libtest/lib3207.c +++ b/tests/libtest/lib3207.c @@ -161,7 +161,7 @@ static void execute(CURLSH *share, struct Ctx *ctx) static void execute(CURLSH *share, struct Ctx *ctx) { size_t i; - (void) share; + (void)share; for(i = 0; i < THREAD_SIZE; i++) { test_thread((void *)&ctx[i]); } diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c index d20a8f2b52..f6a4b692ab 100644 --- a/tests/libtest/lib650.c +++ b/tests/libtest/lib650.c @@ -34,7 +34,7 @@ static size_t count_chars(void *userp, const char *buf, size_t len) { size_t *pcounter = (size_t *) userp; - (void) buf; + (void)buf; *pcounter += len; return len; } diff --git a/tests/libtest/lib668.c b/tests/libtest/lib668.c index c787288e66..1eaf5b15f3 100644 --- a/tests/libtest/lib668.c +++ b/tests/libtest/lib668.c @@ -35,7 +35,7 @@ static size_t t668_read_cb(char *ptr, size_t size, size_t nmemb, void *userp) struct t668_WriteThis *pooh = (struct t668_WriteThis *)userp; size_t len = strlen(pooh->readptr); - (void) size; /* Always 1.*/ + (void)size; /* Always 1.*/ if(len > nmemb) len = nmemb; diff --git a/tests/libtest/lib670.c b/tests/libtest/lib670.c index eb3a6bac1c..f77458eff2 100644 --- a/tests/libtest/lib670.c +++ b/tests/libtest/lib670.c @@ -65,10 +65,10 @@ static int t670_xferinfo(void *clientp, { struct t670_ReadThis *pooh = (struct t670_ReadThis *) clientp; - (void) dltotal; - (void) dlnow; - (void) ultotal; - (void) ulnow; + (void)dltotal; + (void)dlnow; + (void)ultotal; + (void)ulnow; if(pooh->origin) { time_t delta = time(NULL) - pooh->origin; diff --git a/tests/libtest/lib678.c b/tests/libtest/lib678.c index 48a54b0527..2461769f8f 100644 --- a/tests/libtest/lib678.c +++ b/tests/libtest/lib678.c @@ -76,10 +76,10 @@ static CURLcode test_cert_blob(const char *url, const char *cafile) } if(loadfile(cafile, &certdata, &certsize)) { - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); - curl_easy_setopt(curl, CURLOPT_HEADER, 1L); - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_USERAGENT, "CURLOPT_CAINFO_BLOB"); + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); + curl_easy_setopt(curl, CURLOPT_HEADER, 1L); + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_USERAGENT, "CURLOPT_CAINFO_BLOB"); curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_REVOKE_BEST_EFFORT); diff --git a/tests/libtest/lib695.c b/tests/libtest/lib695.c index 4eed2b8d17..70b7903055 100644 --- a/tests/libtest/lib695.c +++ b/tests/libtest/lib695.c @@ -28,8 +28,8 @@ /* write callback that does nothing */ static size_t write_it(char *ptr, size_t size, size_t nmemb, void *userdata) { - (void) ptr; - (void) userdata; + (void)ptr; + (void)userdata; return size * nmemb; } diff --git a/tests/runtests.pl b/tests/runtests.pl index 43718fa58b..3908c1a25a 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -865,18 +865,18 @@ sub checksystemfeatures { } # display summary information about curl and the test host - logmsg ("********* System characteristics ******** \n", - "* $curl\n", - "* $libcurl\n", - "* Protocols: $proto\n", - "* Features: $feat\n", - "* Disabled: $dis\n", - "* Host: $hostname\n", - "* System: $hosttype\n", - "* OS: $hostos\n", - "* Perl: $^V ($^X)\n", - "* diff: $havediff\n", - "* Args: $args\n"); + logmsg("********* System characteristics ******** \n", + "* $curl\n", + "* $libcurl\n", + "* Protocols: $proto\n", + "* Features: $feat\n", + "* Disabled: $dis\n", + "* Host: $hostname\n", + "* System: $hosttype\n", + "* OS: $hostos\n", + "* Perl: $^V ($^X)\n", + "* diff: $havediff\n", + "* Args: $args\n"); if($jobs) { # Only show if not the default for now @@ -895,7 +895,7 @@ sub checksystemfeatures { $run_event_based?"event-based ":"", $nghttpx_h3); logmsg sprintf("%s\n", $libtool?"Libtool ":""); - logmsg ("* Seed: $randseed\n"); + logmsg "* Seed: $randseed\n"; } ####################################################################### diff --git a/tests/server/dnsd.c b/tests/server/dnsd.c index e64fa64222..389c066c82 100644 --- a/tests/server/dnsd.c +++ b/tests/server/dnsd.c @@ -619,7 +619,6 @@ static int test_dnsd(int argc, char **argv) } logmsg("end of one transfer"); - } dnsd_cleanup: diff --git a/tests/server/mqttd.c b/tests/server/mqttd.c index d42b277d93..76ef715011 100644 --- a/tests/server/mqttd.c +++ b/tests/server/mqttd.c @@ -228,11 +228,8 @@ static int disconnect(FILE *dump, curl_socket_t fd) return 1; } - - /* do - encodedByte = X MOD 128 X = X DIV 128 diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c index 7730187875..7f1ce81022 100644 --- a/tests/server/rtspd.c +++ b/tests/server/rtspd.c @@ -120,22 +120,22 @@ static const char *docbadconnect = /* send back this on HTTP 404 file not found */ static const char *doc404_HTTP = "HTTP/1.1 404 Not Found\r\n" - "Server: " RTSPDVERSION "\r\n" - "Connection: close\r\n" - "Content-Type: text/html" - END_OF_HEADERS - "\n" - "\n" - "404 Not Found\n" - "\n" - "

Not Found

\n" - "The requested URL was not found on this server.\n" - "


" RTSPDVERSION "
\n" "\n"; + "Server: " RTSPDVERSION "\r\n" + "Connection: close\r\n" + "Content-Type: text/html" + END_OF_HEADERS + "\n" + "\n" + "404 Not Found\n" + "\n" + "

Not Found

\n" + "The requested URL was not found on this server.\n" + "


" RTSPDVERSION "
\n" "\n"; /* send back this on RTSP 404 file not found */ static const char *doc404_RTSP = "RTSP/1.0 404 Not Found\r\n" - "Server: " RTSPDVERSION - END_OF_HEADERS; + "Server: " RTSPDVERSION + END_OF_HEADERS; /* Default size to send away fake RTP data */ #define RTP_DATA_SIZE 12 diff --git a/tests/server/sws.c b/tests/server/sws.c index 871248b4d0..f49f22339d 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -143,17 +143,17 @@ static const char *docquit_sws = /* send back this on 404 file not found */ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n" - "Server: " SWSVERSION "\r\n" - "Connection: close\r\n" - "Content-Type: text/html" - END_OF_HEADERS - "\n" - "\n" - "404 Not Found\n" - "\n" - "

Not Found

\n" - "The requested URL was not found on this server.\n" - "


" SWSVERSION "
\n" "\n"; + "Server: " SWSVERSION "\r\n" + "Connection: close\r\n" + "Content-Type: text/html" + END_OF_HEADERS + "\n" + "\n" + "404 Not Found\n" + "\n" + "

Not Found

\n" + "The requested URL was not found on this server.\n" + "


" SWSVERSION "
\n" "\n"; /* work around for handling trailing headers */ static int already_recv_zeroed_chunk = FALSE; @@ -405,7 +405,6 @@ static int sws_ProcessRequest(struct sws_httprequest *req) logmsg("No test number in path"); req->testno = DOCNUMBER_NOTHING; } - } if(req->testno == DOCNUMBER_NOTHING) { diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index fc08c729ed..bd2d42bd6f 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -510,13 +510,13 @@ static int synchnet(curl_socket_t f /* socket to flush */) for(;;) { #if defined(HAVE_IOCTLSOCKET_CAMEL_FIONBIO) long i; - (void) IoctlSocket(f, FIONBIO, &i); + (void)IoctlSocket(f, FIONBIO, &i); #elif defined(HAVE_IOCTLSOCKET) unsigned long i; - (void) ioctlsocket(f, FIONREAD, &i); + (void)ioctlsocket(f, FIONREAD, &i); #else int i; - (void) ioctl(f, FIONREAD, &i); + (void)ioctl(f, FIONREAD, &i); #endif if(i) { j++; @@ -528,8 +528,8 @@ static int synchnet(curl_socket_t f /* socket to flush */) else fromaddrlen = sizeof(fromaddr.sa6); #endif - (void) recvfrom(f, rbuf, sizeof(rbuf), 0, - &fromaddr.sa, &fromaddrlen); + (void)recvfrom(f, rbuf, sizeof(rbuf), 0, + &fromaddr.sa, &fromaddrlen); } else break; @@ -1179,7 +1179,7 @@ static void sendtftp(struct testcase *test, const struct formats *pf) sdp->th_block = htons(sendblock); timeout = 0; #ifdef HAVE_SIGSETJMP - (void) sigsetjmp(timeoutbuf, 1); + (void)sigsetjmp(timeoutbuf, 1); #endif if(test->writedelay) { logmsg("Pausing %d seconds before %d bytes", test->writedelay, @@ -1223,7 +1223,7 @@ send_data: break; } /* Re-synchronize with the other side */ - (void) synchnet(peer); + (void)synchnet(peer); if(sap->th_block == (sendblock-1)) { goto send_data; } @@ -1257,7 +1257,7 @@ static void recvtftp(struct testcase *test, const struct formats *pf) rap->th_block = htons(recvblock); recvblock++; #ifdef HAVE_SIGSETJMP - (void) sigsetjmp(timeoutbuf, 1); + (void)sigsetjmp(timeoutbuf, 1); #endif send_ack: logmsg("write"); @@ -1291,7 +1291,7 @@ send_ack: break; /* normal */ } /* Re-synchronize with the other side */ - (void) synchnet(peer); + (void)synchnet(peer); if(rdp->th_block == (recvblock-1)) goto send_ack; /* rexmit */ } @@ -1315,7 +1315,7 @@ send_ack: rap->th_opcode = htons(opcode_ACK); /* send the "final" ack */ rap->th_block = htons(recvblock); - (void) swrite(peer, &ackbuf.storage[0], 4); + (void)swrite(peer, &ackbuf.storage[0], 4); #if defined(HAVE_ALARM) && defined(SIGALRM) mysignal(SIGALRM, justtimeout); /* just abort read on timeout */ alarm(rexmtval); @@ -1330,7 +1330,7 @@ send_ack: if(n >= 4 && /* if read some data */ rdp->th_opcode == opcode_DATA && /* and got a data block */ recvblock == rdp->th_block) { /* then my last ack was lost */ - (void) swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */ + (void)swrite(peer, &ackbuf.storage[0], 4); /* resend final ack */ } abort: /* make sure the output file is closed in case of abort */ diff --git a/tests/server/util.c b/tests/server/util.c index b4d0e92c0d..26a5dd17f7 100644 --- a/tests/server/util.c +++ b/tests/server/util.c @@ -153,7 +153,7 @@ static void win32_cleanup(void) { #ifdef USE_WINSOCK WSACleanup(); -#endif /* USE_WINSOCK */ +#endif /* flush buffers of all streams regardless of their mode */ _flushall(); @@ -560,7 +560,7 @@ static SIGHANDLER_T set_signal(int signum, SIGHANDLER_T handler, if(oldhdlr != SIG_ERR) siginterrupt(signum, (int) restartable); #else - (void) restartable; + (void)restartable; #endif return oldhdlr; @@ -640,31 +640,31 @@ void restore_signal_handlers(bool keep_sigalrm) { #ifdef SIGHUP if(SIG_ERR != old_sighup_handler) - (void) set_signal(SIGHUP, old_sighup_handler, FALSE); + (void)set_signal(SIGHUP, old_sighup_handler, FALSE); #endif #ifdef SIGPIPE if(SIG_ERR != old_sigpipe_handler) - (void) set_signal(SIGPIPE, old_sigpipe_handler, FALSE); + (void)set_signal(SIGPIPE, old_sigpipe_handler, FALSE); #endif #ifdef SIGALRM if(!keep_sigalrm) { if(SIG_ERR != old_sigalrm_handler) - (void) set_signal(SIGALRM, old_sigalrm_handler, FALSE); + (void)set_signal(SIGALRM, old_sigalrm_handler, FALSE); } #else (void)keep_sigalrm; #endif #ifdef SIGINT if(SIG_ERR != old_sigint_handler) - (void) set_signal(SIGINT, old_sigint_handler, FALSE); + (void)set_signal(SIGINT, old_sigint_handler, FALSE); #endif #ifdef SIGTERM if(SIG_ERR != old_sigterm_handler) - (void) set_signal(SIGTERM, old_sigterm_handler, FALSE); + (void)set_signal(SIGTERM, old_sigterm_handler, FALSE); #endif #if defined(SIGBREAK) && defined(_WIN32) if(SIG_ERR != old_sigbreak_handler) - (void) set_signal(SIGBREAK, old_sigbreak_handler, FALSE); + (void)set_signal(SIGBREAK, old_sigbreak_handler, FALSE); #endif #ifdef _WIN32 #ifndef UNDER_CE diff --git a/tests/unit/unit1601.c b/tests/unit/unit1601.c index c80622ba13..b29d075dab 100644 --- a/tests/unit/unit1601.c +++ b/tests/unit/unit1601.c @@ -29,8 +29,8 @@ static CURLcode test_unit1601(char *arg) { UNITTEST_BEGIN_SIMPLE -#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) \ - || !defined(CURL_DISABLE_DIGEST_AUTH) +#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ + !defined(CURL_DISABLE_DIGEST_AUTH) static const char string1[] = "1"; static const char string2[] = "hello-you-fool"; diff --git a/tests/unit/unit1610.c b/tests/unit/unit1610.c index 2cded4df46..e008b062b7 100644 --- a/tests/unit/unit1610.c +++ b/tests/unit/unit1610.c @@ -36,8 +36,8 @@ static CURLcode test_unit1610(char *arg) { UNITTEST_BEGIN(t1610_setup()) -#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) \ - || defined(USE_LIBSSH2) +#if !defined(CURL_DISABLE_AWS) || !defined(CURL_DISABLE_DIGEST_AUTH) || \ + defined(USE_LIBSSH2) static const char string1[] = "1"; static const char string2[] = "hello-you-fool"; diff --git a/tests/unit/unit1612.c b/tests/unit/unit1612.c index 8faf67f85f..1bbe31569d 100644 --- a/tests/unit/unit1612.c +++ b/tests/unit/unit1612.c @@ -30,8 +30,8 @@ static CURLcode test_unit1612(char *arg) { UNITTEST_BEGIN_SIMPLE -#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) \ - || !defined(CURL_DISABLE_DIGEST_AUTH) +#if (defined(USE_CURL_NTLM_CORE) && !defined(USE_WINDOWS_SSPI)) || \ + !defined(CURL_DISABLE_DIGEST_AUTH) static const char password[] = "Pa55worD"; static const char string1[] = "1"; diff --git a/tests/unit/unit1651.c b/tests/unit/unit1651.c index aab5c37e8a..b6c37c9b57 100644 --- a/tests/unit/unit1651.c +++ b/tests/unit/unit1651.c @@ -363,7 +363,7 @@ static CURLcode test_unit1651(char *arg) for(i = 0; i < 45; i++) { unsigned char backup = cert[i]; cert[i] = (unsigned char) (byte & 0xff); - (void) Curl_extract_certinfo(data, 0, beg, end); + (void)Curl_extract_certinfo(data, 0, beg, end); cert[i] = backup; } } diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc index 8bdb22d6c4..1d8ffcc736 100644 --- a/winbuild/MakefileBuild.vc +++ b/winbuild/MakefileBuild.vc @@ -52,7 +52,7 @@ CFLAGS = /I. /I../lib /I../include /nologo /W4 /GX /YX /FD /c /DBUILDING_LI !ELSE CC_NODEBUG = $(CC) /O2 /DNDEBUG CC_DEBUG = $(CC) /Od /D_DEBUG /RTC1 /Z7 /LDd -CFLAGS = /I. /I ../lib /I../include /nologo /W4 /EHsc /FD /c /DBUILDING_LIBCURL +CFLAGS = /I. /I../lib /I../include /nologo /W4 /EHsc /FD /c /DBUILDING_LIBCURL !ENDIF LFLAGS = /nologo /machine:$(MACHINE)