]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Portability fix: remove delegating constructors from SBuf
authorFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 19 Feb 2015 21:30:25 +0000 (22:30 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Thu, 19 Feb 2015 21:30:25 +0000 (22:30 +0100)
src/SBuf.cc
src/SBuf.h
src/tests/stub_SBuf.cc

index fc784574c5bc0a5328d2fc5cc02dc1cab2588402..ead90673c253dd0dedbb7b267d78a05645bde65d 100644 (file)
@@ -120,6 +120,15 @@ SBuf::SBuf(const char *S, size_type n)
     ++stats.live;
 }
 
+SBuf::SBuf(const char *S)
+    : store_(GetStorePrototype()), off_(0), len_(0)
+{
+    append(S,npos);
+    ++stats.alloc;
+    ++stats.allocFromCString;
+    ++stats.live;
+}
+
 SBuf::~SBuf()
 {
     debugs(24, 8, id << " destructed");
index 12d2c75db7cb68b0af845e232834bfb3d65bad18..752e9a390d54a6bc67718d48150c1440a9fd39ca 100644 (file)
@@ -156,7 +156,7 @@ public:
      * \note bounds is 0 <= pos < length(); caller must pay attention to signedness
      */
     explicit SBuf(const char *S, size_type n);
-    explicit SBuf(const char *S) : SBuf(S, npos) {}
+    explicit SBuf(const char *S);
 
     /** Constructor: import SquidString, copying contents.
      *
index 842164cd7d677c9ce6fd265a7134e8571014b3f6..f8b41982b495daa31638b4a03de7957b6c1feebb 100644 (file)
@@ -26,6 +26,7 @@ SBufStats& SBufStats::operator +=(const SBufStats&) STUB_RETVAL(*this)
 SBuf::SBuf() {}
 SBuf::SBuf(const SBuf &S) {}
 SBuf::SBuf(const char *S, size_type n) {}
+SBuf::SBuf(const char *S) {}
 SBuf::SBuf(const String &S) {}
 SBuf::SBuf(const std::string &s) {}
 SBuf::~SBuf() {}