From: Francesco Chemolli Date: Sat, 12 Apr 2014 13:29:42 +0000 (+0200) Subject: marked several dump functions as const X-Git-Tag: SQUID_3_5_0_1~295^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f8ca96e20bae49d791778e9e4c3296144c0da76;p=thirdparty%2Fsquid.git marked several dump functions as const --- diff --git a/src/acl/Asn.cc b/src/acl/Asn.cc index ce6d057297..fad7d5e727 100644 --- a/src/acl/Asn.cc +++ b/src/acl/Asn.cc @@ -551,7 +551,7 @@ ACLASN::match(Ip::Address toMatch) } SBufList -ACLASN::dump() +ACLASN::dump() const { SBufList sl; diff --git a/src/acl/Asn.h b/src/acl/Asn.h index 9a33d44d5d..3df27eb9d0 100644 --- a/src/acl/Asn.h +++ b/src/acl/Asn.h @@ -56,7 +56,7 @@ public: virtual ~ACLASN(); virtual bool match(Ip::Address); - virtual SBufList dump(); + virtual SBufList dump() const; virtual void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/Data.h b/src/acl/Data.h index a099323793..64d937598f 100644 --- a/src/acl/Data.h +++ b/src/acl/Data.h @@ -44,7 +44,7 @@ public: virtual ~ACLData() {} virtual bool match(M) =0; - virtual SBufList dump() =0; + virtual SBufList dump() const =0; virtual void parse() =0; virtual ACLData *clone() const =0; virtual void prepareForUse() {} diff --git a/src/acl/DomainData.cc b/src/acl/DomainData.cc index af98c4e7a9..e65576c05c 100644 --- a/src/acl/DomainData.cc +++ b/src/acl/DomainData.cc @@ -144,7 +144,7 @@ aclDumpDomainListWalkee(char * const & node_data, void *outlist) } SBufList -ACLDomainData::dump() +ACLDomainData::dump() const { SBufList sl; /* damn this is VERY inefficient for long ACL lists... filling diff --git a/src/acl/DomainData.h b/src/acl/DomainData.h index a8981e14cf..abc98467df 100644 --- a/src/acl/DomainData.h +++ b/src/acl/DomainData.h @@ -46,7 +46,7 @@ public: virtual ~ACLDomainData(); bool match(char const *); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/HierCodeData.cc b/src/acl/HierCodeData.cc index 14f7957924..1fb78d8a2d 100644 --- a/src/acl/HierCodeData.cc +++ b/src/acl/HierCodeData.cc @@ -25,7 +25,7 @@ ACLHierCodeData::match(hier_code toFind) } SBufList -ACLHierCodeData::dump() +ACLHierCodeData::dump() const { SBufList sl; diff --git a/src/acl/HierCodeData.h b/src/acl/HierCodeData.h index d29ec3e841..a5d97f8734 100644 --- a/src/acl/HierCodeData.h +++ b/src/acl/HierCodeData.h @@ -18,7 +18,7 @@ public: ACLHierCodeData &operator= (ACLHierCodeData const &); virtual ~ACLHierCodeData(); bool match(hier_code); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/HttpHeaderData.cc b/src/acl/HttpHeaderData.cc index 32a32f46fc..ed94a4d75c 100644 --- a/src/acl/HttpHeaderData.cc +++ b/src/acl/HttpHeaderData.cc @@ -80,7 +80,7 @@ ACLHTTPHeaderData::match(HttpHeader* hdr) } SBufList -ACLHTTPHeaderData::dump() +ACLHTTPHeaderData::dump() const { SBufList sl; sl.push_back(SBuf(hdrName)); diff --git a/src/acl/HttpHeaderData.h b/src/acl/HttpHeaderData.h index ea05d0e7bc..0ddf4980d2 100644 --- a/src/acl/HttpHeaderData.h +++ b/src/acl/HttpHeaderData.h @@ -54,7 +54,7 @@ public: ACLHTTPHeaderData(); virtual ~ACLHTTPHeaderData(); virtual bool match(HttpHeader* hdr); - virtual SBufList dump(); + virtual SBufList dump() const; virtual void parse(); virtual bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/IntRange.cc b/src/acl/IntRange.cc index 30d5ee39f4..8020e277f3 100644 --- a/src/acl/IntRange.cc +++ b/src/acl/IntRange.cc @@ -112,7 +112,7 @@ ACLIntRange::~ACLIntRange() {} SBufList -ACLIntRange::dump() +ACLIntRange::dump() const { SBufList sl; CbDataListIterator iter(ranges); diff --git a/src/acl/IntRange.h b/src/acl/IntRange.h index 8b43e13eb2..b4621f99f1 100644 --- a/src/acl/IntRange.h +++ b/src/acl/IntRange.h @@ -46,7 +46,7 @@ public: virtual ~ACLIntRange(); virtual bool match(int); - virtual SBufList dump(); + virtual SBufList dump() const; virtual void parse(); virtual bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/MethodData.cc b/src/acl/MethodData.cc index 629e371014..e1cd9b6bee 100644 --- a/src/acl/MethodData.cc +++ b/src/acl/MethodData.cc @@ -68,7 +68,7 @@ template cbdata_type CbDataList::CBDATA_CbDataList; /// \endcond SBufList -ACLMethodData::dump() +ACLMethodData::dump() const { SBufList sl; CbDataList *data = values; diff --git a/src/acl/MethodData.h b/src/acl/MethodData.h index 1bfa6f2517..30a1604df8 100644 --- a/src/acl/MethodData.h +++ b/src/acl/MethodData.h @@ -50,7 +50,7 @@ public: ACLMethodData &operator= (ACLMethodData const &); virtual ~ACLMethodData(); bool match(HttpRequestMethod); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/NoteData.cc b/src/acl/NoteData.cc index e58ab7b78d..5c15244218 100644 --- a/src/acl/NoteData.cc +++ b/src/acl/NoteData.cc @@ -52,7 +52,7 @@ ACLNoteData::match(HttpRequest *request) } SBufList -ACLNoteData::dump() +ACLNoteData::dump() const { SBufList sl; sl.push_back(SBuf(name)); diff --git a/src/acl/NoteData.h b/src/acl/NoteData.h index b65a98b8ef..b7e4f5d54d 100644 --- a/src/acl/NoteData.h +++ b/src/acl/NoteData.h @@ -17,7 +17,7 @@ public: ACLNoteData(); virtual ~ACLNoteData(); virtual bool match(HttpRequest* request); - virtual SBufList dump(); + virtual SBufList dump() const; virtual void parse(); virtual bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/ProtocolData.cc b/src/acl/ProtocolData.cc index 53744255c5..7608d9a744 100644 --- a/src/acl/ProtocolData.cc +++ b/src/acl/ProtocolData.cc @@ -66,7 +66,7 @@ template cbdata_type CbDataList::CBDATA_CbDataList; /// \endcond SBufList -ACLProtocolData::dump() +ACLProtocolData::dump() const { SBufList sl; CbDataList *data = values; diff --git a/src/acl/ProtocolData.h b/src/acl/ProtocolData.h index 858a664f9a..f7819c7f4b 100644 --- a/src/acl/ProtocolData.h +++ b/src/acl/ProtocolData.h @@ -50,7 +50,7 @@ public: ACLProtocolData &operator= (ACLProtocolData const &); virtual ~ACLProtocolData(); bool match(AnyP::ProtocolType); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/RegexData.cc b/src/acl/RegexData.cc index 96b31a0162..6f9b09c563 100644 --- a/src/acl/RegexData.cc +++ b/src/acl/RegexData.cc @@ -102,7 +102,7 @@ ACLRegexData::match(char const *word) } SBufList -ACLRegexData::dump() +ACLRegexData::dump() const { SBufList sl; RegexList *temp = data; diff --git a/src/acl/RegexData.h b/src/acl/RegexData.h index e3d26e0bc5..909d17cf6f 100644 --- a/src/acl/RegexData.h +++ b/src/acl/RegexData.h @@ -45,7 +45,7 @@ public: virtual ~ACLRegexData(); virtual bool match(char const *user); - virtual SBufList dump(); + virtual SBufList dump() const; virtual void parse(); virtual bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/StringData.cc b/src/acl/StringData.cc index 25bd55b228..98afd05f9a 100644 --- a/src/acl/StringData.cc +++ b/src/acl/StringData.cc @@ -94,7 +94,7 @@ aclDumpStringWalkee(char * const & node_data, void *outlist) } SBufList -ACLStringData::dump() +ACLStringData::dump() const { SBufList sl; /* damn this is VERY inefficient for long ACL lists... filling diff --git a/src/acl/StringData.h b/src/acl/StringData.h index a637a6dc67..a23c942a0b 100644 --- a/src/acl/StringData.h +++ b/src/acl/StringData.h @@ -48,7 +48,7 @@ public: ACLStringData &operator= (ACLStringData const &); virtual ~ACLStringData(); bool match(char const *); - SBufList dump(); + SBufList dump() const; virtual void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/TimeData.cc b/src/acl/TimeData.cc index 98fb423d27..39251ed67c 100644 --- a/src/acl/TimeData.cc +++ b/src/acl/TimeData.cc @@ -98,10 +98,10 @@ ACLTimeData::match(time_t when) } SBufList -ACLTimeData::dump() +ACLTimeData::dump() const { SBufList sl; - ACLTimeData *t = this; + const ACLTimeData *t = this; while (t != NULL) { SBuf s; diff --git a/src/acl/TimeData.h b/src/acl/TimeData.h index 74b5f03f53..c7c5337521 100644 --- a/src/acl/TimeData.h +++ b/src/acl/TimeData.h @@ -48,7 +48,7 @@ public: ACLTimeData&operator=(ACLTimeData const &); virtual ~ACLTimeData(); bool match(time_t); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/acl/UserData.cc b/src/acl/UserData.cc index 62b8cb08ce..cd868cca36 100644 --- a/src/acl/UserData.cc +++ b/src/acl/UserData.cc @@ -101,7 +101,7 @@ aclDumpUserListWalkee(char * const & node_data, void *outlist) } SBufList -ACLUserData::dump() +ACLUserData::dump() const { SBufList sl; diff --git a/src/acl/UserData.h b/src/acl/UserData.h index 4c32c228e2..30453bc0da 100644 --- a/src/acl/UserData.h +++ b/src/acl/UserData.h @@ -45,7 +45,7 @@ public: virtual ~ACLUserData(); bool match(char const *user); - SBufList dump(); + SBufList dump() const; void parse(); bool empty() const; virtual ACLData *clone() const; diff --git a/src/tests/stub_external_acl.cc b/src/tests/stub_external_acl.cc index af33a853c8..c6c3527c51 100644 --- a/src/tests/stub_external_acl.cc +++ b/src/tests/stub_external_acl.cc @@ -13,7 +13,7 @@ void ACLExternal::parse() STUB bool ACLExternal::valid () const STUB_RETVAL(false) bool ACLExternal::empty () const STUB_RETVAL(false) int ACLExternal::match(ACLChecklist *) STUB_RETVAL(0) -wordlist * ACLExternal::dump() const STUB_RETVAL(NULL) +SBufList ACLExternal::dump() const STUB_RETVAL(SBufList()) void ACLExternal::ExternalAclLookup(ACLChecklist *, ACLExternal *) STUB void ExternalACLLookup::Start(ACLChecklist *, external_acl_data *, bool) STUB void externalAclInit(void) STUB_NOP diff --git a/src/tests/stub_libauth_acls.cc b/src/tests/stub_libauth_acls.cc index cf58fa69ad..91c6cd5398 100644 --- a/src/tests/stub_libauth_acls.cc +++ b/src/tests/stub_libauth_acls.cc @@ -20,7 +20,7 @@ bool ACLMaxUserIP::valid () const STUB_RETVAL(false) void ACLMaxUserIP::parse() STUB int ACLMaxUserIP::match(Auth::UserRequest::Pointer, Ip::Address const &) STUB_RETVAL(0) int ACLMaxUserIP::match(ACLChecklist *) STUB_RETVAL(0) -wordlist * ACLMaxUserIP::dump() const STUB_RETVAL(NULL) +SBufList ACLMaxUserIP::dump() const STUB_RETVAL(SBufList()) #include "auth/AclProxyAuth.h" ACLProxyAuth::~ACLProxyAuth() STUB @@ -30,7 +30,7 @@ ACLProxyAuth & ACLProxyAuth::operator= (ACLProxyAuth const & a) STUB_RETVAL(cons char const * ACLProxyAuth::typeString() const STUB_RETVAL(NULL) void ACLProxyAuth::parse() STUB int ACLProxyAuth::match(ACLChecklist *) STUB_RETVAL(0) -wordlist * ACLProxyAuth::dump() const STUB_RETVAL(NULL) +SBufList ACLProxyAuth::dump() const STUB_RETVAL(SBufList()) bool ACLProxyAuth::empty () const STUB_RETVAL(false) bool ACLProxyAuth::valid () const STUB_RETVAL(false) ProxyAuthLookup * ProxyAuthLookup::Instance() STUB_RETVAL(NULL)