=== modified file 'doc/debug-sections.txt' --- doc/debug-sections.txt 2012-10-28 14:00:17 +0000 +++ doc/debug-sections.txt 2012-11-11 22:43:33 +0000 @@ -56,7 +56,6 @@ section 22 Refresh Calculation section 23 URL Parsing section 23 URL Scheme parsing -section 24 Low-level String-Buffer functions section 25 MIME Parsing and Internal Icons section 25 MiME Header Parsing section 26 Secure Sockets Layer Proxy === modified file 'src/MemBlob.cc' --- src/MemBlob.cc 2012-10-31 17:17:17 +0000 +++ src/MemBlob.cc 2012-11-11 22:42:21 +0000 @@ -49,12 +49,12 @@ MemBlobStats& MemBlobStats::operator += (const MemBlobStats& s) { - alloc+=s.alloc; - live+=s.live; - append+=s.append; - liveBytes+=s.liveBytes; + alloc+=s.alloc; + live+=s.live; + append+=s.append; + liveBytes+=s.liveBytes; - return *this; + return *this; } std::ostream& === modified file 'src/OutOfBoundsException.h' --- src/OutOfBoundsException.h 2010-08-09 15:36:26 +0000 +++ src/OutOfBoundsException.h 2012-11-11 22:42:22 +0000 @@ -1,11 +1,9 @@ #ifndef _SQUID_SRC_OUTOFBOUNDSEXCEPTION_H #define _SQUID_SRC_OUTOFBOUNDSEXCEPTION_H - #include "SBuf.h" #include "base/TextException.h" - /** * Exception raised when the user is going out of bounds when accessing * a char within the SBuf === modified file 'src/SBuf.cc' --- src/SBuf.cc 2012-11-11 18:52:33 +0000 +++ src/SBuf.cc 2012-11-11 22:42:23 +0000 @@ -72,30 +72,30 @@ SBufStats& SBufStats::operator +=(const SBufStats& ss) { - alloc+=ss.alloc; - allocCopy+=ss.allocCopy; - allocFromString+=ss.allocFromString; - allocFromCString+=ss.allocFromCString; - assignFast+=ss.assignFast; - clear+=ss.clear; - append+=ss.append; - toStream+=ss.toStream; - setChar+=ss.setChar; - getChar+=ss.getChar; - compareSlow+=ss.compareSlow; - compareFast+=ss.compareFast; - copyOut+=ss.copyOut; - rawAccess+=ss.rawAccess; - chop+=ss.chop; - trim+=ss.trim; - find+=ss.find; - scanf+=ss.scanf; - caseChange+=ss.caseChange; - cowFast+=ss.cowFast; - cowSlow+=ss.cowSlow; - live+=ss.live; + alloc+=ss.alloc; + allocCopy+=ss.allocCopy; + allocFromString+=ss.allocFromString; + allocFromCString+=ss.allocFromCString; + assignFast+=ss.assignFast; + clear+=ss.clear; + append+=ss.append; + toStream+=ss.toStream; + setChar+=ss.setChar; + getChar+=ss.getChar; + compareSlow+=ss.compareSlow; + compareFast+=ss.compareFast; + copyOut+=ss.copyOut; + rawAccess+=ss.rawAccess; + chop+=ss.chop; + trim+=ss.trim; + find+=ss.find; + scanf+=ss.scanf; + caseChange+=ss.caseChange; + cowFast+=ss.cowFast; + cowSlow+=ss.cowSlow; + live+=ss.live; - return *this; + return *this; } SBuf::SBuf() @@ -172,7 +172,6 @@ return *this; } - SBuf& SBuf::assign(const char *S, size_type pos, size_type n) { @@ -226,7 +225,6 @@ return append(S.buf(),0,S.length()); } - SBuf& SBuf::append(const char * S, size_type pos, size_type n) { @@ -310,9 +308,9 @@ #else /* VA_COPY */ sz = vsnprintf(bufEnd(), store_->spaceSize(), fmt, vargs); #endif /* VA_COPY*/ - /* check for possible overflow */ - /* snprintf on Linux returns -1 on overflows */ - /* snprintf on FreeBSD returns at least free_space on overflows */ + /* check for possible overflow */ + /* snprintf on Linux returns -1 on overflows */ + /* snprintf on FreeBSD returns at least free_space on overflows */ if (sz < 0 || sz >= (int)store_->spaceSize()) reserve(length()+sz*2); // TODO: tune heuristics @@ -456,7 +454,6 @@ return toexport; } - const char* SBuf::rawContent() const { @@ -516,7 +513,6 @@ return *this; } - SBuf& SBuf::trim(const SBuf &toremove, bool atBeginning, bool atEnd) { @@ -638,7 +634,6 @@ return SBuf::npos; } - SBuf::size_type SBuf::rfind(char c, SBuf::size_type endpos) const { @@ -701,7 +696,6 @@ return rv; } - std::ostream & operator <<(std::ostream& os, const SBuf& S) { @@ -741,13 +735,12 @@ return os; } - SBuf SBuf::toLower() const { debugs(SBUF_DEBUGSECTION,DBG_DATA,MYNAME << "\"" << *this << "\""); SBuf rv(*this); - for (size_type j=0;j -#else -#if HAVE_LIMITS_H +#elif HAVE_LIMITS_H #include #endif -#endif SBuf& SBuf::operator =(const SBuf & S) @@ -85,7 +81,6 @@ return len_; } - int SBuf::plength() const { @@ -167,10 +162,9 @@ const SBuf::size_type SBuf::estimateCapacity(SBuf::size_type desired) const { - return 2*desired; + return 2*desired; } - /** * To be called after having determined that the buffers are equal up to the * length of the shortest one. @@ -193,7 +187,6 @@ * Just-created SBufs all share to the same MemBlob. * This call instantiates and returns it. */ - MemBlob::Pointer SBuf::GetStorePrototype() { @@ -218,7 +211,6 @@ return operator[](pos); } - bool SBuf::isEmpty() const { === modified file 'src/SBuf.h' --- src/SBuf.h 2012-11-10 22:43:15 +0000 +++ src/SBuf.h 2012-11-11 22:42:23 +0000 @@ -48,7 +48,6 @@ #define SBUF_DEBUGSECTION 24 - /* squid string placeholder (for printf) */ #ifndef SQUIDSBUFPH #define SQUIDSBUFPH "%.*s" @@ -102,7 +101,6 @@ SBufStats& operator +=(const SBufStats&); }; - /** * A String or Buffer. * Features: refcounted backing store, cheap copy and sub-stringing @@ -526,7 +524,6 @@ static MemBlob::Pointer StorePrototype; _SQUID_INLINE_ static MemBlob::Pointer GetStorePrototype(); //only used by anonymous constructor - _SQUID_INLINE_ char * buf() const; _SQUID_INLINE_ char * bufEnd() const; _SQUID_INLINE_ const size_type estimateCapacity(size_type desired) const; === modified file 'src/SBufExceptions.cc' --- src/SBufExceptions.cc 2012-08-13 20:56:10 +0000 +++ src/SBufExceptions.cc 2012-11-11 22:42:23 +0000 @@ -68,6 +68,4 @@ : TextException("Trying to create an oversize SBuf", aFilename, aLineNo) { } - - /* */ === modified file 'src/SBufExceptions.h' --- src/SBufExceptions.h 2010-09-25 19:19:21 +0000 +++ src/SBufExceptions.h 2012-11-11 22:44:35 +0000 @@ -28,8 +28,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#ifndef _SQUID_SBUFEXCEPTIONS_H_ -#define _SQUID_SBUFEXCEPTIONS_H_ +#ifndef SQUID_SBUFEXCEPTIONS_H +#define SQUID_SBUFEXCEPTIONS_H #include "base/TextException.h" @@ -62,4 +62,4 @@ SBufTooBigException(const char *aFilename = 0, int aLineNo = -1); }; -#endif /* _SQUID_SBUFEXCEPTIONS_H_ */ +#endif /* SQUID_SBUFEXCEPTIONS_H */ === modified file 'src/SBufExtras.cc' --- src/SBufExtras.cc 2012-08-13 20:56:10 +0000 +++ src/SBufExtras.cc 2012-11-11 22:42:23 +0000 @@ -42,39 +42,39 @@ #include "StoreEntryStream.h" SBufStatsAction::SBufStatsAction(const Mgr::CommandPointer &cmd): - Action(cmd) + Action(cmd) { } //default constructor is OK for data member SBufStatsAction::Pointer SBufStatsAction::Create(const Mgr::CommandPointer &cmd) { debugs(SBUF_DEBUGSECTION,8, "SBufStatsAction::" << MYNAME ); - return new SBufStatsAction(cmd); + return new SBufStatsAction(cmd); } void SBufStatsAction::add(const Mgr::Action& action) { debugs(SBUF_DEBUGSECTION,8,"SBufStatsAction::add"); - data.sbdata += dynamic_cast(action).data.sbdata; - data.mbdata += dynamic_cast(action).data.mbdata; + data.sbdata += dynamic_cast(action).data.sbdata; + data.mbdata += dynamic_cast(action).data.mbdata; } void SBufStatsAction::collect() { debugs(SBUF_DEBUGSECTION,8, "SBufStatsAction::" << MYNAME ); - data.sbdata=SBuf::GetStats(); - data.mbdata=MemBlob::GetStats(); + data.sbdata=SBuf::GetStats(); + data.mbdata=MemBlob::GetStats(); } void SBufStatsAction::dump(StoreEntry* entry) { debugs(SBUF_DEBUGSECTION,8, "SBufStatsAction::" << MYNAME ); - Must(entry != NULL); - StoreEntryStream ses(entry); - data.sbdata.dump(ses); - data.mbdata.dump(ses); + Must(entry != NULL); + StoreEntryStream ses(entry); + data.sbdata.dump(ses); + data.mbdata.dump(ses); } void @@ -93,7 +93,8 @@ msg.getPod(data); } -class SBufStatsRegistrationHelperObject { +class SBufStatsRegistrationHelperObject +{ public: SBufStatsRegistrationHelperObject() { Mgr::RegisterAction("sbuf","String-Buffer statistics", &SBufStatsAction::Create, 0 ,1); === modified file 'src/SBufExtras.h' --- src/SBufExtras.h 2010-12-27 00:52:50 +0000 +++ src/SBufExtras.h 2012-11-11 22:42:23 +0000 @@ -37,7 +37,6 @@ #ifndef SQUID_SBUFEXTRAS_H #define SQUID_SBUFEXTRAS_H - #include "mgr/Action.h" #include "ipc/TypedMsgHdr.h" #include "SBuf.h" @@ -47,21 +46,21 @@ class SBufStatsAction: public Mgr::Action { protected: - SBufStatsAction(const Mgr::CommandPointer &cmd); - virtual void collect(); - virtual void dump(StoreEntry* entry); + SBufStatsAction(const Mgr::CommandPointer &cmd); + virtual void collect(); + virtual void dump(StoreEntry* entry); public: - static Pointer Create(const Mgr::CommandPointer &cmd); - virtual void add(const Mgr::Action& action); - virtual void pack(Ipc::TypedMsgHdr& msg) const; - virtual void unpack(const Ipc::TypedMsgHdr& msg); + static Pointer Create(const Mgr::CommandPointer &cmd); + virtual void add(const Mgr::Action& action); + virtual void pack(Ipc::TypedMsgHdr& msg) const; + virtual void unpack(const Ipc::TypedMsgHdr& msg); private: - struct SbufStatsActionData { - SBufStats sbdata; - MemBlobStats mbdata; - } data; + struct SbufStatsActionData { + SBufStats sbdata; + MemBlobStats mbdata; + } data; }; #endif /* SQUID_SBUFEXTRAS_H */ === modified file 'src/SBufList.h' --- src/SBufList.h 2012-11-11 18:52:33 +0000 +++ src/SBufList.h 2012-11-11 22:45:13 +0000 @@ -28,8 +28,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#ifndef _SQUID_SBUFLIST_H_ -#define _SQUID_SBUFLIST_H_ +#ifndef SQUID_SBUFLIST_H +#define SQUID_SBUFLIST_H #include "SBuf.h" #include @@ -59,4 +59,4 @@ bool isPrefix(const SBuf &, SBufCaseSensitive case_sensitive=caseSensitive); }; -#endif /* SBUFLIST_H_ */ +#endif /* SQUID_SBUFLIST_H */ === modified file 'src/SBufStream.h' --- src/SBufStream.h 2012-08-13 20:56:10 +0000 +++ src/SBufStream.h 2012-11-11 22:49:55 +0000 @@ -43,10 +43,10 @@ class SBufStreamBuf : public std::streambuf { public: - /// initialize streambuf; use supplied SBuf as backing store - SBufStreamBuf(SBuf aBuf) : theBuf(aBuf) {} + /// initialize streambuf; use supplied SBuf as backing store + SBufStreamBuf(SBuf aBuf) : theBuf(aBuf) {} - /// get a copy of the stream's contents + /// get a copy of the stream's contents SBuf getBuf() { return theBuf; } @@ -70,7 +70,7 @@ theBuf.append(chars, 0, 1); } - pbump (-pending); // Reset pptr(). + pbump(-pending); // Reset pptr(). return aChar; } @@ -97,7 +97,6 @@ private: SBuf theBuf; SBufStreamBuf(); // no default constructor - }; /** Stream interface to write to a SBuf. @@ -107,25 +106,24 @@ */ class SBufStream : public std::ostream { - public: - /** Create a SBufStream preinitialized with the argument's SBuf. - * - * The supplied SBuf is not aliased: in order to retrieve the altered contents - * they must be fetched using the buf() class method. - */ - SBufStream(SBuf aBuf): std::ostream(0), theBuffer(aBuf) { - rdbuf(&theBuffer); // set the buffer to now-initialized theBuffer - clear(); //clear badbit set by calling init(0) - } - - /// Create an empty SBufStream - SBufStream(): std::ostream(0), theBuffer(SBuf()) { - rdbuf(&theBuffer); // set the buffer to now-initialized theBuffer - clear(); //clear badbit set by calling init(0) - } - - /// Retrieve a copy of the current stream status + /** Create a SBufStream preinitialized with the argument's SBuf. + * + * The supplied SBuf is not aliased: in order to retrieve the altered contents + * they must be fetched using the buf() class method. + */ + SBufStream(SBuf aBuf): std::ostream(0), theBuffer(aBuf) { + rdbuf(&theBuffer); // set the buffer to now-initialized theBuffer + clear(); //clear badbit set by calling init(0) + } + + /// Create an empty SBufStream + SBufStream(): std::ostream(0), theBuffer(SBuf()) { + rdbuf(&theBuffer); // set the buffer to now-initialized theBuffer + clear(); //clear badbit set by calling init(0) + } + + /// Retrieve a copy of the current stream status SBuf buf() { return theBuffer.getBuf(); } === modified file 'src/SBufTokenizer.cc' --- src/SBufTokenizer.cc 2012-11-02 22:57:19 +0000 +++ src/SBufTokenizer.cc 2012-11-11 22:47:09 +0000 @@ -39,12 +39,12 @@ return _toParse.find_first_of(_delim); } -SBufTokenizer::SBufTokenizer (const SBuf &toparse, const SBuf &delim) +SBufTokenizer::SBufTokenizer(const SBuf &toparse, const SBuf &delim) { reset(toparse,delim); } -void SBufTokenizer::reset (const SBuf &toparse, const SBuf &delim) +void SBufTokenizer::reset(const SBuf &toparse, const SBuf &delim) { debugs(SBUF_DEBUGSECTION,4,"SBufTokenizer::reset()"); _toParse=toparse; @@ -54,19 +54,16 @@ next(); } - void SBufTokenizer::setDelimiter(const SBuf &newdelim) { _delim=newdelim; } - SBuf SBufTokenizer::getDelimiter() const { return _delim; } - SBufTokenizer& SBufTokenizer::next() { debugs(SBUF_DEBUGSECTION,7,"SBufTokenizer::next()"); === modified file 'src/SBufTokenizer.h' --- src/SBufTokenizer.h 2010-10-07 16:14:31 +0000 +++ src/SBufTokenizer.h 2012-11-11 22:42:24 +0000 @@ -56,7 +56,7 @@ * \param delim the token separator. It's a SBuf which is interpreted * as a bag of chars, whose each is a possible token delimiter. */ - SBufTokenizer (const SBuf &toparse, const SBuf &delim); + SBufTokenizer(const SBuf &toparse, const SBuf &delim); /** reset the Tokenizer * @@ -65,7 +65,7 @@ * \param toparse the SBuf to be tokenized * \param delim the token separator. It's a SBuf which is interpreted */ - void reset (const SBuf &toparse, const SBuf &delim); + void reset(const SBuf &toparse, const SBuf &delim); /** set a new delimiter set * @@ -122,7 +122,6 @@ SBuf _delim; /// a SBuf containing the delimiter characters SBuf::size_type pbrk() const; - }; #endif === modified file 'src/SBufUtil.cc' --- src/SBufUtil.cc 2012-11-11 18:52:33 +0000 +++ src/SBufUtil.cc 2012-11-11 22:48:36 +0000 @@ -31,7 +31,8 @@ #include "squid.h" #include "SBufUtil.h" -SBufList SBufSplit(SBuf tosplit, const SBuf & delimiters) +SBufList +SBufSplit(SBuf tosplit, const SBuf & delimiters) { SBufList rv; while (tosplit.length() > 0) { @@ -42,7 +43,8 @@ return rv; } -SBuf SBufListJoin(SBufList &list, const SBuf &separator) +SBuf +SBufListJoin(SBufList &list, const SBuf &separator) { SBufList::iterator i; SBuf::size_type sz=0; @@ -65,7 +67,7 @@ } SBuf -BaseName (const SBuf &s, char separator) +BaseName(const SBuf &s, char separator) { SBuf::size_type pos=s.rfind(separator); if (pos==SBuf::npos) === modified file 'src/SBufUtil.h' --- src/SBufUtil.h 2010-09-03 14:56:05 +0000 +++ src/SBufUtil.h 2012-11-11 22:48:07 +0000 @@ -28,9 +28,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ - -#ifndef SQUID_SBUFUTIL_H_ -#define SQUID_SBUFUTIL_H_ +#ifndef SQUID_SBUFUTIL_H +#define SQUID_SBUFUTIL_H #include "SBuf.h" #include "SBufTokenizer.h" @@ -45,11 +44,11 @@ * containing * {SBuf("Foo"), SBuf(" Bar"), SBuf(",Gazonk")} */ -SBufList SBufSplit (SBuf tosplit, const SBuf & delimiters); +SBufList SBufSplit(SBuf tosplit, const SBuf & delimiters); /** join a SBufList into a SBuf using the supplied separator. */ -SBuf SBufListJoin (SBufList &list, const SBuf &separator); +SBuf SBufListJoin(SBufList &list, const SBuf &separator); /** Obtain the basename of a file. * @@ -58,6 +57,6 @@ * \param s the SBuf to be analyzed * \param separator the separating character (defaults to '/') */ -SBuf BaseName (const SBuf &s, char separator = '/'); +SBuf BaseName(const SBuf &s, char separator = '/'); -#endif /* SQUID_SBUFUTIL_H_ */ +#endif /* SQUID_SBUFUTIL_H */ === modified file 'src/SquidString.h' --- src/SquidString.h 2012-10-28 14:00:17 +0000 +++ src/SquidString.h 2012-11-11 22:42:25 +0000 @@ -43,7 +43,6 @@ #define SQUIDSTRINGPRINT(s) (s).psize(),(s).rawBuf() #endif /* SQUIDSTRINGPH */ - class String { === modified file 'src/tests/testSBuf.cc' --- src/tests/testSBuf.cc 2012-08-13 20:56:10 +0000 +++ src/tests/testSBuf.cc 2012-11-11 22:43:27 +0000 @@ -198,7 +198,6 @@ CPPUNIT_ASSERT_EQUAL(s1,s2); } - void testSBuf::testChop() { @@ -357,7 +356,7 @@ { int j=0; SBuf s; - for (SBufTokenizer st(foxb,SBuf(" ",0,1));!st.atEnd();st.next()) { + for (SBufTokenizer st(foxb,SBuf(" ",0,1)); !st.atEnd(); st.next()) { s=st.token(); CPPUNIT_ASSERT(s==tokens[j]); j++; @@ -365,8 +364,6 @@ CPPUNIT_ASSERT(j==9); } - - void testSBuf::testStringOps() { SBuf sng(foxb), @@ -417,7 +414,7 @@ void testSBuf::testSBufList() { SBufList foo; - for (int j=0;j