From: Amos Jeffries Date: Sun, 18 Jun 2017 15:17:48 +0000 (+1200) Subject: Cleanup: remove many whitespace typos X-Git-Tag: M-staged-PR71~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e167fa2396d9469017d2ff4c5a3ded5a5b58317;p=thirdparty%2Fsquid.git Cleanup: remove many whitespace typos ... caught by astyle 2.06 but ignored by 2.04 --- diff --git a/lib/libTrie/Trie.cc b/lib/libTrie/Trie.cc index 64062149da..28d805889e 100644 --- a/lib/libTrie/Trie.cc +++ b/lib/libTrie/Trie.cc @@ -15,7 +15,7 @@ #include #endif -Trie::Trie(TrieCharTransform *aTransform) : head(0) , transform(aTransform) +Trie::Trie(TrieCharTransform *aTransform) : head(0), transform(aTransform) {} Trie::~Trie() diff --git a/lib/libTrie/test/trie.cc b/lib/libTrie/test/trie.cc index b83324ae68..ad16fce177 100644 --- a/lib/libTrie/test/trie.cc +++ b/lib/libTrie/test/trie.cc @@ -47,12 +47,12 @@ CaseSensitiveCheck() return 1; } - if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) { + if (aTrie.findPrefix("User-AgentFoo", 13) != (void *)1) { std::cerr << "Could not find User prefix" << std::endl; return 1; } - if (aTrie.findPrefix("user-agentFoo" , 13) == (void *)1) { + if (aTrie.findPrefix("user-agentFoo", 13) == (void *)1) { std::cerr << "found user prefix" << std::endl; return 1; } @@ -95,12 +95,12 @@ CaseInsensitiveCheck() return 1; } - if (aTrie.findPrefix("User-AgentFoo" , 13) != (void *)1) { + if (aTrie.findPrefix("User-AgentFoo", 13) != (void *)1) { std::cerr << "Could not find User prefix" << std::endl; return 1; } - if (aTrie.findPrefix("user-agentFoo" , 13) != (void *)1) { + if (aTrie.findPrefix("user-agentFoo", 13) != (void *)1) { std::cerr << "Could not find user prefix" << std::endl; return 1; } diff --git a/lib/ntlmauth/ntlmauth.cc b/lib/ntlmauth/ntlmauth.cc index 578016b00a..cb2cfc7b1b 100644 --- a/lib/ntlmauth/ntlmauth.cc +++ b/lib/ntlmauth/ntlmauth.cc @@ -257,7 +257,7 @@ ntlm_unpack_auth(const ntlm_authenticate *auth, char *user, char *domain, const debug("ntlm_unpack_auth: Domain '%s' (len=%d).\n", domain, rv.l); } if (rv.l >= size) { - debug("ntlm_unpack_auth: Domain length %d too big for %d byte packet.\n", rv.l , size); + debug("ntlm_unpack_auth: Domain length %d too big for %d byte packet.\n", rv.l, size); return NTLM_ERR_BLOB; } diff --git a/lib/smblib/smb-errors.c b/lib/smblib/smb-errors.c index 2409fb4d2b..143c889ddd 100644 --- a/lib/smblib/smb-errors.c +++ b/lib/smblib/smb-errors.c @@ -125,7 +125,7 @@ err_code_struct hard_msgs[] = { {"ERRbadcmd",22,"Unknown command."}, {"ERRdata",23,"Data error (CRC)."}, {"ERRbadreq",24,"Bad request structure length."}, - {"ERRseek",25 ,"Seek error."}, + {"ERRseek",25,"Seek error."}, {"ERRbadmedia",26,"Unknown media type."}, {"ERRbadsector",27,"Sector not found."}, {"ERRnopaper",28,"Printer out of paper."}, diff --git a/src/AclRegs.cc b/src/AclRegs.cc index 73814e3963..18a4dbd249 100644 --- a/src/AclRegs.cc +++ b/src/AclRegs.cc @@ -124,7 +124,7 @@ Acl::Init() RegisterMaker("dst_as", [](TypeName name)->ACL* { return new ACLStrategised(new ACLASN, new ACLDestinationASNStrategy, name); }); RegisterMaker("browser", [](TypeName name)->ACL* { return new ACLStrategised(new ACLRegexData, new ACLRequestHeaderStrategy, name); }); RegisterMaker("dstdomain", [](TypeName name)->ACL* { return new ACLStrategised(new ACLDomainData, new ACLDestinationDomainStrategy, name); }); - RegisterMaker("dstdom_regex", [](TypeName name)->ACL* { return new ACLStrategised(new ACLRegexData, new ACLDestinationDomainStrategy , name); }); + RegisterMaker("dstdom_regex", [](TypeName name)->ACL* { return new ACLStrategised(new ACLRegexData, new ACLDestinationDomainStrategy, name); }); RegisterMaker("dst", [](TypeName)->ACL* { return new ACLDestinationIP; }); // XXX: Add name parameter to ctor RegisterMaker("hier_code", [](TypeName name)->ACL* { return new ACLStrategised(new ACLHierCodeData, new ACLHierCodeStrategy, name); }); RegisterMaker("rep_header", [](TypeName name)->ACL* { return new ACLStrategised(new ACLHTTPHeaderData, new ACLHTTPRepHeaderStrategy, name); }); diff --git a/src/DiskIO/AIO/AIODiskFile.cc b/src/DiskIO/AIO/AIODiskFile.cc index 13f99fa7ed..ea00d03591 100644 --- a/src/DiskIO/AIO/AIODiskFile.cc +++ b/src/DiskIO/AIO/AIODiskFile.cc @@ -58,7 +58,7 @@ AIODiskFile::open(int flags, mode_t, RefCount callback) #if _SQUID_WINDOWS_ fd = aio_open(path.termedBuf(), flags); #else - fd = file_open(path.termedBuf() , flags); + fd = file_open(path.termedBuf(), flags); #endif ioRequestor = callback; diff --git a/src/DiskIO/Blocking/BlockingFile.cc b/src/DiskIO/Blocking/BlockingFile.cc index b63cb11519..4715c597bc 100644 --- a/src/DiskIO/Blocking/BlockingFile.cc +++ b/src/DiskIO/Blocking/BlockingFile.cc @@ -39,7 +39,7 @@ void BlockingFile::open(int flags, mode_t, RefCount callback) { /* Simulate async calls */ - fd = file_open(path_ , flags); + fd = file_open(path_, flags); ioRequestor = callback; if (fd < 0) { diff --git a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc index 652597e669..f8b3a2b69b 100644 --- a/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc +++ b/src/DiskIO/DiskDaemon/DiskdIOStrategy.cc @@ -86,7 +86,7 @@ DiskdIOStrategy::newFile(char const *path) return new DiskdFile (path, this); } -DiskdIOStrategy::DiskdIOStrategy() : magic1(64), magic2(72), away(0) , smsgid(-1), rmsgid(-1), wfd(-1) , instanceID(newInstance()) +DiskdIOStrategy::DiskdIOStrategy() : magic1(64), magic2(72), away(0), smsgid(-1), rmsgid(-1), wfd(-1), instanceID(newInstance()) {} bool diff --git a/src/DiskIO/Mmapped/MmappedFile.cc b/src/DiskIO/Mmapped/MmappedFile.cc index bd4eeed3a5..c038e75743 100644 --- a/src/DiskIO/Mmapped/MmappedFile.cc +++ b/src/DiskIO/Mmapped/MmappedFile.cc @@ -74,7 +74,7 @@ MmappedFile::open(int flags, mode_t, RefCount callback) assert(fd < 0); /* Simulate async calls */ - fd = file_open(path_ , flags); + fd = file_open(path_, flags); ioRequestor = callback; if (fd < 0) { diff --git a/src/Generic.h b/src/Generic.h index c84dd4fcc7..c22bf3cbd4 100644 --- a/src/Generic.h +++ b/src/Generic.h @@ -68,7 +68,7 @@ private: C const *theInstance; }; -template +template Visitor& for_each(InputIterator from, InputIterator to, Visitor& visitor) { while (!(from == to)) { diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index cd07978298..b17509dc80 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -257,7 +257,7 @@ HttpHdrCc::packInto(Packable * p) const if (isSet(flag) && flag != HttpHdrCcType::CC_OTHER) { /* print option name for all options */ - p->appendf((pcount ? ", %s": "%s") , CcAttrs[flag].name); + p->appendf((pcount ? ", %s": "%s"), CcAttrs[flag].name); /* for all options having values, "=value" after the name */ switch (flag) { diff --git a/src/LeakFinder.cc b/src/LeakFinder.cc index c19a1c674d..bb79e495a1 100644 --- a/src/LeakFinder.cc +++ b/src/LeakFinder.cc @@ -22,7 +22,7 @@ /* ========================================================================= */ -LeakFinderPtr::LeakFinderPtr(void *p , const char *f, const int l) : +LeakFinderPtr::LeakFinderPtr(void *p, const char *f, const int l) : file(f), line(l), when(squid_curtime) diff --git a/src/SBufStatsAction.cc b/src/SBufStatsAction.cc index 89a6090f1c..d80af8ece5 100644 --- a/src/SBufStatsAction.cc +++ b/src/SBufStatsAction.cc @@ -85,6 +85,6 @@ SBufStatsAction::unpack(const Ipc::TypedMsgHdr& msg) void SBufStatsAction::RegisterWithCacheManager() { - Mgr::RegisterAction("sbuf", "String-Buffer statistics", &SBufStatsAction::Create, 0 , 1); + Mgr::RegisterAction("sbuf", "String-Buffer statistics", &SBufStatsAction::Create, 0, 1); } diff --git a/src/StatCounters.h b/src/StatCounters.h index 28575f4edb..d371b0d44e 100644 --- a/src/StatCounters.h +++ b/src/StatCounters.h @@ -57,7 +57,7 @@ public: int errors; ByteCounter kbytes_in; ByteCounter kbytes_out; - } all , http, ftp, other; + } all, http, ftp, other; } server; struct { diff --git a/src/acl/Random.cc b/src/acl/Random.cc index 58f7279317..8d7b76cb3e 100644 --- a/src/acl/Random.cc +++ b/src/acl/Random.cc @@ -25,7 +25,7 @@ ACLRandom::clone() const ACLRandom::ACLRandom(char const *theClass) : data(0.0), class_(theClass) { - memset(pattern, 0 , sizeof(pattern)); + memset(pattern, 0, sizeof(pattern)); } ACLRandom::ACLRandom(ACLRandom const & old) : data(old.data), class_(old.class_) diff --git a/src/acl/RegexData.cc b/src/acl/RegexData.cc index f6c33b5b38..202a487d37 100644 --- a/src/acl/RegexData.cc +++ b/src/acl/RegexData.cc @@ -231,7 +231,7 @@ compileUnoptimisedREs(std::list &curlist, const SBufList &sl) } else if (configurationLineWord == plus_i) { flags &= ~REG_ICASE; } else { - if (!compileRE(curlist, configurationLineWord.c_str() , flags)) + if (!compileRE(curlist, configurationLineWord.c_str(), flags)) debugs(28, DBG_CRITICAL, "ERROR: Skipping regular expression. " "Compile failed: '" << configurationLineWord << "'"); } diff --git a/src/acl/external/kerberos_ldap_group/support.h b/src/acl/external/kerberos_ldap_group/support.h index c371c7c296..966709cd90 100644 --- a/src/acl/external/kerberos_ldap_group/support.h +++ b/src/acl/external/kerberos_ldap_group/support.h @@ -126,11 +126,11 @@ SQUIDCEXTERN int log_enabled; #define error(X...) \ fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \ fprintf(stderr,X); \ - + #define warn(X...) \ fprintf(stderr, "%s(%d): pid=%ld :", __FILE__, __LINE__, (long)getpid() ); \ fprintf(stderr,X); \ - + #else /* __GNUC__ */ /* non-GCC compilers can't do the above macro define yet. */ diff --git a/src/acl/external/kerberos_ldap_group/support_krb5.cc b/src/acl/external/kerberos_ldap_group/support_krb5.cc index d10658fec2..c36d657e15 100644 --- a/src/acl/external/kerberos_ldap_group/support_krb5.cc +++ b/src/acl/external/kerberos_ldap_group/support_krb5.cc @@ -333,7 +333,7 @@ krb5_create_cache(char *domain) #endif if (code) { - k5_error("Error while initialising credentials from keytab" ,code); + k5_error("Error while initialising credentials from keytab",code); safe_free(principal_name); if (principal) krb5_free_principal(kparam.context, principal); @@ -345,7 +345,7 @@ krb5_create_cache(char *domain) } code = krb5_cc_initialize(kparam.context, kparam.cc[ccindex], principal); if (code) { - k5_error("Error while initialising memory caches" ,code); + k5_error("Error while initialising memory caches",code); safe_free(principal_name); if (principal) krb5_free_principal(kparam.context, principal); @@ -357,7 +357,7 @@ krb5_create_cache(char *domain) } code = krb5_cc_store_cred(kparam.context, kparam.cc[ccindex], creds); if (code) { - k5_error("Error while storing credentials" ,code); + k5_error("Error while storing credentials",code); if (principal) krb5_free_principal(kparam.context, principal); safe_free(principal_name); @@ -373,13 +373,13 @@ krb5_create_cache(char *domain) } if (code && code != KRB5_KT_END) { - k5_error("Error while scanning keytab" ,code); + k5_error("Error while scanning keytab",code); retval = 1; goto cleanup; } code = krb5_kt_end_seq_get(kparam.context, keytab, &cursor); if (code) { - k5_error("Error while ending keytab scan" ,code); + k5_error("Error while ending keytab scan",code); retval = 1; goto cleanup; } @@ -401,7 +401,7 @@ krb5_create_cache(char *domain) */ code = krb5_unparse_name(kparam.context, principal_list[i], &principal_name); if (code) { - k5_error("Error while unparsing principal name" ,code); + k5_error("Error while unparsing principal name",code); goto loop_end; } debug((char *) "%s| %s: DEBUG: Keytab entry has principal: %s\n", LogTime(), PROGRAM, principal_name); @@ -417,17 +417,17 @@ krb5_create_cache(char *domain) code = krb5_get_in_tkt_with_keytab(kparam.context, 0, NULL, NULL, NULL, keytab, NULL, creds, 0); #endif if (code) { - k5_error("Error while initialising credentials from keytab" ,code); + k5_error("Error while initialising credentials from keytab",code); goto loop_end; } code = krb5_cc_initialize(kparam.context, kparam.cc[ccindex], principal_list[i]); if (code) { - k5_error("Error while initialising memory caches" ,code); + k5_error("Error while initialising memory caches",code); goto loop_end; } code = krb5_cc_store_cred(kparam.context, kparam.cc[ccindex], creds); if (code) { - k5_error("Error while storing credentials" ,code); + k5_error("Error while storing credentials",code); goto loop_end; } if (creds->server) @@ -442,12 +442,12 @@ krb5_create_cache(char *domain) code = krb5_parse_name(kparam.context, service, &creds->server); xfree(service); if (code) { - k5_error("Error while initialising TGT credentials" ,code); + k5_error("Error while initialising TGT credentials",code); goto loop_end; } code = krb5_get_credentials(kparam.context, 0, kparam.cc[ccindex], creds, &tgt_creds); if (code) { - k5_error("Error while getting tgt" ,code); + k5_error("Error while getting tgt",code); goto loop_end; } else { debug((char *) "%s| %s: DEBUG: Found trusted principal name: %s\n", LogTime(), PROGRAM, principal_name); @@ -479,7 +479,7 @@ loop_end: */ code = krb5_unparse_name(kparam.context, principal, &principal_name); if (code) { - k5_error("Error while unparsing principal name" ,code); + k5_error("Error while unparsing principal name",code); retval = 1; goto cleanup; } diff --git a/src/acl/external/kerberos_ldap_group/support_ldap.cc b/src/acl/external/kerberos_ldap_group/support_ldap.cc index 96c9ced0fd..25b0ec24e3 100644 --- a/src/acl/external/kerberos_ldap_group/support_ldap.cc +++ b/src/acl/external/kerberos_ldap_group/support_ldap.cc @@ -75,9 +75,9 @@ LDAP *tool_ldap_open(struct main_args *margs, char *host, int port, char *ssl); #define ATTRIBUTE_AD "memberof" size_t get_attributes(LDAP * ld, LDAPMessage * res, - const char *attribute /* IN */ , char ***out_val /* OUT (caller frees) */ ); + const char *attribute /* IN */, char ***out_val /* OUT (caller frees) */ ); size_t get_bin_attributes(LDAP * ld, LDAPMessage * res, - const char *attribute /* IN */ , char ***out_val, + const char *attribute /* IN */, char ***out_val, int **out_len /* OUT (caller frees) */ ); int search_group_tree(struct main_args *margs, LDAP * ld, char *bindp, char *ldap_group, char *group, int depth); diff --git a/src/acl/external/session/ext_session_acl.cc b/src/acl/external/session/ext_session_acl.cc index 009f67c357..8e58bfc969 100644 --- a/src/acl/external/session/ext_session_acl.cc +++ b/src/acl/external/session/ext_session_acl.cc @@ -73,7 +73,7 @@ static void init_db(void) /* If directory then open database environment. This prevents sync problems between different processes. Otherwise fallback to single file */ db_env_create(&db_env, 0); - if (db_env->open(db_env, db_path, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK , 0666)) { + if (db_env->open(db_env, db_path, DB_CREATE | DB_INIT_MPOOL | DB_INIT_LOCK, 0666)) { fprintf(stderr, "FATAL: %s: Failed to open database environment in '%s'\n", program_name, db_path); db_env->close(db_env, 0); exit(EXIT_FAILURE); diff --git a/src/adaptation/ecap/ServiceRep.cc b/src/adaptation/ecap/ServiceRep.cc index 7983d06912..3b370e14a9 100644 --- a/src/adaptation/ecap/ServiceRep.cc +++ b/src/adaptation/ecap/ServiceRep.cc @@ -152,7 +152,7 @@ Adaptation::Ecap::Engine::kickAsyncServices(timeval &timeout) /* Adaptation::Ecap::ServiceRep */ Adaptation::Ecap::ServiceRep::ServiceRep(const ServiceConfigPointer &cfg): -/*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg), + /*AsyncJob("Adaptation::Ecap::ServiceRep"),*/ Adaptation::Service(cfg), isDetached(false) { } diff --git a/src/esi/Esi.cc b/src/esi/Esi.cc index c87e760c53..d009d8db83 100644 --- a/src/esi/Esi.cc +++ b/src/esi/Esi.cc @@ -1575,7 +1575,7 @@ esiLiteral::makeCacheable() const } ESIElement::Pointer -esiLiteral::makeUsable(esiTreeParentPtr , ESIVarState &newVarState) const +esiLiteral::makeUsable(esiTreeParentPtr, ESIVarState &newVarState) const { debugs(86, 5, "esiLiteral::makeUsable: Creating usable literal"); esiLiteral * result = new esiLiteral (*this); diff --git a/src/format/Format.cc b/src/format/Format.cc index 152a2a85e7..7e262fdc9f 100644 --- a/src/format/Format.cc +++ b/src/format/Format.cc @@ -1391,7 +1391,7 @@ Format::Format::assemble(MemBuf &mb, const AccessLogEntry::Pointer &al, int logS out = sb.c_str(); } else if (doMsec) { if (fmt->widthMax < 0) { - sb.appendf("%0*ld", fmt->widthMin , tvToMsec(outtv)); + sb.appendf("%0*ld", fmt->widthMin, tvToMsec(outtv)); } else { int precision = fmt->widthMax; sb.appendf("%0*" PRId64 ".%0*" PRId64 "", fmt->zero && (fmt->widthMin - precision - 1 >= 0) ? fmt->widthMin - precision - 1 : 0, static_cast(outtv.tv_sec * 1000 + outtv.tv_usec / 1000), precision, static_cast((outtv.tv_usec % 1000 )* (1000 / fmt->divisor))); diff --git a/src/ip/Address.cc b/src/ip/Address.cc index c22e26ca20..479e3fbfa0 100644 --- a/src/ip/Address.cc +++ b/src/ip/Address.cc @@ -67,7 +67,7 @@ Ip::Address::cidr() const continue ; /* A short-cut */ } - for (caught = 0 , bit= 7 ; !caught && (bit <= 7); --bit) { + for (caught = 0, bit= 7 ; !caught && (bit <= 7); --bit) { caught = ((ipbyte & 0x80) == 0x00); /* Found a '0' at 'bit' ? */ if (!caught) diff --git a/src/ipc/Messages.h b/src/ipc/Messages.h index fb3e6c7b95..e7fc06a196 100644 --- a/src/ipc/Messages.h +++ b/src/ipc/Messages.h @@ -24,8 +24,8 @@ typedef enum { mtNone = 0, mtRegistration, mtCollapsedForwardingNotification, mtCacheMgrRequest, mtCacheMgrResponse #if SQUID_SNMP - , - mtSnmpRequest, mtSnmpResponse +, +mtSnmpRequest, mtSnmpResponse #endif } MessageType; diff --git a/src/main.cc b/src/main.cc index ff10948459..4962964102 100644 --- a/src/main.cc +++ b/src/main.cc @@ -659,7 +659,7 @@ mainParseOptions(int argc, char *argv[]) case 'v': /** \par v * Display squid version and build information. Then exit. */ - printf("Squid Cache: Version %s\n" ,version_string); + printf("Squid Cache: Version %s\n",version_string); printf("Service Name: " SQUIDSBUFPH "\n", SQUIDSBUFPRINT(service_name)); if (strlen(SQUID_BUILD_INFO)) printf("%s\n",SQUID_BUILD_INFO); diff --git a/src/mem/PoolChunked.cc b/src/mem/PoolChunked.cc index 37384ec7ad..e1925e561e 100644 --- a/src/mem/PoolChunked.cc +++ b/src/mem/PoolChunked.cc @@ -136,7 +136,7 @@ MemChunk::MemChunk(MemPoolChunked *aPool) } MemPoolChunked::MemPoolChunked(const char *aLabel, size_t aSize) : - MemImplementingAllocator(aLabel, aSize) , chunk_size(0), + MemImplementingAllocator(aLabel, aSize), chunk_size(0), chunk_capacity(0), chunkCount(0), freeCache(0), nextFreeChunk(0), Chunks(0), allChunks(Splay()) { diff --git a/src/mem/old_api.cc b/src/mem/old_api.cc index 0561a75535..c15016fa86 100644 --- a/src/mem/old_api.cc +++ b/src/mem/old_api.cc @@ -717,7 +717,7 @@ Mem::Report(std::ostream &stream) /* Get stats for Totals report line */ memPoolGetGlobalStats(&mp_total); - MemPoolStats *sortme = (MemPoolStats *) xcalloc(mp_total.tot_pools_alloc ,sizeof(*sortme)); + MemPoolStats *sortme = (MemPoolStats *) xcalloc(mp_total.tot_pools_alloc,sizeof(*sortme)); int npools = 0; /* main table */ diff --git a/src/sbuf/SBuf.cc b/src/sbuf/SBuf.cc index 2cc50f1cfb..c9ca896c75 100644 --- a/src/sbuf/SBuf.cc +++ b/src/sbuf/SBuf.cc @@ -658,7 +658,7 @@ SBuf::find(const SBuf &needle, size_type startPos) const ", lastPossible=" << (void*) lastPossible ); tmp = static_cast(memchr(start, needleBegin, lastPossible-start)); if (tmp == NULL) { - debugs(24, 8 , "First byte not found"); + debugs(24, 8, "First byte not found"); return npos; } // lastPossible guarrantees no out-of-bounds with memcmp() diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 4965278c72..e931b55f83 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -745,7 +745,7 @@ peer_Inst(oid * name, snint * len, mib_tree_entry * current, oid_ParseFn ** Fn) int no = name[current->len] ; int i; // Note: This works because the Config.peers keeps its index according to its position. - for ( i=0 ; peers && (i < no) ; peers = peers->next , ++i ) ; + for ( i=0 ; peers && (i < no) ; peers = peers->next, ++i ) ; if (peers) { debugs(49, 6, "snmp peer_Inst: Encode peer #" << i); diff --git a/src/ssl/cert_validate_message.cc b/src/ssl/cert_validate_message.cc index 74d98409c3..6680053b52 100644 --- a/src/ssl/cert_validate_message.cc +++ b/src/ssl/cert_validate_message.cc @@ -71,7 +71,7 @@ get_error_id(const char *label, size_t len) const char *e = label + len -1; while (e != label && xisdigit(*e)) --e; if (e != label) ++e; - return strtol(e, 0 , 10); + return strtol(e, 0, 10); } bool diff --git a/src/stmem.cc b/src/stmem.cc index f559cc3e5f..fba0e88afc 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -104,7 +104,7 @@ mem_hdr::freeDataUpto(int64_t target_offset) int mem_hdr::appendToNode(mem_node *aNode, const char *data, int maxLength) { - size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length ,maxLength, data); + size_t result = writeAvailable (aNode, aNode->nodeBuffer.offset + aNode->nodeBuffer.length,maxLength, data); return result; } diff --git a/src/store_client.cc b/src/store_client.cc index 0542371517..a76864c7eb 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -112,7 +112,7 @@ store_client::callback(ssize_t sz, bool error) if (sz >= 0 && !error) bSz = sz; - StoreIOBuffer result(bSz, 0 ,copyInto.data); + StoreIOBuffer result(bSz, 0,copyInto.data); if (sz < 0 || error) result.flags.error = 1; diff --git a/src/tests/stub_ETag.cc b/src/tests/stub_ETag.cc index 7fa1eb8a5b..07ef46e8bd 100644 --- a/src/tests/stub_ETag.cc +++ b/src/tests/stub_ETag.cc @@ -12,7 +12,7 @@ #define STUB_API "ETag.cc" #include "tests/STUB.h" -int etagParseInit(ETag * , const char *) STUB_RETVAL(0) +int etagParseInit(ETag *, const char *) STUB_RETVAL(0) bool etagIsStrongEqual(const ETag &, const ETag &) STUB_RETVAL(false) bool etagIsWeakEqual(const ETag &, const ETag &) STUB_RETVAL(false) diff --git a/src/tests/testAddress.cc b/src/tests/testAddress.cc index c7471d4d86..dc5c86a02b 100644 --- a/src/tests/testAddress.cc +++ b/src/tests/testAddress.cc @@ -45,7 +45,7 @@ testIpAddress::testDefaults() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( !anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( anIPA.isIPv6() ); } @@ -66,7 +66,7 @@ testIpAddress::testInAddrConstructor() CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp(&inval, &outval, sizeof(struct in_addr)) == 0 ); } @@ -90,7 +90,7 @@ testIpAddress::testInAddr6Constructor() CPPUNIT_ASSERT( !anIPA.isIPv4() ); CPPUNIT_ASSERT( anIPA.isIPv6() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &inval, &outval, sizeof(struct in6_addr)) == 0 ); } @@ -119,7 +119,7 @@ testIpAddress::testSockAddrConstructor() CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); CPPUNIT_ASSERT( anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, anIPA.port() ); anIPA.getSockAddr(outsock); CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 ); } @@ -151,7 +151,7 @@ testIpAddress::testSockAddr6Constructor() CPPUNIT_ASSERT( !anIPA.isIPv4() ); CPPUNIT_ASSERT( anIPA.isIPv6() ); CPPUNIT_ASSERT( anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, anIPA.port() ); anIPA.getSockAddr(outsock); CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in6)) == 0 ); } @@ -181,7 +181,7 @@ testIpAddress::testCopyConstructor() CPPUNIT_ASSERT( outIPA.isIPv4() ); CPPUNIT_ASSERT( !outIPA.isIPv6() ); CPPUNIT_ASSERT( outIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 80 , outIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 80, outIPA.port() ); outIPA.getSockAddr(outsock); CPPUNIT_ASSERT( memcmp( &insock, &outsock, sizeof(struct sockaddr_in)) == 0 ); } @@ -206,7 +206,7 @@ testIpAddress::testHostentConstructor() CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); } @@ -226,7 +226,7 @@ testIpAddress::testStringConstructor() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); @@ -251,7 +251,7 @@ testIpAddress::testStringConstructor() CPPUNIT_ASSERT( !bnIPA.isIPv4() ); CPPUNIT_ASSERT( bnIPA.isIPv6() ); CPPUNIT_ASSERT( !bnIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , bnIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, bnIPA.port() ); bnIPA.getInAddr(outval6); CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 ); @@ -269,7 +269,7 @@ testIpAddress::testStringConstructor() CPPUNIT_ASSERT( !cnIPA.isIPv4() ); CPPUNIT_ASSERT( cnIPA.isIPv6() ); CPPUNIT_ASSERT( !cnIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , cnIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, cnIPA.port() ); cnIPA.getInAddr(outval6); CPPUNIT_ASSERT( memcmp( &expectv6, &outval6, sizeof(struct in6_addr)) == 0 ); } @@ -290,7 +290,7 @@ testIpAddress::testsetEmpty() CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); anIPA.setEmpty(); @@ -300,7 +300,7 @@ testIpAddress::testsetEmpty() CPPUNIT_ASSERT( !anIPA.isIPv4() ); CPPUNIT_ASSERT( anIPA.isIPv6() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); } void @@ -548,10 +548,10 @@ testIpAddress::testMasking() /* Test Basic CIDR Routine */ anIPA.setAnyAddr(); - CPPUNIT_ASSERT_EQUAL( 0 ,anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 0,anIPA.cidr() ); anIPA.setNoAddr(); - CPPUNIT_ASSERT_EQUAL( 128 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 128, anIPA.cidr() ); /* Test Numeric ApplyCIDR */ anIPA.setNoAddr(); @@ -560,15 +560,15 @@ testIpAddress::testMasking() anIPA.setNoAddr(); CPPUNIT_ASSERT( anIPA.applyMask(31,AF_INET) ); - CPPUNIT_ASSERT_EQUAL( 127 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 127, anIPA.cidr() ); anIPA.setNoAddr(); CPPUNIT_ASSERT( anIPA.applyMask(127,AF_INET6) ); - CPPUNIT_ASSERT_EQUAL( 127 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 127, anIPA.cidr() ); anIPA.setNoAddr(); anIPA.applyMask(80,AF_INET6); - CPPUNIT_ASSERT_EQUAL( 80 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 80, anIPA.cidr() ); /* BUG Check: test values by display. */ CPPUNIT_ASSERT( anIPA.toStr(buf,MAX_IPSTRLEN) != NULL ); @@ -577,16 +577,16 @@ testIpAddress::testMasking() /* Test Network Bitmask from Ip::Address */ anIPA.setNoAddr(); maskIPA = "255.255.240.0"; - CPPUNIT_ASSERT_EQUAL( 20 , maskIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 20, maskIPA.cidr() ); anIPA.applyMask(maskIPA); - CPPUNIT_ASSERT_EQUAL( 20 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 20, anIPA.cidr() ); /* BUG Check: test values memory after masking. */ struct in_addr btest; CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); anIPA.getInAddr(btest); - CPPUNIT_ASSERT_EQUAL( (uint32_t)htonl(0xFFFFF000) , btest.s_addr ); + CPPUNIT_ASSERT_EQUAL( (uint32_t)htonl(0xFFFFF000), btest.s_addr ); /* BUG Check failing test. Masked values for display. */ CPPUNIT_ASSERT( memcmp("255.255.240.0",anIPA.toStr(buf,MAX_IPSTRLEN), 13) == 0 ); @@ -601,7 +601,7 @@ testIpAddress::testMasking() CPPUNIT_ASSERT( !maskIPA.isNoAddr() ); anIPA.applyMask(maskIPA); CPPUNIT_ASSERT( !anIPA.isNoAddr() ); - CPPUNIT_ASSERT_EQUAL( 44 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 44, anIPA.cidr() ); anIPA.setNoAddr(); maskIPA.setNoAddr(); @@ -617,7 +617,7 @@ testIpAddress::testMasking() CPPUNIT_ASSERT( !maskIPA.isNoAddr() ); CPPUNIT_ASSERT( maskIPA.isIPv4() ); CPPUNIT_ASSERT( !maskIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( 20 , anIPA.cidr() ); + CPPUNIT_ASSERT_EQUAL( 20, anIPA.cidr() ); } void @@ -740,7 +740,7 @@ testIpAddress::testBugNullingDisplay() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); @@ -753,7 +753,7 @@ testIpAddress::testBugNullingDisplay() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); @@ -766,7 +766,7 @@ testIpAddress::testBugNullingDisplay() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); @@ -779,7 +779,7 @@ testIpAddress::testBugNullingDisplay() CPPUNIT_ASSERT( !anIPA.isNoAddr() ); CPPUNIT_ASSERT( anIPA.isIPv4() ); CPPUNIT_ASSERT( !anIPA.isIPv6() ); - CPPUNIT_ASSERT_EQUAL( (unsigned short) 0 , anIPA.port() ); + CPPUNIT_ASSERT_EQUAL( (unsigned short) 0, anIPA.port() ); CPPUNIT_ASSERT( !anIPA.isSockAddr() ); anIPA.getInAddr(outval); CPPUNIT_ASSERT( memcmp( &expectval, &outval, sizeof(struct in_addr)) == 0 ); diff --git a/src/tests/testSBuf.h b/src/tests/testSBuf.h index 8d8f1dfdbe..15ec0bcbda 100644 --- a/src/tests/testSBuf.h +++ b/src/tests/testSBuf.h @@ -30,7 +30,7 @@ class testSBuf : public CPPUNIT_NS::TestFixture CPPUNIT_TEST( testAppendStdString ); CPPUNIT_TEST( testAppendf ); CPPUNIT_TEST( testSubscriptOp ); - CPPUNIT_TEST_EXCEPTION( testSubscriptOpFail , OutOfBoundsException ); + CPPUNIT_TEST_EXCEPTION( testSubscriptOpFail, OutOfBoundsException ); CPPUNIT_TEST( testComparisons ); CPPUNIT_TEST( testConsume ); CPPUNIT_TEST( testRawContent ); diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index bcb64d97da..ec7cdabdbb 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -607,7 +607,7 @@ read_reply(int s, cachemgr_request * req) #if _SQUID_WINDOWS_ - while ((reply=recv(s, buf , sizeof(buf), 0)) > 0) + while ((reply=recv(s, buf, sizeof(buf), 0)) > 0) fwrite(buf, 1, reply, fp); rewind(fp);