]> git.ipfire.org Git - thirdparty/squid.git/commit - src/SBuf.h
Do not allow SBuf::toLower/toUpper() return a value.
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 7 Aug 2014 17:13:26 +0000 (11:13 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 7 Aug 2014 17:13:26 +0000 (11:13 -0600)
commit37cf7314a03bd6ee05fbd0b89e16d563e8dc6769
treef7573d3cf30349c7cd6c0f0e055189f016a8eebe
parente7ce227f301a8f1ab73487d19da899fde7c18858
Do not allow SBuf::toLower/toUpper() return a value.

Some callers think toLower() method changes the string and some think it
returns a changed value without changing the string. Without unportable hacks
like __attribute__((warn_unused_result)), some of the callers will guess wrong
and not know about it. It is easier/safer to change the object itself and
return nothing.

Provided ToUpper/ToLower() functions (not methods!) that preserve their
paramter and return a new object for callers that need the old functionality.
These functions are a good candidate for __attribute__ hacks.
src/SBuf.cc
src/SBuf.h
src/tests/stub_SBuf.cc
src/tests/testSBuf.cc