diff --git a/example/sftpdir.c b/example/sftpdir.c index 815b452a..85b3947f 100644 --- a/example/sftpdir.c +++ b/example/sftpdir.c @@ -30,7 +30,7 @@ #include #include -#if defined(_MSC_VER) +#ifdef _MSC_VER #define LIBSSH2_FILESIZE_MASK "I64u" #else #define LIBSSH2_FILESIZE_MASK "llu" diff --git a/example/sftpdir_nonblock.c b/example/sftpdir_nonblock.c index 59b178c8..0e31a8d4 100644 --- a/example/sftpdir_nonblock.c +++ b/example/sftpdir_nonblock.c @@ -29,7 +29,7 @@ #include -#if defined(_MSC_VER) +#ifdef _MSC_VER #define LIBSSH2_FILESIZE_MASK "I64u" #else #define LIBSSH2_FILESIZE_MASK "llu" diff --git a/example/x11.c b/example/x11.c index 285cd611..8b83be32 100644 --- a/example/x11.c +++ b/example/x11.c @@ -347,13 +347,13 @@ int main(int argc, char *argv[]) libssh2_trace(session, LIBSSH2_TRACE_CONN); /* Set X11 Callback */ -#if defined(__clang__) +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcast-function-type" #endif libssh2_session_callback_set2(session, LIBSSH2_CALLBACK_X11, (libssh2_cb_generic *)x11_callback); -#if defined(__clang__) +#ifdef __clang__ #pragma clang diagnostic pop #endif diff --git a/src/libssh2_priv.h b/src/libssh2_priv.h index cb153a89..ff40bcfb 100644 --- a/src/libssh2_priv.h +++ b/src/libssh2_priv.h @@ -141,7 +141,7 @@ #endif /* Use local implementation when not available */ -#if !defined(HAVE_SNPRINTF) +#ifndef HAVE_SNPRINTF #undef snprintf #define snprintf _libssh2_snprintf #define LIBSSH2_SNPRINTF @@ -149,7 +149,7 @@ int _libssh2_snprintf(char *cp, size_t cp_max_len, const char *fmt, ...) LIBSSH2_PRINTF(3, 4); #endif -#if !defined(HAVE_GETTIMEOFDAY) +#ifndef HAVE_GETTIMEOFDAY #define HAVE_GETTIMEOFDAY #undef gettimeofday #define gettimeofday _libssh2_gettimeofday @@ -159,7 +159,7 @@ int _libssh2_gettimeofday(struct timeval *tp, void *tzp); #include #endif -#if !defined(LIBSSH2_FALLTHROUGH) +#ifndef LIBSSH2_FALLTHROUGH #if (defined(__GNUC__) && __GNUC__ >= 7) || \ (defined(__clang__) && __clang_major__ >= 10) # define LIBSSH2_FALLTHROUGH() __attribute__((fallthrough)) diff --git a/src/mbedtls.h b/src/mbedtls.h index dfc34821..05d26b5c 100644 --- a/src/mbedtls.h +++ b/src/mbedtls.h @@ -48,7 +48,7 @@ #if !defined(__clang__) && __GNUC__ >= 10 #pragma GCC diagnostic ignored "-Warith-conversion" #endif -#if defined(__clang__) +#ifdef __clang__ #pragma GCC diagnostic ignored "-Wsign-conversion" #endif /* mbedTLS (as of v3.5.1) has a duplicate function declaration diff --git a/src/openssl.c b/src/openssl.c index 3032b94a..c3039ffe 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -160,7 +160,7 @@ int _libssh2_hmac_update(libssh2_hmac_ctx *ctx, return EVP_MAC_update(*ctx, data, datalen); #elif defined(HAVE_OPAQUE_STRUCTS) /* FIXME: upstream bug as of v5.7.0: datalen is int instead of size_t */ -#if defined(LIBSSH2_WOLFSSL) +#ifdef LIBSSH2_WOLFSSL return HMAC_Update(*ctx, data, (int)datalen); #else /* !LIBSSH2_WOLFSSL */ return HMAC_Update(*ctx, data, datalen); @@ -452,7 +452,7 @@ _libssh2_rsa_sha2_verify(libssh2_rsa_ctx * rsactx, else { /* silence: warning C4701: potentially uninitialized local variable 'nid_type' used */ -#if defined(_MSC_VER) +#ifdef _MSC_VER nid_type = 0; #endif ret = -1; /* unsupported digest */ @@ -1293,7 +1293,7 @@ gen_publickey_from_rsa(LIBSSH2_SESSION *session, libssh2_rsa_ctx *rsa, #else const BIGNUM * e; const BIGNUM * n; -#if defined(HAVE_OPAQUE_STRUCTS) +#ifdef HAVE_OPAQUE_STRUCTS e = NULL; n = NULL; diff --git a/src/scp.c b/src/scp.c index c2ee194f..e39d7b5d 100644 --- a/src/scp.c +++ b/src/scp.c @@ -45,7 +45,7 @@ #include /* strtoll(), _strtoi64(), strtol() */ -#if defined(HAVE_STRTOLL) +#ifdef HAVE_STRTOLL #define scpsize_strtol strtoll #elif defined(HAVE_STRTOI64) #define scpsize_strtol _strtoi64 diff --git a/src/session.c b/src/session.c index baf4722b..12e9de51 100644 --- a/src/session.c +++ b/src/session.c @@ -60,7 +60,7 @@ #include "channel.h" #include "mac.h" -#if defined(_WIN32) +#ifdef _WIN32 #define libssh2_usec_t long #elif defined(__APPLE__) #define libssh2_usec_t suseconds_t @@ -489,7 +489,7 @@ libssh2_session_init_ex(LIBSSH2_ALLOC_FUNC((*my_alloc)), * Set (or reset) a callback function * Returns the prior address */ -#if defined(__clang__) +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wcast-function-type" #endif @@ -557,7 +557,7 @@ libssh2_session_callback_set2(LIBSSH2_SESSION *session, int cbtype, return NULL; } -#if defined(__clang__) +#ifdef __clang__ #pragma clang diagnostic pop #endif