tidy-up: more whitespace/indent, comments

Also a couple of minor formatting updates in the root `CMakeLists.txt`.
One swap to `#ifdef`.

Closes #17929
This commit is contained in:
Viktor Szakats 2025-07-14 17:08:05 +02:00
parent 63a8167f3e
commit 4d977fe552
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
82 changed files with 351 additions and 378 deletions

View File

@ -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)

View File

@ -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 <proto/bsdsocket.h>
#ifdef __amigaos4__
struct SocketIFace *ISocket = NULL;
#else
struct Library *SocketBase = NULL;
#endif
#define __USE_INLINE__
#include <proto/bsdsocket.h>
#ifdef __amigaos4__
struct SocketIFace *ISocket = NULL;
#else
struct Library *SocketBase = NULL;
#endif
]],[[
unsigned char host[] = "localhost";
gethostbyname(host);

View File

@ -144,7 +144,7 @@ static void StartElement(void *voidContext,
context->title = "";
context->addTitle = true;
}
(void) attributes;
(void)attributes;
}
//

View File

@ -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);
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -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"

View File

@ -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;

View File

@ -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 <curl/curl.h>
#include "curl_hmac.h"

View File

@ -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 */

View File

@ -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__

View File

@ -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()

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 */

View File

@ -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);

View File

@ -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 <string.h>
#include <curl/curl.h>
@ -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
}

View File

@ -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 <libgen.h>
@ -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;
}

View File

@ -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));
}

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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 =

View File

@ -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;

View File

@ -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 */

View File

@ -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) {

View File

@ -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;

View File

@ -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

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -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"));

View File

@ -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"));

View File

@ -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) {

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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

View File

@ -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+.

View File

@ -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);

View File

@ -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);
}

View File

@ -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 */

View File

@ -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);

View File

@ -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]);

View File

@ -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);
}

View File

@ -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;

View File

@ -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

View File

@ -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) */

View File

@ -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)

View File

@ -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);
}

View File

@ -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) \

View File

@ -26,7 +26,7 @@
#ifdef __VMS
#if defined(__DECC) && !defined(__VAX) && \
defined(__CRTL_VER) && (__CRTL_VER >= 70301000)
defined(__CRTL_VER) && (__CRTL_VER >= 70301000)
#include <unixlib.h>
#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.

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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) {

View File

@ -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]);
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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";
}
#######################################################################

View File

@ -619,7 +619,6 @@ static int test_dnsd(int argc, char **argv)
}
logmsg("end of one transfer");
}
dnsd_cleanup:

View File

@ -228,11 +228,8 @@ static int disconnect(FILE *dump, curl_socket_t fd)
return 1;
}
/*
do
encodedByte = X MOD 128
X = X DIV 128

View File

@ -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
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
"Server: " RTSPDVERSION "\r\n"
"Connection: close\r\n"
"Content-Type: text/html"
END_OF_HEADERS
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" RTSPDVERSION "</ADDRESS>\n" "</BODY></HTML>\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

View File

@ -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
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\n";
"Server: " SWSVERSION "\r\n"
"Connection: close\r\n"
"Content-Type: text/html"
END_OF_HEADERS
"<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n"
"<HTML><HEAD>\n"
"<TITLE>404 Not Found</TITLE>\n"
"</HEAD><BODY>\n"
"<H1>Not Found</H1>\n"
"The requested URL was not found on this server.\n"
"<P><HR><ADDRESS>" SWSVERSION "</ADDRESS>\n" "</BODY></HTML>\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) {

View File

@ -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 */

View File

@ -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

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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;
}
}

View File

@ -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)