]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make clang happy with SBuf API
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Oct 2013 08:32:15 +0000 (02:32 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 7 Oct 2013 08:32:15 +0000 (02:32 -0600)
Basic types are passed by-value and const is useless.
Clang is quite strict and treats this as a build error.

src/SBuf.h

index 15c80cf68405136cab43b5f5f04611faf20e165c..7a073640ec32d201b23c4dbbf45fb416f4ea55f6 100644 (file)
@@ -232,14 +232,14 @@ public:
      *
      * does not check access bounds. If you need that, use at()
      */
-    const char operator [](size_type pos) const {++stats.getChar; return store_->mem[off_+pos];}
+    char operator [](size_type pos) const {++stats.getChar; return store_->mem[off_+pos];}
 
     /** random-access read to any char within the SBuf.
      *
      * \throw OutOfBoundsException when access is out of bounds
      * \note bounds is 0 <= pos < length(); caller must pay attention to signedness
      */
-    const char at(size_type pos) const {checkAccessBounds(pos); return operator[](pos);}
+    char at(size_type pos) const {checkAccessBounds(pos); return operator[](pos);}
 
     /** direct-access set a byte at a specified operation.
      *
@@ -582,7 +582,7 @@ private:
      * Try to guesstimate how big a MemBlob to allocate.
      * The result is guarranteed to be to be at least the desired size.
      */
-    const size_type estimateCapacity(size_type desired) const {return (2*desired);}
+    size_type estimateCapacity(size_type desired) const {return (2*desired);}
 
     void reAlloc(size_type newsize);