From: Francesco Chemolli Date: Sat, 26 Dec 2009 00:25:57 +0000 (+0100) Subject: Converted many #ifdefs to #ifs X-Git-Tag: SQUID_3_2_0_1~310^2~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32d002cb27914e9b12cf4d003ca07033b1839c9a;p=thirdparty%2Fsquid.git Converted many #ifdefs to #ifs --- diff --git a/compat/os/aix.h b/compat/os/aix.h index 3286eb49a4..be41cd5dc2 100644 --- a/compat/os/aix.h +++ b/compat/os/aix.h @@ -17,7 +17,7 @@ /* * Syslog facility on AIX requires some portability wrappers */ -#ifdef HAVE_SYSLOG_H +#if HAVE_SYSLOG_H #define _XOPEN_EXTENDED_SOURCE #define _XOPEN_SOURCE_EXTENDED 1 #endif diff --git a/compat/os/mswin.h b/compat/os/mswin.h index 2c3944ab13..314af223a7 100644 --- a/compat/os/mswin.h +++ b/compat/os/mswin.h @@ -210,7 +210,7 @@ struct statfs { long f_spare[6]; /* spare for later */ }; -#ifndef HAVE_GETTIMEOFDAY +#if !HAVE_GETTIMEOFDAY struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ int tz_dsttime; /* type of dst correction */ diff --git a/compat/os/openbsd.h b/compat/os/openbsd.h index eae2cdf003..dc9375459e 100644 --- a/compat/os/openbsd.h +++ b/compat/os/openbsd.h @@ -16,7 +16,7 @@ /* * Don't allow inclusion of malloc.h */ -#ifdef HAVE_MALLOC_H +#if HAVE_MALLOC_H #undef HAVE_MALLOC_H #endif diff --git a/compat/os/solaris.h b/compat/os/solaris.h index fe1c039ea3..12793ef7b9 100644 --- a/compat/os/solaris.h +++ b/compat/os/solaris.h @@ -14,13 +14,13 @@ * header files. */ #if defined(i386) || defined(__i386) -#ifndef HAVE_PAD128_T +#if !HAVE_PAD128_T typedef union { long double _q; int32_t _l[4]; } pad128_t; #endif -#ifndef HAVE_UPAD128_T +#if !HAVE_UPAD128_T typedef union { long double _q; uint32_t _l[4]; diff --git a/compat/stdvarargs.h b/compat/stdvarargs.h index c38a2cf2c9..c8c10f9cef 100644 --- a/compat/stdvarargs.h +++ b/compat/stdvarargs.h @@ -31,7 +31,7 @@ #endif /* Make sure syslog goes after stdarg/varargs */ -#ifdef HAVE_SYSLOG_H +#if HAVE_SYSLOG_H #include #endif diff --git a/helpers/basic_auth/SASL/sasl_auth.c b/helpers/basic_auth/SASL/sasl_auth.c index 6efa30dfea..f45f7849ef 100644 --- a/helpers/basic_auth/SASL/sasl_auth.c +++ b/helpers/basic_auth/SASL/sasl_auth.c @@ -34,7 +34,7 @@ #include "rfc1738.h" #include "util.h" -#ifdef HAVE_SASL_SASL_H +#if HAVE_SASL_SASL_H #include #else #include diff --git a/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c b/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c index f0edab38b5..cc65eb5811 100644 --- a/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c +++ b/helpers/external_acl/mswin_ad_group/mswin_check_ad_group.c @@ -57,7 +57,7 @@ int _wcsicmp(const wchar_t *, const wchar_t *); #if HAVE_CTYPE_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif #if HAVE_GETOPT_H diff --git a/helpers/external_acl/mswin_lm_group/win32_check_group.c b/helpers/external_acl/mswin_lm_group/win32_check_group.c index da5d41fc23..b8b2267118 100644 --- a/helpers/external_acl/mswin_lm_group/win32_check_group.c +++ b/helpers/external_acl/mswin_lm_group/win32_check_group.c @@ -78,7 +78,7 @@ int _wcsicmp(const wchar_t *, const wchar_t *); #if HAVE_CTYPE_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif #if HAVE_GETOPT_H diff --git a/helpers/external_acl/session/squid_session.c b/helpers/external_acl/session/squid_session.c index f92c0c98c3..3af08324cb 100644 --- a/helpers/external_acl/session/squid_session.c +++ b/helpers/external_acl/session/squid_session.c @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include "config.h" #endif diff --git a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc index dd9c2d84b9..fd075a3e2c 100644 --- a/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc +++ b/helpers/negotiate_auth/kerberos/negotiate_kerberos_auth_test.cc @@ -98,7 +98,7 @@ LogTime() return buf; } -#ifdef HAVE_SPNEGO +#if HAVE_SPNEGO #ifndef gss_mech_spnego static gss_OID_desc _gss_mech_spnego = { 6, (void *) "\x2b\x06\x01\x05\x05\x02" }; gss_OID gss_mech_spnego = &_gss_mech_spnego; @@ -190,7 +190,7 @@ squid_kerb_proxy_auth(char *proxy) major_status = gss_init_sec_context(&minor_status, GSS_C_NO_CREDENTIAL, &gss_context, server_name, -#ifdef HAVE_SPNEGO +#if HAVE_SPNEGO gss_mech_spnego, #else 0, diff --git a/helpers/ntlm_auth/smb_lm/libntlmssp.c b/helpers/ntlm_auth/smb_lm/libntlmssp.c index 11fcd69b19..a0d34c13cd 100644 --- a/helpers/ntlm_auth/smb_lm/libntlmssp.c +++ b/helpers/ntlm_auth/smb_lm/libntlmssp.c @@ -26,7 +26,7 @@ typedef unsigned char uchar; #if HAVE_STDLIB_H #include #endif /* HAVE_STDLIB_H */ -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif @@ -63,7 +63,7 @@ int SMB_Negotiate(void *Con_Handle, char *Prots[]); int SMB_Logon_Server(SMB_Handle_Type Con_Handle, char *UserName, char *PassWord, char *Domain, int precrypted); #endif -#ifdef DEBUG +#if DEBUG #define debug_dump_ntlmssp_flags dump_ntlmssp_flags #else /* DEBUG */ #define debug_dump_ntlmssp_flags(X) /* empty */ diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c index 597150bf8f..f14dd6d01b 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.c @@ -41,16 +41,16 @@ extern int RFCNB_Get_Last_Error(void); #if HAVE_GETOPT_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_CTYPE_H +#if HAVE_CTYPE_H #include #endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif -#ifdef HAVE_ASSERT_H +#if HAVE_ASSERT_H #include #endif @@ -62,12 +62,12 @@ const char * obtain_challenge(void); void manage_request(void); -#ifdef DEBUG +#if DEBUG char error_messages_buffer[BUFFER_SIZE]; #endif char load_balance = 0, protocol_pedantic = 0; -#ifdef NTLM_FAIL_OPEN +#if NTLM_FAIL_OPEN char last_ditch_enabled = 0; #endif @@ -112,7 +112,7 @@ lc(char *string) void send_bh_or_ld(char const *bhmessage, ntlm_authenticate * failedauth, int authlen) { -#ifdef NTLM_FAIL_OPEN +#if NTLM_FAIL_OPEN char *creds = NULL; if (last_ditch_enabled) { creds = fetch_credentials(failedauth, authlen); @@ -125,7 +125,7 @@ send_bh_or_ld(char const *bhmessage, ntlm_authenticate * failedauth, int authlen } else { #endif SEND2("BH %s", bhmessage); -#ifdef NTLM_FAIL_OPEN +#if NTLM_FAIL_OPEN } #endif } @@ -171,7 +171,7 @@ process_options(int argc, char *argv[]) fprintf(stderr, "WARNING. The -f flag is DEPRECATED and always active.\n"); break; -#ifdef NTLM_FAIL_OPEN +#if NTLM_FAIL_OPEN case 'l': last_ditch_enabled = 1; break; @@ -462,7 +462,7 @@ int main(int argc, char *argv[]) { debug("ntlm_auth build " __DATE__ ", " __TIME__ " starting up...\n"); -#ifdef DEBUG +#if DEBUG debug("changing dir to /tmp\n"); if (chdir("/tmp") != 0) { debug("ERROR: (%d) failed.\n",errno); diff --git a/include/config.h b/include/config.h index 215a22a052..23f5b8f2ca 100644 --- a/include/config.h +++ b/include/config.h @@ -67,7 +67,7 @@ /* Typedefs for missing entries on a system */ /* int8_t */ -#ifndef HAVE_INT8_T +#if !HAVE_INT8_T #if HAVE_CHAR && SIZEOF_CHAR == 1 typedef char int8_t; #else @@ -76,7 +76,7 @@ typedef char int8_t; #endif /* u_int8_t */ -#ifndef HAVE_U_INT8_T +#if !HAVE_U_INT8_T #if HAVE_UINT8_T typedef uint8_t u_int8_t; #else @@ -85,7 +85,7 @@ typedef unsigned char u_int8_t; #endif /* int16_t */ -#ifndef HAVE_INT16_T +#if !HAVE_INT16_T #if HAVE_SHORT && SIZEOF_SHORT == 2 typedef short int16_t; #elif HAVE_INT && SIZEOF_INT == 2 @@ -96,7 +96,7 @@ typedef int int16_t; #endif /* u_int16_t */ -#ifndef HAVE_U_INT16_T +#if !HAVE_U_INT16_T #if HAVE_UINT16_T typedef uint16_t u_int16_t; #else @@ -105,7 +105,7 @@ typedef unsigned int16_t u_int16_t; #endif /* int32_t */ -#ifndef HAVE_INT32_T +#if !HAVE_INT32_T #if HAVE_INT && SIZEOF_INT == 4 typedef int int32_t; #elif HAVE_LONG && SIZEOF_LONG == 4 @@ -116,7 +116,7 @@ typedef long int32_t; #endif /* u_int32_t */ -#ifndef HAVE_U_INT32_T +#if !HAVE_U_INT32_T #if HAVE_UINT32_T typedef uint32_t u_int32_t; #else @@ -125,7 +125,7 @@ typedef unsigned int32_t u_int32_t; #endif /* int64_t */ -#ifndef HAVE_INT64_T +#if !HAVE_INT64_T #if HAVE___INT64 typedef __int64 int64_t; #elif HAVE_LONG && SIZEOF_LONG == 8 @@ -138,7 +138,7 @@ typedef long long int64_t; #endif /* u_int64_t */ -#ifndef HAVE_U_INT64_T +#if !HAVE_U_INT64_T #if HAVE_UINT64_T typedef uint64_t u_int64_t; #else @@ -147,35 +147,35 @@ typedef unsigned int64_t u_int64_t; #endif -#ifndef HAVE_PID_T +#if !HAVE_PID_T typedef int pid_t; #endif -#ifndef HAVE_SIZE_T +#if !HAVE_SIZE_T typedef unsigned int size_t; #endif -#ifndef HAVE_SSIZE_T +#if !HAVE_SSIZE_T typedef int ssize_t; #endif -#ifndef HAVE_OFF_T +#if !HAVE_OFF_T typedef int off_t; #endif -#ifndef HAVE_MODE_T +#if !HAVE_MODE_T typedef unsigned short mode_t; #endif -#ifndef HAVE_FD_MASK +#if !HAVE_FD_MASK typedef unsigned long fd_mask; #endif -#ifndef HAVE_SOCKLEN_T +#if !HAVE_SOCKLEN_T typedef int socklen_t; #endif -#ifndef HAVE_MTYP_T +#if !HAVE_MTYP_T typedef long mtyp_t; #endif @@ -197,7 +197,7 @@ typedef long mtyp_t; #define SQUID_UDP_SO_RCVBUF SQUID_DETECT_UDP_SO_RCVBUF #endif -#ifdef HAVE_MEMCPY +#if HAVE_MEMCPY #define xmemcpy(d,s,n) memcpy((d),(s),(n)) #elif HAVE_BCOPY #define xmemcpy(d,s,n) bcopy((s),(d),(n)) @@ -205,7 +205,7 @@ typedef long mtyp_t; #define xmemcpy(d,s,n) memmove((d),(s),(n)) #endif -#ifdef HAVE_MEMMOVE +#if HAVE_MEMMOVE #define xmemmove(d,s,n) memmove((d),(s),(n)) #elif HAVE_BCOPY #define xmemmove(d,s,n) bcopy((s),(d),(n)) diff --git a/include/getaddrinfo.h b/include/getaddrinfo.h index a0aabf7347..2148b649d2 100644 --- a/include/getaddrinfo.h +++ b/include/getaddrinfo.h @@ -44,7 +44,7 @@ /* Structure and prototypes taken from RFC 2553 */ -#ifdef HAVE_GETADDRINFO +#if HAVE_GETADDRINFO /* These functions are provided by the OS */ #define xgetaddrinfo getaddrinfo diff --git a/include/getnameinfo.h b/include/getnameinfo.h index 7d9c750871..c95d4245bc 100644 --- a/include/getnameinfo.h +++ b/include/getnameinfo.h @@ -8,7 +8,7 @@ #include "config.h" -#ifdef HAVE_GETNAMEINFO +#if HAVE_GETNAMEINFO /* These functions are provided by the OS */ #define xgetnameinfo getnameinfo diff --git a/include/profiling.h b/include/profiling.h index 5e617120de..03b0f861c5 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -10,7 +10,7 @@ class CacheManager; #endif -#ifdef USE_XPROF_STATS +#if USE_XPROF_STATS #if !defined(_SQUID_SOLARIS_) typedef int64_t hrtime_t; @@ -77,7 +77,7 @@ get_tick(void) #endif /* USE_XPROF_STATS - maybe disabled above */ -#ifdef USE_XPROF_STATS +#if USE_XPROF_STATS typedef enum { XPROF_PROF_UNACCOUNTED, diff --git a/include/snmp_api.h b/include/snmp_api.h index 7614c4fd06..e738f90e39 100644 --- a/include/snmp_api.h +++ b/include/snmp_api.h @@ -6,7 +6,7 @@ #define SQUID_SNMP_API_H #include "config.h" -#ifdef HAVE_SYS_TIME_H +#if HAVE_SYS_TIME_H #include #endif diff --git a/include/snmp_api_util.h b/include/snmp_api_util.h index 52b745129e..40a7a99d97 100644 --- a/include/snmp_api_util.h +++ b/include/snmp_api_util.h @@ -79,7 +79,7 @@ struct snmp_internal_session { #undef timerisset #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#ifdef HAVE_SRAND +#if HAVE_SRAND #define random rand #define srandom srand #endif /* HAVE_SRAND */ diff --git a/include/squid_endian.h b/include/squid_endian.h index e0e92c70a1..027b30542d 100644 --- a/include/squid_endian.h +++ b/include/squid_endian.h @@ -68,7 +68,7 @@ #if HAVE_BYTESWAP_H # include #endif /* HAVE_BYTESWAP_H */ -#ifdef HAVE_MACHINE_BYTE_SWAP_H +#if HAVE_MACHINE_BYTE_SWAP_H # include #endif /* HAVE_MACHINE_BYTE_SWAP_H */ #if HAVE_SYS_BSWAP_H diff --git a/include/util.h b/include/util.h index 0bf570b4c2..e4d2882796 100644 --- a/include/util.h +++ b/include/util.h @@ -157,7 +157,7 @@ int statMemoryAccounted(void); #ifdef _SQUID_MSWIN_ SQUIDCEXTERN int chroot (const char *); SQUIDCEXTERN int ftruncate(int, off_t); -#ifndef HAVE_GETTIMEOFDAY +#if !HAVE_GETTIMEOFDAY SQUIDCEXTERN int gettimeofday(struct timeval * ,void *); #endif SQUIDCEXTERN int kill(pid_t, int); diff --git a/lib/Profiler.c b/lib/Profiler.c index 0e5b7aec5b..f274b03947 100644 --- a/lib/Profiler.c +++ b/lib/Profiler.c @@ -109,7 +109,7 @@ #include -#ifdef USE_XPROF_STATS +#if USE_XPROF_STATS #if HAVE_GNUMALLLOC_H diff --git a/lib/drand48.c b/lib/drand48.c index 0a9927eec7..febb86bada 100644 --- a/lib/drand48.c +++ b/lib/drand48.c @@ -4,7 +4,7 @@ * hack by Martin Hamilton to make Squid build on * Win32 with GNU-Win32 - sorry, folks! */ -#ifndef HAVE_DRAND48 +#if !HAVE_DRAND48 #define N 16 #define MASK ((unsigned)(1 << (N - 1)) + (1 << (N - 1)) - 1) diff --git a/lib/getaddrinfo.c b/lib/getaddrinfo.c index 25917df2af..7c3ea520ef 100644 --- a/lib/getaddrinfo.c +++ b/lib/getaddrinfo.c @@ -43,7 +43,7 @@ /* An emulation of the RFC 2553 / Posix getaddrinfo resolver interface. */ -#ifndef HAVE_GETADDRINFO +#if !HAVE_GETADDRINFO /* Need to turn off Posix features in glibc to build this */ #undef _POSIX_C_SOURCE diff --git a/lib/getnameinfo.c b/lib/getnameinfo.c index ab8ac0f218..33c97d0fa7 100644 --- a/lib/getnameinfo.c +++ b/lib/getnameinfo.c @@ -75,7 +75,7 @@ * - gethostbyaddr() is usually not thread safe. */ -#ifndef HAVE_GETNAMEINFO +#if !HAVE_GETNAMEINFO #if HAVE_SYS_TYPES_H #include @@ -117,7 +117,7 @@ #include #endif -#ifdef _SQUID_MSWIN_ +#if _SQUID_MSWIN_ #undef IN_ADDR #include #endif @@ -135,7 +135,7 @@ static const struct afd { int a_off; int a_portoff; } afdl [] = { -#ifdef INET6 +#if INET6 {PF_INET6, sizeof(struct in6_addr), sizeof(struct sockaddr_in6), offsetof(struct sockaddr_in6, sin6_addr), offsetof(struct sockaddr_in6, sin6_port)}, @@ -146,7 +146,7 @@ static const struct afd { {0, 0, 0, 0, 0}, }; -#ifdef INET6 +#if INET6 static int ip6_parsenumeric __P((const struct sockaddr *, const char *, char *, size_t, int)); static int ip6_sa2str __P((const struct sockaddr_in6 *, char *, size_t, int)); @@ -175,7 +175,7 @@ int flags; if (sa == NULL) return EAI_FAIL; -#ifdef HAVE_SA_LEN /*XXX*/ +#if HAVE_SA_LEN /*XXX*/ if (sa->sa_len != salen) return EAI_FAIL; #endif @@ -232,7 +232,7 @@ found: if (v4a == 0) flags |= NI_NUMERICHOST; break; -#ifdef INET6 +#if INET6 case AF_INET6: { const struct sockaddr_in6 *sin6; sin6 = (const struct sockaddr_in6 *)sa; @@ -270,11 +270,11 @@ found: goto numeric; } else { -#ifdef USE_GETIPNODEBY +#if USE_GETIPNODEBY hp = getipnodebyaddr(addr, afd->a_addrlen, afd->a_af, &h_error); #else hp = gethostbyaddr(addr, afd->a_addrlen, afd->a_af); -#ifdef HAVE_H_ERRNO +#if HAVE_H_ERRNO h_error = h_errno; #else h_error = EINVAL; @@ -303,13 +303,13 @@ found: } #endif if (strlen(hp->h_name) + 1 > hostlen) { -#ifdef USE_GETIPNODEBY +#if USE_GETIPNODEBY freehostent(hp); #endif return EAI_OVERFLOW; } strncpy(host, hp->h_name, hostlen); -#ifdef USE_GETIPNODEBY +#if USE_GETIPNODEBY freehostent(hp); #endif } else { @@ -318,7 +318,7 @@ found: numeric: switch (afd->a_af) { -#ifdef INET6 +#if INET6 case AF_INET6: { int error; @@ -340,7 +340,7 @@ numeric: return(0); } -#ifdef INET6 +#if INET6 static int ip6_parsenumeric(sa, addr, host, hostlen, flags) const struct sockaddr *sa; @@ -397,7 +397,7 @@ int flags; ifindex = (unsigned int)sa6->sin6_scope_id; a6 = &sa6->sin6_addr; -#ifdef NI_NUMERICSCOPE +#if NI_NUMERICSCOPE if ((flags & NI_NUMERICSCOPE) != 0) { n = snprintf(buf, bufsiz, "%u", sa6->sin6_scope_id); if (n < 0 || n >= bufsiz) diff --git a/lib/hash.c b/lib/hash.c index 0db0e8476c..be3a3c0172 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -362,7 +362,7 @@ hashKeyStr(hash_link * hl) } -#ifdef USE_HASH_DRIVER +#if USE_HASH_DRIVER /* * hash-driver - Run with a big file as stdin to insert each line into the * hash table, then prints the whole hash table, then deletes a random item, diff --git a/lib/inet_ntop.c b/lib/inet_ntop.c index cc0b60a525..6e1fe0ef66 100644 --- a/lib/inet_ntop.c +++ b/lib/inet_ntop.c @@ -21,7 +21,7 @@ #include "config.h" -#ifndef HAVE_INET_NTOP +#if !HAVE_INET_NTOP #include "inet_ntop.h" /* diff --git a/lib/inet_pton.c b/lib/inet_pton.c index e12873618b..4753b74346 100644 --- a/lib/inet_pton.c +++ b/lib/inet_pton.c @@ -20,7 +20,7 @@ #include "config.h" -#ifndef HAVE_INET_PTON +#if !HAVE_INET_PTON /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") diff --git a/lib/initgroups.c b/lib/initgroups.c index 41f8e3f68b..e93d0fb2cb 100644 --- a/lib/initgroups.c +++ b/lib/initgroups.c @@ -24,7 +24,7 @@ int initgroups(const char *name, gid_t basegid) { -#ifdef HAVE_SETGROUPS +#if HAVE_SETGROUPS #ifndef NGROUPS_MAX #define NGROUPS_MAX 16 #endif diff --git a/lib/libTrie/include/Trie.h b/lib/libTrie/include/Trie.h index 927aea4437..a794c06814 100644 --- a/lib/libTrie/include/Trie.h +++ b/lib/libTrie/include/Trie.h @@ -25,7 +25,7 @@ * bindings. libtrie itself is written in C++. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include "config.h" #endif diff --git a/lib/libTrie/include/TrieCharTransform.h b/lib/libTrie/include/TrieCharTransform.h index d4f18f86df..71174f8cf9 100644 --- a/lib/libTrie/include/TrieCharTransform.h +++ b/lib/libTrie/include/TrieCharTransform.h @@ -27,7 +27,7 @@ * For C bindings see Trie.h */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include "config.h" #endif diff --git a/lib/libTrie/include/TrieNode.cci b/lib/libTrie/include/TrieNode.cci index 6efe375150..c5f36e46bb 100644 --- a/lib/libTrie/include/TrieNode.cci +++ b/lib/libTrie/include/TrieNode.cci @@ -20,7 +20,7 @@ #ifdef __cplusplus #include "TrieNode.h" #include "TrieCharTransform.h" -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif #include diff --git a/lib/libTrie/include/TrieNode.h b/lib/libTrie/include/TrieNode.h index 548bda7827..a1cbe5a6ab 100644 --- a/lib/libTrie/include/TrieNode.h +++ b/lib/libTrie/include/TrieNode.h @@ -27,7 +27,7 @@ * For C bindings see Trei.h */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include "config.h" #endif diff --git a/lib/libTrie/src/Trie.cc b/lib/libTrie/src/Trie.cc index 5d5c6dc133..1df38968c6 100644 --- a/lib/libTrie/src/Trie.cc +++ b/lib/libTrie/src/Trie.cc @@ -18,7 +18,7 @@ */ #include "Trie.h" -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif #include "TrieNode.h" diff --git a/lib/libTrie/src/TrieNode.cc b/lib/libTrie/src/TrieNode.cc index bc1af21a9f..3d6bea5c77 100644 --- a/lib/libTrie/src/TrieNode.cc +++ b/lib/libTrie/src/TrieNode.cc @@ -19,7 +19,7 @@ #include "TrieNode.h" #include "TrieCharTransform.h" -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H #include #endif diff --git a/lib/ntlmauth.c b/lib/ntlmauth.c index 983822192e..8eaf1e5fc4 100644 --- a/lib/ntlmauth.c +++ b/lib/ntlmauth.c @@ -23,10 +23,10 @@ #include "config.h" -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif diff --git a/lib/rfc1123.c b/lib/rfc1123.c index dd98d360ae..c7cf1589a1 100644 --- a/lib/rfc1123.c +++ b/lib/rfc1123.c @@ -204,7 +204,7 @@ parse_rfc1123(const char *str) if (!tm) return -1; tm->tm_isdst = -1; -#ifdef HAVE_TIMEGM +#if HAVE_TIMEGM t = timegm(tm); #elif HAVE_TM_TM_GMTOFF t = mktime(tm); @@ -261,7 +261,7 @@ mkhttpdlogtime(const time_t * t) struct tm *gmt = gmtime(t); -#ifndef USE_GMT +#if !USE_GMT int gmt_min, gmt_hour, gmt_yday, day_offset; size_t len; struct tm *lt; diff --git a/lib/strsep.c b/lib/strsep.c index 6335cbeda4..8d134814a6 100644 --- a/lib/strsep.c +++ b/lib/strsep.c @@ -21,7 +21,7 @@ * USA. */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include #endif diff --git a/lib/strtoll.c b/lib/strtoll.c index 50f705da9b..1b46fd7957 100644 --- a/lib/strtoll.c +++ b/lib/strtoll.c @@ -33,7 +33,7 @@ /* modified for long long 1999-08-12 */ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include #endif #if HAVE_CTYPE_H diff --git a/lib/win32lib.c b/lib/win32lib.c index 55526e5e61..69af1de0d6 100644 --- a/lib/win32lib.c +++ b/lib/win32lib.c @@ -182,7 +182,7 @@ kill(pid_t pid, int sig) return 0; } -#ifndef HAVE_GETTIMEOFDAY +#if !HAVE_GETTIMEOFDAY int gettimeofday(struct timeval *pcur_time, void *tzp) { diff --git a/snmplib/asn1.c b/snmplib/asn1.c index 6cc84d0dbb..b2ccfde3dc 100644 --- a/snmplib/asn1.c +++ b/snmplib/asn1.c @@ -55,10 +55,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H diff --git a/snmplib/coexistance.c b/snmplib/coexistance.c index 89a8702012..429d78d77f 100644 --- a/snmplib/coexistance.c +++ b/snmplib/coexistance.c @@ -53,10 +53,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -109,7 +109,7 @@ snmp_coexist_V2toV1(struct snmp_pdu *PDU) case SNMP_PDU_GET: case SNMP_PDU_GETNEXT: -#ifdef SNMP_PDU_SET +#if SNMP_PDU_SET case SNMP_PDU_SET: #endif return (1); diff --git a/snmplib/mib.c b/snmplib/mib.c index f4b1337975..58cffae362 100644 --- a/snmplib/mib.c +++ b/snmplib/mib.c @@ -45,10 +45,10 @@ SOFTWARE. #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H diff --git a/snmplib/parse.c b/snmplib/parse.c index 517b01d2ad..9c56c957af 100644 --- a/snmplib/parse.c +++ b/snmplib/parse.c @@ -47,10 +47,10 @@ SOFTWARE. #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -271,7 +271,7 @@ print_error(const char *string, const char *token, int type) snmplib_debug(0, "%s: On or around line %d\n", string, Line); } -#ifdef TEST +#if TEST print_subtree(tree, count) struct snmp_mib_tree *tree; int count; @@ -424,7 +424,7 @@ do_subtree(struct snmp_mib_tree *root, struct node **nodes) xfree(oldnp); } -#ifndef TEST +#if !TEST static #endif struct snmp_mib_tree * @@ -447,7 +447,7 @@ build_tree(struct node *nodes) { init_node_hash(nodes); /* XXX nodes isn't needed in do_subtree() ??? */ do_subtree(tp, &nodes); -#ifdef TEST +#if TEST print_subtree(tp, 0); #endif /* TEST */ /* If any nodes are left, the tree is probably inconsistent */ @@ -974,7 +974,7 @@ parse_objecttype(register FILE *fp, char *name) { * Parses a mib file and returns a linked list of nodes found in the file. * Returns NULL on error. */ -#ifndef TEST +#if !TEST static #endif struct node * @@ -1042,7 +1042,7 @@ parse(FILE *fp) { return NULL; } } -#ifdef TEST +#if TEST { struct enum_list *ep; diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c index 5e6d5081dd..c22d7e9a74 100644 --- a/snmplib/snmp_api.c +++ b/snmplib/snmp_api.c @@ -48,10 +48,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H diff --git a/snmplib/snmp_api_error.c b/snmplib/snmp_api_error.c index 260117e951..e9a23e0094 100644 --- a/snmplib/snmp_api_error.c +++ b/snmplib/snmp_api_error.c @@ -30,7 +30,7 @@ * ***************************************************************************/ -#ifdef HAVE_CONFIG_H +#if HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ diff --git a/snmplib/snmp_msg.c b/snmplib/snmp_msg.c index bc8ef64128..2fb85665b5 100644 --- a/snmplib/snmp_msg.c +++ b/snmplib/snmp_msg.c @@ -57,10 +57,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -206,7 +206,7 @@ snmp_msg_Encode(u_char * Buffer, int *BufLenP, /* Cool. Now insert the appropriate lengths. */ -#ifdef DEBUG_MSG_ENCODE +#if DEBUG_MSG_ENCODE snmplib_debug(9, "Msg: Vars returned 0x%x. PDU Started at 0x%x\n", bufp, PDUHeaderPtr); snmplib_debug(9, "MSG: Entire PDU length is %d (0x%x - 0x%x)\n", @@ -219,7 +219,7 @@ snmp_msg_Encode(u_char * Buffer, int *BufLenP, if (tmp == NULL) return (NULL); -#ifdef DEBUG_MSG_ENCODE +#if DEBUG_MSG_ENCODE snmplib_debug(9, "MSG: Entire message length is %d (0x%x - 0x%x)\n", (int) (bufp - MsgPtr), MsgPtr, bufp); #endif diff --git a/snmplib/snmp_pdu.c b/snmplib/snmp_pdu.c index a52ba24a77..418e4969c2 100644 --- a/snmplib/snmp_pdu.c +++ b/snmplib/snmp_pdu.c @@ -57,10 +57,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -107,7 +107,7 @@ struct snmp_pdu * snmp_pdu_create(int command) { struct snmp_pdu *pdu; -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU: Creating\n"); #endif @@ -126,7 +126,7 @@ snmp_pdu_create(int command) { pdu->enterprise_length = 0; pdu->variables = NULL; -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU: Created %x\n", (unsigned int) pdu); #endif @@ -141,7 +141,7 @@ struct snmp_pdu * snmp_pdu_clone(struct snmp_pdu *Src) { struct snmp_pdu *Dest; -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU %x: Cloning\n", (unsigned int) Src); #endif @@ -152,7 +152,7 @@ snmp_pdu_clone(struct snmp_pdu *Src) { } xmemcpy((char *) Dest, (char *) Src, sizeof(struct snmp_pdu)); -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU %x: Created %x\n", (unsigned int) Src, (unsigned int) Dest); #endif return (Dest); @@ -183,7 +183,7 @@ snmp_fix_pdu(struct snmp_pdu *pdu, int command) { int i; int copied = 0; -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU %x: Fixing. Err index is %d\n", (unsigned int) pdu, (unsigned int) pdu->errindex); #endif @@ -256,7 +256,7 @@ snmp_fix_pdu(struct snmp_pdu *pdu, int command) { snmp_set_api_error(SNMPERR_UNABLE_TO_FIX); return (NULL); } -#ifdef DEBUG_PDU +#if DEBUG_PDU snmplib_debug(8, "PDU %x: Fixed PDU is %x\n", (unsigned int) pdu, (unsigned int) newpdu); #endif @@ -347,7 +347,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, { u_char *bufp; -#ifdef DEBUG_PDU_ENCODE +#if DEBUG_PDU_ENCODE snmplib_debug(8, "PDU: Encoding %d\n", PDU->command); #endif @@ -355,7 +355,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, switch (PDU->command) { /**********************************************************************/ -#ifdef TRP_REQ_MSG +#if TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap */ @@ -436,7 +436,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, /* Normal PDU Encoding */ /* request id */ -#ifdef DEBUG_PDU_ENCODE +#if DEBUG_PDU_ENCODE snmplib_debug(8, "PDU: Request ID %d (0x%x)\n", PDU->reqid, DestBuf); #endif bufp = asn_build_int(DestBuf, DestBufLen, @@ -446,7 +446,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, return (NULL); /* error status */ -#ifdef DEBUG_PDU_ENCODE +#if DEBUG_PDU_ENCODE snmplib_debug(8, "PDU: Error Status %d (0x%x)\n", PDU->errstat, bufp); #endif bufp = asn_build_int(bufp, DestBufLen, @@ -456,7 +456,7 @@ snmp_pdu_encode(u_char * DestBuf, int *DestBufLen, return (NULL); /* error index */ -#ifdef DEBUG_PDU_ENCODE +#if DEBUG_PDU_ENCODE snmplib_debug(8, "PDU: Error index %d (0x%x)\n", PDU->errindex, bufp); #endif bufp = asn_build_int(bufp, DestBufLen, @@ -485,7 +485,7 @@ snmp_pdu_decode(u_char * Packet, /* data */ u_char *bufp; u_char PDUType; u_char ASNType; -#ifdef UNUSED_CODE +#if UNUSED_CODE int four; oid objid[MAX_NAME_LEN]; #endif @@ -494,14 +494,14 @@ snmp_pdu_decode(u_char * Packet, /* data */ if (bufp == NULL) ASN_PARSE_ERROR(NULL); -#ifdef DEBUG_PDU_DECODE +#if DEBUG_PDU_DECODE snmplib_debug(8, "PDU Type: %d\n", PDUType); #endif PDU->command = PDUType; switch (PDUType) { -#ifdef TRP_REQ_MSG +#if TRP_REQ_MSG case TRP_REQ_MSG: /* SNMPv1 Trap Message */ @@ -596,7 +596,7 @@ snmp_pdu_decode(u_char * Packet, /* data */ if (bufp == NULL) ASN_PARSE_ERROR(NULL); -#ifdef DEBUG_PDU_DECODE +#if DEBUG_PDU_DECODE snmplib_debug(8, "PDU Request ID: %d\n", PDU->reqid); #endif @@ -607,7 +607,7 @@ snmp_pdu_decode(u_char * Packet, /* data */ if (bufp == NULL) ASN_PARSE_ERROR(NULL); -#ifdef DEBUG_PDU_DECODE +#if DEBUG_PDU_DECODE snmplib_debug(8, "PDU Error Status: %d\n", PDU->errstat); #endif @@ -618,7 +618,7 @@ snmp_pdu_decode(u_char * Packet, /* data */ if (bufp == NULL) ASN_PARSE_ERROR(NULL); -#ifdef DEBUG_PDU_DECODE +#if DEBUG_PDU_DECODE snmplib_debug(8, "PDU Error Index: %d\n", PDU->errindex); #endif diff --git a/snmplib/snmp_vars.c b/snmplib/snmp_vars.c index 0c89ee26ed..09d5680051 100644 --- a/snmplib/snmp_vars.c +++ b/snmplib/snmp_vars.c @@ -56,10 +56,10 @@ #if HAVE_MEMORY_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -108,7 +108,7 @@ struct variable_list * snmp_var_new(oid * Name, int Len) { struct variable_list *New; -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Creating.\n"); #endif @@ -135,7 +135,7 @@ snmp_var_new(oid * Name, int Len) { snmp_set_api_error(SNMPERR_OS_ERR); return (NULL); } -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Copying name, size (%d)\n", Len); #endif @@ -165,7 +165,7 @@ struct variable_list * snmp_var_clone(struct variable_list *Src) { struct variable_list *Dest; -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Cloning.\n"); #endif @@ -174,7 +174,7 @@ snmp_var_clone(struct variable_list *Src) { snmp_set_api_error(SNMPERR_OS_ERR); return (NULL); } -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Copying entire variable list. (Size %d)\n", sizeof(struct variable_list)); #endif @@ -188,7 +188,7 @@ snmp_var_clone(struct variable_list *Src) { xfree(Dest); return (NULL); } -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Copying name OID. (Size %d)\n", Src->name_length); #endif xmemcpy((char *) Dest->name, (char *) Src->name, @@ -204,15 +204,15 @@ snmp_var_clone(struct variable_list *Src) { xfree(Dest); return (NULL); } -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Copying value (Size %d)\n", Src->val_len); #endif xmemcpy((char *) Dest->val.string, (char *) Src->val.string, Src->val_len); } -#ifdef DEBUG_VARS +#if DEBUG_VARS printf("VARS: Cloned %x.\n", (unsigned int) Dest); #endif -#ifdef DEBUG_VARS_MALLOC +#if DEBUG_VARS_MALLOC printf("VARS: Cloned (%x)\n", (unsigned int) Dest); printf("VARS: Name is (%x)\n", (unsigned int) Dest->name); #endif @@ -382,7 +382,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, int ThisVarLen = 0; VarLastP = VarP; -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoding buffer of length %d\n", *BufLen); #endif @@ -395,7 +395,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, snmp_set_api_error(SNMPERR_PDU_PARSE); return (NULL); } -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: All Variable length %d\n", AllVarLen); #endif @@ -426,7 +426,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, snmp_set_api_error(SNMPERR_PDU_PARSE); PARSE_ERROR; } -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Header type 0x%x (%d bytes left)\n", VarBindType, ThisVarLen); #endif @@ -442,7 +442,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, snmp_set_api_error(SNMPERR_PDU_PARSE); PARSE_ERROR; } -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoded OBJID (%d bytes). (%d bytes left)\n", Var->name_length, ThisVarLen); #endif @@ -457,7 +457,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, PARSE_ERROR; ThisVarLen = DataLen; -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Data type %d\n", Var->type); #endif @@ -475,7 +475,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, bufp = asn_parse_int(DataPtr, &ThisVarLen, &Var->type, (int *) Var->val.integer, Var->val_len); -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoded integer '%d' (%d bytes left)\n", *(Var->val.integer), ThisVarLen); #endif @@ -494,7 +494,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, bufp = asn_parse_unsigned_int(DataPtr, &ThisVarLen, &Var->type, (u_int *) Var->val.integer, Var->val_len); -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoded timeticks '%d' (%d bytes left)\n", *(Var->val.integer), ThisVarLen); #endif @@ -512,7 +512,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, bufp = asn_parse_string(DataPtr, &ThisVarLen, &Var->type, Var->val.string, &Var->val_len); -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoded string '%s' (length %d) (%d bytes left)\n", (Var->val.string), Var->val_len, ThisVarLen); #endif @@ -532,7 +532,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, if (bufp) { xmemcpy((char *) Var->val.objid, (char *) TmpBuf, Var->val_len); } -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Decoded OBJID (length %d) (%d bytes left)\n", Var->val_len, ThisVarLen); #endif @@ -558,7 +558,7 @@ snmp_var_DecodeVarBind(u_char * Buffer, int *BufLen, if (bufp == NULL) PARSE_ERROR; -#ifdef DEBUG_VARS_DECODE +#if DEBUG_VARS_DECODE printf("VARS: Adding to list.\n"); #endif /* Add variable to the list */ diff --git a/src/AclRegs.cc b/src/AclRegs.cc index 842069c8aa..139dad8e70 100644 --- a/src/AclRegs.cc +++ b/src/AclRegs.cc @@ -6,7 +6,7 @@ */ #include "acl/Acl.h" -#ifdef USE_SQUID_EUI +#if USE_SQUID_EUI #include "acl/Arp.h" #include "acl/Eui64.h" #endif @@ -48,7 +48,7 @@ #include "acl/SourceAsn.h" #include "acl/SourceDomain.h" #include "acl/SourceIp.h" -#ifdef USE_SSL +#if USE_SSL #include "acl/SslErrorData.h" #include "acl/SslError.h" #include "acl/CertificateData.h" @@ -129,7 +129,7 @@ ACLStrategised ACLUrlPath::RegistryEntry_(new ACLRegexData, ACLUrl ACL::Prototype ACLUrlPort::RegistryProtoype(&ACLUrlPort::RegistryEntry_, "port"); ACLStrategised ACLUrlPort::RegistryEntry_(new ACLIntRange, ACLUrlPortStrategy::Instance(), "port"); -#ifdef USE_SSL +#if USE_SSL ACL::Prototype ACLSslError::RegistryProtoype(&ACLSslError::RegistryEntry_, "ssl_error"); ACLStrategised ACLSslError::RegistryEntry_(new ACLSslErrorData, ACLSslErrorStrategy::Instance(), "ssl_error"); ACL::Prototype ACLCertificate::UserRegistryProtoype(&ACLCertificate::UserRegistryEntry_, "user_cert"); @@ -138,7 +138,7 @@ ACL::Prototype ACLCertificate::CARegistryProtoype(&ACLCertificate::CARegistryEnt ACLStrategised ACLCertificate::CARegistryEntry_(new ACLCertificateData (sslGetCAAttribute), ACLCertificateStrategy::Instance(), "ca_cert"); #endif -#ifdef USE_SQUID_EUI +#if USE_SQUID_EUI ACL::Prototype ACLARP::RegistryProtoype(&ACLARP::RegistryEntry_, "arp"); ACLARP ACLARP::RegistryEntry_("arp"); ACL::Prototype ACLEui64::RegistryProtoype(&ACLEui64::RegistryEntry_, "eui64"); diff --git a/src/AuthReg.cc b/src/AuthReg.cc index dce94ec32f..6590df16af 100644 --- a/src/AuthReg.cc +++ b/src/AuthReg.cc @@ -1,35 +1,35 @@ #include "squid.h" -#ifdef HAVE_AUTH_MODULE_BASIC +#if HAVE_AUTH_MODULE_BASIC #include "auth/basic/basicScheme.h" #endif -#ifdef HAVE_AUTH_MODULE_NTLM +#if HAVE_AUTH_MODULE_NTLM #include "auth/ntlm/ntlmScheme.h" #endif -#ifdef HAVE_AUTH_MODULE_DIGEST +#if HAVE_AUTH_MODULE_DIGEST #include "auth/digest/digestScheme.h" #endif -#ifdef HAVE_AUTH_MODULE_NEGOTIATE +#if HAVE_AUTH_MODULE_NEGOTIATE #include "auth/negotiate/negotiateScheme.h" #endif -#ifdef HAVE_AUTH_MODULE_BASIC +#if HAVE_AUTH_MODULE_BASIC static const char *basic_type = basicScheme::GetInstance().type(); #endif -#ifdef HAVE_AUTH_MODULE_NTLM +#if HAVE_AUTH_MODULE_NTLM static const char *ntlm_type = ntlmScheme::GetInstance().type(); #endif -#ifdef HAVE_AUTH_MODULE_DIGEST +#if HAVE_AUTH_MODULE_DIGEST static const char *digest_type = digestScheme::GetInstance().type(); #endif -#ifdef HAVE_AUTH_MODULE_NEGOTIATE +#if HAVE_AUTH_MODULE_NEGOTIATE static const char *negotiate_type = negotiateScheme::GetInstance().type(); #endif diff --git a/src/DiskIO/DiskThreads/DiskThreads.h b/src/DiskIO/DiskThreads/DiskThreads.h index 8654257ed7..15210ec97b 100644 --- a/src/DiskIO/DiskThreads/DiskThreads.h +++ b/src/DiskIO/DiskThreads/DiskThreads.h @@ -11,7 +11,7 @@ #include "dlink.h" #include "typedefs.h" -#ifdef AUFS_IO_THREADS +#if AUFS_IO_THREADS #define NUMTHREADS AUFS_IO_THREADS #else #define NUMTHREADS (Config.cacheSwap.n_configured*16) diff --git a/src/MemBuf.cc b/src/MemBuf.cc index 4bce79907e..1a2713a7af 100644 --- a/src/MemBuf.cc +++ b/src/MemBuf.cc @@ -421,6 +421,6 @@ memBufReport(MemBuf * mb) mb->Printf("memBufReport is not yet implemented @?@\n"); } -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "MemBuf.cci" #endif diff --git a/src/MemBuf.h b/src/MemBuf.h index bd8c41ac68..c682a7bdf0 100644 --- a/src/MemBuf.h +++ b/src/MemBuf.h @@ -169,7 +169,7 @@ public: #endif }; -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "MemBuf.cci" #endif diff --git a/src/PingData.h b/src/PingData.h index bca2e1c859..6d7eddd490 100644 --- a/src/PingData.h +++ b/src/PingData.h @@ -35,7 +35,7 @@ #include "config.h" -#ifdef HAVE_SYS_TIME_H +#if HAVE_SYS_TIME_H #include #endif diff --git a/src/ProfStats.cc b/src/ProfStats.cc index 5e35ba731e..8ea82a64d5 100644 --- a/src/ProfStats.cc +++ b/src/ProfStats.cc @@ -35,7 +35,7 @@ #include "squid.h" -#ifdef USE_XPROF_STATS +#if USE_XPROF_STATS #include "CacheManager.h" #include "event.h" diff --git a/src/SquidString.h b/src/SquidString.h index 657cd7dfcc..60da24a978 100644 --- a/src/SquidString.h +++ b/src/SquidString.h @@ -181,7 +181,7 @@ private: _SQUID_INLINE_ std::ostream & operator<<(std::ostream& os, String const &aString); -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "String.cci" #endif diff --git a/src/Store.h b/src/Store.h index 854b4fd896..0941059169 100644 --- a/src/Store.h +++ b/src/Store.h @@ -380,7 +380,7 @@ SQUIDCEXTERN void packerToStoreInit(Packer * p, StoreEntry * e); /// \ingroup StoreAPI SQUIDCEXTERN void storeGetMemSpace(int size); -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "Store.cci" #endif diff --git a/src/String.cc b/src/String.cc index 40eae2c59e..0d16b69554 100644 --- a/src/String.cc +++ b/src/String.cc @@ -492,6 +492,6 @@ String::rfind(char const ch) const -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "String.cci" #endif diff --git a/src/String.cci b/src/String.cci index 085f383517..2875a71237 100644 --- a/src/String.cci +++ b/src/String.cci @@ -35,7 +35,7 @@ #include "config.h" #include -#ifdef HAVE_STDINT_H +#if HAVE_STDINT_H #include //for INT_MAX #else /* HAVE_STDINT_H */ #ifndef INT_MAX diff --git a/src/auth/User.cc b/src/auth/User.cc index 71094e1c06..ae45724012 100644 --- a/src/auth/User.cc +++ b/src/auth/User.cc @@ -43,7 +43,7 @@ #include "event.h" #include "SquidTime.h" -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "auth/User.cci" #endif diff --git a/src/auth/User.h b/src/auth/User.h index 47a99337e9..92c7a0d939 100644 --- a/src/auth/User.h +++ b/src/auth/User.h @@ -111,7 +111,7 @@ private: dlink_list ip_list; }; -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "auth/User.cci" #endif diff --git a/src/cbdata.cc b/src/cbdata.cc index ab5ee3a6e8..c876e618c5 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -173,7 +173,7 @@ MEMPROXY_CLASS_INLINE(cbdata); #endif static OBJH cbdataDump; -#ifdef CBDATA_DEBUG +#if CBDATA_DEBUG static OBJH cbdataDumpHistory; #endif diff --git a/src/client_side_request.cc b/src/client_side_request.cc index 434c1ce202..9ee3741cab 100644 --- a/src/client_side_request.cc +++ b/src/client_side_request.cc @@ -1329,7 +1329,7 @@ ClientHttpRequest::doCallouts() #endif } -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "client_side_request.cci" #endif diff --git a/src/client_side_request.h b/src/client_side_request.h index f30335d171..76cd869e2a 100644 --- a/src/client_side_request.h +++ b/src/client_side_request.h @@ -198,7 +198,7 @@ SQUIDCEXTERN void redirectStart(ClientHttpRequest *, RH *, void *); SQUIDCEXTERN void tunnelStart(ClientHttpRequest *, int64_t *, int *); -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "Store.h" #include "client_side_request.cci" #endif diff --git a/src/comm.cc b/src/comm.cc index 6d6da26ac6..78be1f1d5d 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -52,7 +52,7 @@ #if defined(_SQUID_CYGWIN_) #include #endif -#ifdef HAVE_NETINET_TCP_H +#if HAVE_NETINET_TCP_H #include #endif @@ -234,7 +234,7 @@ static void commPlanHalfClosedCheck(); static comm_err_t commBind(int s, struct addrinfo &); static void commSetReuseAddr(int); static void commSetNoLinger(int); -#ifdef TCP_NODELAY +#if TCP_NODELAY static void commSetTcpNoDelay(int); #endif static void commSetTcpRcvbuf(int, int); @@ -658,7 +658,7 @@ limitError(int const anErrno) int comm_set_tos(int fd, int tos) { -#ifdef IP_TOS +#if IP_TOS int x = setsockopt(fd, IPPROTO_IP, IP_TOS, (char *) &tos, sizeof(int)); if (x < 0) debugs(50, 1, "comm_set_tos: setsockopt(IP_TOS) on FD " << fd << ": " << xstrerror()); @@ -672,7 +672,7 @@ comm_set_tos(int fd, int tos) void comm_set_v6only(int fd, int tos) { -#ifdef IPV6_V6ONLY +#if IPV6_V6ONLY if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (char *) &tos, sizeof(int)) < 0) { debugs(50, 1, "comm_open: setsockopt(IPV6_V6ONLY) " << (tos?"ON":"OFF") << " for FD " << fd << ": " << xstrerror()); } @@ -830,7 +830,7 @@ comm_openex(int sock_type, PROF_stop(comm_open); } -#ifdef TCP_NODELAY +#if TCP_NODELAY if (sock_type == SOCK_STREAM) commSetTcpNoDelay(new_socket); @@ -957,7 +957,7 @@ copyFDFlags(int to, fde *F) if (F->flags.nonblocking) commSetNonBlocking(to); -#ifdef TCP_NODELAY +#if TCP_NODELAY if (F->flags.nodelay) commSetTcpNoDelay(to); @@ -1784,7 +1784,7 @@ commSetTcpRcvbuf(int fd, int size) debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *) &size, sizeof(size)) < 0) debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); -#ifdef TCP_WINDOW_CLAMP +#if TCP_WINDOW_CLAMP if (setsockopt(fd, SOL_TCP, TCP_WINDOW_CLAMP, (char *) &size, sizeof(size)) < 0) debugs(50, 1, "commSetTcpRcvbuf: FD " << fd << ", SIZE " << size << ": " << xstrerror()); #endif @@ -1868,7 +1868,7 @@ commUnsetNonBlocking(int fd) void commSetCloseOnExec(int fd) { -#ifdef FD_CLOEXEC +#if FD_CLOEXEC int flags; int dummy = 0; @@ -1885,7 +1885,7 @@ commSetCloseOnExec(int fd) #endif } -#ifdef TCP_NODELAY +#if TCP_NODELAY static void commSetTcpNoDelay(int fd) { @@ -1903,20 +1903,20 @@ void commSetTcpKeepalive(int fd, int idle, int interval, int timeout) { int on = 1; -#ifdef TCP_KEEPCNT +#if TCP_KEEPCNT if (timeout && interval) { int count = (timeout + interval - 1) / interval; if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPCNT, &count, sizeof(on)) < 0) debugs(5, 1, "commSetKeepalive: FD " << fd << ": " << xstrerror()); } #endif -#ifdef TCP_KEEPIDLE +#if TCP_KEEPIDLE if (idle) { if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &idle, sizeof(on)) < 0) debugs(5, 1, "commSetKeepalive: FD " << fd << ": " << xstrerror()); } #endif -#ifdef TCP_KEEPINTVL +#if TCP_KEEPINTVL if (interval) { if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPINTVL, &interval, sizeof(on)) < 0) debugs(5, 1, "commSetKeepalive: FD " << fd << ": " << xstrerror()); @@ -2107,7 +2107,7 @@ ignoreErrno(int ierrno) case EALREADY: case EINTR: -#ifdef ERESTART +#if ERESTART case ERESTART: #endif @@ -2226,7 +2226,7 @@ comm_listen(int sock) } if (Config.accept_filter && strcmp(Config.accept_filter, "none") != 0) { -#ifdef SO_ACCEPTFILTER +#if SO_ACCEPTFILTER struct accept_filter_arg afa; bzero(&afa, sizeof(afa)); debugs(5, DBG_CRITICAL, "Installing accept filter '" << Config.accept_filter << "' on FD " << sock); @@ -2234,7 +2234,7 @@ comm_listen(int sock) x = setsockopt(sock, SOL_SOCKET, SO_ACCEPTFILTER, &afa, sizeof(afa)); if (x < 0) debugs(5, 0, "SO_ACCEPTFILTER '" << Config.accept_filter << "': '" << xstrerror()); -#elif defined(TCP_DEFER_ACCEPT) +#elif TCP_DEFER_ACCEPT int seconds = 30; if (strncmp(Config.accept_filter, "data=", 5) == 0) seconds = atoi(Config.accept_filter + 5); diff --git a/src/comm_epoll.cc b/src/comm_epoll.cc index 9d9031430b..c0e72db30d 100644 --- a/src/comm_epoll.cc +++ b/src/comm_epoll.cc @@ -59,7 +59,7 @@ #include "fde.h" #include "SquidTime.h" -#ifdef USE_EPOLL +#if USE_EPOLL #define DEBUG_EPOLL 0 diff --git a/src/comm_poll.cc b/src/comm_poll.cc index 9be098844e..99c4ea4391 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -39,7 +39,7 @@ #include "Store.h" #include "fde.h" -#ifdef USE_POLL +#if USE_POLL static int MAX_POLL_TIME = 1000; /* see also comm_quick_poll_required() */ diff --git a/src/comm_select.cc b/src/comm_select.cc index b62af37594..2e5df7358a 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -37,7 +37,7 @@ #include "CacheManager.h" #include "SquidTime.h" -#ifdef USE_SELECT +#if USE_SELECT #include "Store.h" #include "fde.h" diff --git a/src/comm_select_win32.cc b/src/comm_select_win32.cc index cb6e9fa023..c0a550f3e5 100644 --- a/src/comm_select_win32.cc +++ b/src/comm_select_win32.cc @@ -37,7 +37,7 @@ #include "CacheManager.h" #include "SquidTime.h" -#ifdef USE_SELECT_WIN32 +#if USE_SELECT_WIN32 #include "Store.h" #include "fde.h" diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 3ca09df98a..40aa538039 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -56,7 +56,7 @@ #ifndef to exclude the internal DNS code from compile process when using external DNS process. */ -#ifndef USE_DNSSERVERS +#if !USE_DNSSERVERS #ifdef _SQUID_WIN32_ #include "squid_windows.h" #define REG_TCPIP_PARA_INTERFACES "SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces" diff --git a/src/dnsserver.cc b/src/dnsserver.cc index d112d59ce2..44369f69bd 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -107,19 +107,19 @@ #if HAVE_LIBC_H #include #endif -#ifdef HAVE_SYS_SYSCALL_H +#if HAVE_SYS_SYSCALL_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H #include #endif -#ifdef HAVE_CRYPT_H +#if HAVE_CRYPT_H #include #endif #if HAVE_SYS_SELECT_H @@ -331,11 +331,11 @@ lookup(const char *buf) break; #if defined(EAI_NODATA) || defined(EAI_NONAME) -#ifdef EAI_NODATA +#if EAI_NODATA /* deprecated. obsolete on some OS */ case EAI_NODATA: #endif -#ifdef EAI_NONAME +#if EAI_NONAME case EAI_NONAME: #endif printf("$fail DNS Domain/IP '%s' exists without any FQDN/IPs: %s.\n", buf, xgai_strerror(res)); diff --git a/src/fs/Module.cc b/src/fs/Module.cc index 8833a1bbef..f1c65fb839 100644 --- a/src/fs/Module.cc +++ b/src/fs/Module.cc @@ -5,20 +5,20 @@ #include "fs/ufs/ufscommon.h" #endif -#ifdef HAVE_FS_COSS +#if HAVE_FS_COSS #include "fs/coss/StoreFScoss.h" #endif -#ifdef HAVE_FS_UFS +#if HAVE_FS_UFS static StoreFSufs *UfsInstance; #endif -#ifdef HAVE_FS_AUFS +#if HAVE_FS_AUFS static StoreFSufs *AufsInstance; #endif -#ifdef HAVE_FS_DISKD +#if HAVE_FS_DISKD static StoreFSufs *DiskdInstance; #endif @@ -27,7 +27,7 @@ static StoreFSufs *DiskdInstance; * (b) declare the StoreFScoss::stats as static and * (c) merge the StoreFScoss::stat() method with the static * StoreFScoss::Stats() */ -#ifdef HAVE_FS_COSS +#if HAVE_FS_COSS StoreFScoss &CossInstance = StoreFScoss::GetInstance(); #endif @@ -35,16 +35,16 @@ StoreFScoss &CossInstance = StoreFScoss::GetInstance(); void Fs::Init() { -#ifdef HAVE_FS_UFS +#if HAVE_FS_UFS UfsInstance = new StoreFSufs("Blocking", "ufs"); #endif -#ifdef HAVE_FS_AUFS +#if HAVE_FS_AUFS AufsInstance = new StoreFSufs("DiskThreads", "aufs");; #endif -#ifdef HAVE_FS_DISKD +#if HAVE_FS_DISKD DiskdInstance = new StoreFSufs("DiskDaemon", "diskd");; #endif @@ -53,16 +53,16 @@ void Fs::Init() void Fs::Clean() { -#ifdef HAVE_FS_UFS +#if HAVE_FS_UFS delete UfsInstance; #endif -#ifdef HAVE_FS_AUFS +#if HAVE_FS_AUFS delete AufsInstance; #endif -#ifdef HAVE_FS_DISKD +#if HAVE_FS_DISKD delete DiskdInstance; #endif diff --git a/src/fs/ufs/ufscommon.cc b/src/fs/ufs/ufscommon.cc index d994e97d0a..7f215693cb 100644 --- a/src/fs/ufs/ufscommon.cc +++ b/src/fs/ufs/ufscommon.cc @@ -821,6 +821,6 @@ RebuildState::currentItem() return currentEntry(); } -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "ufscommon.cci" #endif diff --git a/src/fs/ufs/ufscommon.h b/src/fs/ufs/ufscommon.h index 815e3b2d64..1d21ea3f10 100644 --- a/src/fs/ufs/ufscommon.h +++ b/src/fs/ufs/ufscommon.h @@ -422,7 +422,7 @@ private: void *cbdata; }; -#ifdef _USE_INLINE_ +#if _USE_INLINE_ #include "ufscommon.cci" #endif diff --git a/src/squid.h b/src/squid.h index d8c4bedf97..86b033ba93 100644 --- a/src/squid.h +++ b/src/squid.h @@ -121,13 +121,13 @@ using namespace Squid; #if HAVE_LIBC_H #include #endif -#ifdef HAVE_SYS_SYSCALL_H +#if HAVE_SYS_SYSCALL_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_BSTRING_H @@ -191,7 +191,7 @@ using namespace Squid; * and Squid may be running with a lot more.. * But only for code linked into Squid, not the helpers.. (unlinkd, pinger) */ -#ifdef SQUID_FDSET_NOUSE +#if SQUID_FDSET_NOUSE # ifndef SQUID_HELPER # define fd_set ERROR_FD_SET_USED # endif diff --git a/src/ssl_support.cc b/src/ssl_support.cc index fa76d97e7f..f578da0782 100644 --- a/src/ssl_support.cc +++ b/src/ssl_support.cc @@ -241,112 +241,112 @@ static struct ssl_option { ssl_options[] = { -#ifdef SSL_OP_MICROSOFT_SESS_ID_BUG +#if SSL_OP_MICROSOFT_SESS_ID_BUG { "MICROSOFT_SESS_ID_BUG", SSL_OP_MICROSOFT_SESS_ID_BUG }, #endif -#ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG +#if SSL_OP_NETSCAPE_CHALLENGE_BUG { "NETSCAPE_CHALLENGE_BUG", SSL_OP_NETSCAPE_CHALLENGE_BUG }, #endif -#ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG +#if SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG { "NETSCAPE_REUSE_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG }, #endif -#ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG +#if SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG { "SSLREF2_REUSE_CERT_TYPE_BUG", SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG }, #endif -#ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER +#if SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER { "MICROSOFT_BIG_SSLV3_BUFFER", SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER }, #endif -#ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING +#if SSL_OP_MSIE_SSLV2_RSA_PADDING { "MSIE_SSLV2_RSA_PADDING", SSL_OP_MSIE_SSLV2_RSA_PADDING }, #endif -#ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG +#if SSL_OP_SSLEAY_080_CLIENT_DH_BUG { "SSLEAY_080_CLIENT_DH_BUG", SSL_OP_SSLEAY_080_CLIENT_DH_BUG }, #endif -#ifdef SSL_OP_TLS_D5_BUG +#if SSL_OP_TLS_D5_BUG { "TLS_D5_BUG", SSL_OP_TLS_D5_BUG }, #endif -#ifdef SSL_OP_TLS_BLOCK_PADDING_BUG +#if SSL_OP_TLS_BLOCK_PADDING_BUG { "TLS_BLOCK_PADDING_BUG", SSL_OP_TLS_BLOCK_PADDING_BUG }, #endif -#ifdef SSL_OP_TLS_ROLLBACK_BUG +#if SSL_OP_TLS_ROLLBACK_BUG { "TLS_ROLLBACK_BUG", SSL_OP_TLS_ROLLBACK_BUG }, #endif -#ifdef SSL_OP_ALL +#if SSL_OP_ALL { "ALL", SSL_OP_ALL }, #endif -#ifdef SSL_OP_SINGLE_DH_USE +#if SSL_OP_SINGLE_DH_USE { "SINGLE_DH_USE", SSL_OP_SINGLE_DH_USE }, #endif -#ifdef SSL_OP_EPHEMERAL_RSA +#if SSL_OP_EPHEMERAL_RSA { "EPHEMERAL_RSA", SSL_OP_EPHEMERAL_RSA }, #endif -#ifdef SSL_OP_PKCS1_CHECK_1 +#if SSL_OP_PKCS1_CHECK_1 { "PKCS1_CHECK_1", SSL_OP_PKCS1_CHECK_1 }, #endif -#ifdef SSL_OP_PKCS1_CHECK_2 +#if SSL_OP_PKCS1_CHECK_2 { "PKCS1_CHECK_2", SSL_OP_PKCS1_CHECK_2 }, #endif -#ifdef SSL_OP_NETSCAPE_CA_DN_BUG +#if SSL_OP_NETSCAPE_CA_DN_BUG { "NETSCAPE_CA_DN_BUG", SSL_OP_NETSCAPE_CA_DN_BUG }, #endif -#ifdef SSL_OP_NON_EXPORT_FIRST +#if SSL_OP_NON_EXPORT_FIRST { "NON_EXPORT_FIRST", SSL_OP_NON_EXPORT_FIRST }, #endif -#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE +#if SSL_OP_CIPHER_SERVER_PREFERENCE { "CIPHER_SERVER_PREFERENCE", SSL_OP_CIPHER_SERVER_PREFERENCE }, #endif -#ifdef SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG +#if SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG { "NETSCAPE_DEMO_CIPHER_CHANGE_BUG", SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG }, #endif -#ifdef SSL_OP_NO_SSLv2 +#if SSL_OP_NO_SSLv2 { "NO_SSLv2", SSL_OP_NO_SSLv2 }, #endif -#ifdef SSL_OP_NO_SSLv3 +#if SSL_OP_NO_SSLv3 { "NO_SSLv3", SSL_OP_NO_SSLv3 }, #endif -#ifdef SSL_OP_NO_TLSv1 +#if SSL_OP_NO_TLSv1 { "NO_TLSv1", SSL_OP_NO_TLSv1 }, @@ -480,7 +480,7 @@ ssl_parse_flags(const char *flags) else if (strcmp(flag, "NO_SESSION_REUSE") == 0) fl |= SSL_FLAG_NO_SESSION_REUSE; -#ifdef X509_V_FLAG_CRL_CHECK +#if X509_V_FLAG_CRL_CHECK else if (strcmp(flag, "VERIFY_CRL") == 0) fl |= SSL_FLAG_VERIFY_CRL; @@ -577,7 +577,7 @@ ssl_initialize(void) ssl_initialized = 1; SSL_load_error_strings(); SSLeay_add_ssl_algorithms(); -#ifdef HAVE_OPENSSL_ENGINE_H +#if HAVE_OPENSSL_ENGINE_H if (Config.SSL.ssl_engine) { ENGINE *e; @@ -787,7 +787,7 @@ sslCreateServerContext(const char *certfile, const char *keyfile, int version, c fl |= SSL_FLAG_VERIFY_CRL; } -#ifdef X509_V_FLAG_CRL_CHECK +#if X509_V_FLAG_CRL_CHECK if (fl & SSL_FLAG_VERIFY_CRL_ALL) X509_STORE_set_flags(SSL_CTX_get_cert_store(sslContext), X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); else if (fl & SSL_FLAG_VERIFY_CRL) @@ -951,7 +951,7 @@ sslCreateClientContext(const char *certfile, const char *keyfile, int version, c fl |= SSL_FLAG_VERIFY_CRL; } -#ifdef X509_V_FLAG_CRL_CHECK +#if X509_V_FLAG_CRL_CHECK if (fl & SSL_FLAG_VERIFY_CRL_ALL) X509_STORE_set_flags(SSL_CTX_get_cert_store(sslContext), X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL); else if (fl & SSL_FLAG_VERIFY_CRL) diff --git a/src/stat.cc b/src/stat.cc index b90b2d8eec..44dde16621 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -107,7 +107,7 @@ static OBJH statUtilization; static OBJH statCountersHistograms; static OBJH statClientRequests; -#ifdef XMALLOC_STATISTICS +#if XMALLOC_STATISTICS static void info_get_mallstat(int, int, int, void *); static double xm_time; static double xm_deltat; @@ -425,7 +425,7 @@ statOpenfdObj(StoreEntry * sentry) #endif -#ifdef XMALLOC_STATISTICS +#if XMALLOC_STATISTICS static void info_get_mallstat(int size, int number, int oldnum, void *data) { @@ -462,7 +462,7 @@ info_get(StoreEntry * sentry) storeAppendPrintf(sentry, "Squid Object Cache: Version %s\n", version_string); -#ifdef _SQUID_WIN32_ +#if _SQUID_WIN32_ if (WIN32_run_mode == _WIN_SQUID_RUN_MODE_SERVICE) { storeAppendPrintf(sentry,"\nRunning as %s Windows System Service on %s\n", diff --git a/src/store.cc b/src/store.cc index 2876b802e1..d8032eda65 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1957,6 +1957,6 @@ NullStoreEntry::getSerialisedMetaData() return NULL; } -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "Store.cci" #endif diff --git a/src/tests/stub_client_side_request.cc b/src/tests/stub_client_side_request.cc index 46260b7276..3c685908d8 100644 --- a/src/tests/stub_client_side_request.cc +++ b/src/tests/stub_client_side_request.cc @@ -34,7 +34,7 @@ #include "client_side_request.h" #include "Store.h" -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "client_side_request.cci" #endif diff --git a/src/tests/stub_store.cc b/src/tests/stub_store.cc index d6c5ffc356..ec8407daa4 100644 --- a/src/tests/stub_store.cc +++ b/src/tests/stub_store.cc @@ -49,6 +49,6 @@ storeAppendVPrintf(StoreEntry * e, const char *fmt, va_list vargs) fatal("storeAppendVPrintf: Not implemented"); } -#ifndef _USE_INLINE_ +#if !_USE_INLINE_ #include "Store.cci" #endif diff --git a/src/tests/testAuth.cc b/src/tests/testAuth.cc index 161bd0aa9d..a6089e1e5d 100644 --- a/src/tests/testAuth.cc +++ b/src/tests/testAuth.cc @@ -11,16 +11,16 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testAuth ); CPPUNIT_TEST_SUITE_REGISTRATION( testAuthConfig ); CPPUNIT_TEST_SUITE_REGISTRATION( testAuthUserRequest ); -#ifdef HAVE_AUTH_MODULE_BASIC +#if HAVE_AUTH_MODULE_BASIC CPPUNIT_TEST_SUITE_REGISTRATION( testAuthBasicUserRequest ); #endif -#ifdef HAVE_AUTH_MODULE_DIGEST +#if HAVE_AUTH_MODULE_DIGEST CPPUNIT_TEST_SUITE_REGISTRATION( testAuthDigestUserRequest ); #endif -#ifdef HAVE_AUTH_MODULE_NTLM +#if HAVE_AUTH_MODULE_NTLM CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNTLMUserRequest ); #endif -#ifdef HAVE_AUTH_MODULE_NEGOTIATE +#if HAVE_AUTH_MODULE_NEGOTIATE CPPUNIT_TEST_SUITE_REGISTRATION( testAuthNegotiateUserRequest ); #endif @@ -182,7 +182,7 @@ testAuthUserRequest::scheme() } } -#ifdef HAVE_AUTH_MODULE_BASIC +#if HAVE_AUTH_MODULE_BASIC #include "auth/basic/auth_basic.h" /* AuthBasicUserRequest::AuthBasicUserRequest works */ @@ -208,7 +208,7 @@ testAuthBasicUserRequest::username() } #endif /* HAVE_AUTH_MODULE_BASIC */ -#ifdef HAVE_AUTH_MODULE_DIGEST +#if HAVE_AUTH_MODULE_DIGEST #include "auth/digest/auth_digest.h" /* AuthDigestUserRequest::AuthDigestUserRequest works */ @@ -234,7 +234,7 @@ testAuthDigestUserRequest::username() } #endif /* HAVE_AUTH_MODULE_DIGEST */ -#ifdef HAVE_AUTH_MODULE_NTLM +#if HAVE_AUTH_MODULE_NTLM #include "auth/ntlm/auth_ntlm.h" /* AuthNTLMUserRequest::AuthNTLMUserRequest works */ @@ -260,7 +260,7 @@ testAuthNTLMUserRequest::username() } #endif /* HAVE_AUTH_MODULE_NTLM */ -#ifdef HAVE_AUTH_MODULE_NEGOTIATE +#if HAVE_AUTH_MODULE_NEGOTIATE #include "auth/negotiate/auth_negotiate.h" /* AuthNegotiateUserRequest::AuthNegotiateUserRequest works */ diff --git a/src/tests/testAuth.h b/src/tests/testAuth.h index b1704aa0ca..44086e760a 100644 --- a/src/tests/testAuth.h +++ b/src/tests/testAuth.h @@ -47,7 +47,7 @@ protected: void construction(); }; -#ifdef HAVE_AUTH_MODULE_BASIC +#if HAVE_AUTH_MODULE_BASIC class testAuthBasicUserRequest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( testAuthBasicUserRequest ); @@ -63,7 +63,7 @@ protected: }; #endif -#ifdef HAVE_AUTH_MODULE_DIGEST +#if HAVE_AUTH_MODULE_DIGEST class testAuthDigestUserRequest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( testAuthDigestUserRequest ); @@ -79,7 +79,7 @@ protected: }; #endif -#ifdef HAVE_AUTH_MODULE_NTLM +#if HAVE_AUTH_MODULE_NTLM class testAuthNTLMUserRequest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( testAuthNTLMUserRequest ); @@ -95,7 +95,7 @@ protected: }; #endif -#ifdef HAVE_AUTH_MODULE_NEGOTIATE +#if HAVE_AUTH_MODULE_NEGOTIATE class testAuthNegotiateUserRequest : public CPPUNIT_NS::TestFixture { CPPUNIT_TEST_SUITE( testAuthNegotiateUserRequest ); diff --git a/src/tools.cc b/src/tools.cc index 91c2110e81..7d3fd96230 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -405,7 +405,7 @@ sigusr2_handle(int sig) /* no debugs() here; bad things happen if the signal is delivered during _db_print() */ if (state == 0) { -#ifndef MEM_GEN_TRACE +#if !MEM_GEN_TRACE Debug::parseOptions("ALL,7"); #else @@ -414,7 +414,7 @@ sigusr2_handle(int sig) state = 1; } else { -#ifndef MEM_GEN_TRACE +#if !MEM_GEN_TRACE Debug::parseOptions(Debug::debugOptions); #else diff --git a/src/url.cc b/src/url.cc index d9ac26f6d7..43b0f465c8 100644 --- a/src/url.cc +++ b/src/url.cc @@ -369,7 +369,7 @@ urlParse(const HttpRequestMethod& method, char *url, HttpRequest *request) return NULL; } -#ifdef HARDCODE_DENY_PORTS +#if HARDCODE_DENY_PORTS /* These ports are filtered in the default squid.conf, but * maybe someone wants them hardcoded... */ if (port == 7 || port == 9 || port == 19) { @@ -810,7 +810,7 @@ urlCheckRequest(const HttpRequest * r) break; case PROTO_HTTPS: -#ifdef USE_SSL +#if USE_SSL rc = 1; diff --git a/test-suite/hash.c b/test-suite/hash.c index f69dc0b1c3..7429aab9a7 100644 --- a/test-suite/hash.c +++ b/test-suite/hash.c @@ -348,7 +348,7 @@ hashFreeMemory(hash_table * hid) } -#ifdef USE_HASH_DRIVER +#if USE_HASH_DRIVER /* * hash-driver - Run with a big file as stdin to insert each line into the * hash table, then prints the whole hash table, then deletes a random item, diff --git a/test-suite/pconn-banger.c b/test-suite/pconn-banger.c index ca9a72274a..e5a95f9996 100644 --- a/test-suite/pconn-banger.c +++ b/test-suite/pconn-banger.c @@ -44,13 +44,13 @@ #if HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif -#ifdef HAVE_BSTRING_H +#if HAVE_BSTRING_H #include #endif #if HAVE_SYS_TYPES_H diff --git a/test-suite/tcp-banger2.c b/test-suite/tcp-banger2.c index aff3fbfc04..62a335938a 100644 --- a/test-suite/tcp-banger2.c +++ b/test-suite/tcp-banger2.c @@ -45,10 +45,10 @@ #if HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_SYS_TYPES_H diff --git a/test-suite/tcp-banger3.c b/test-suite/tcp-banger3.c index d3ac5b21a2..731685d5ec 100644 --- a/test-suite/tcp-banger3.c +++ b/test-suite/tcp-banger3.c @@ -43,10 +43,10 @@ #if HAVE_FCNTL_H #include #endif -#ifdef HAVE_STRING_H +#if HAVE_STRING_H #include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H #include #endif #if HAVE_SYS_TYPES_H