Patch file generated Fri May 25 20:18:12 NZST 2007 from
CVS branch ayjwork
CVS base branch HEAD
CVS repository: amosjeffries@cvs.devel.squid-cache.org:/cvsroot/squid
CVS module: squid3

cvs -q rdiff -u -kk -r Z-ayjwork_merge_HEAD -r ayjwork squid3
Index: squid3/src/SqString.cc
diff -u squid3/src/SqString.cc:1.8 squid3/src/SqString.cc:1.1.2.16
--- squid3/src/SqString.cc:1.8	Mon May 21 18:51:11 2007
+++ squid3/src/SqString.cc	Fri May 25 01:17:39 2007
@@ -240,16 +240,18 @@
 }
 
 const char&
-SqString::operator [](unsigned int pos) const
+SqString::operator [](int pos) const
 {
+    assert(pos >= 0 );
     assert(pos < size_ );
 
     return buf_[pos];
 }
 
 char&
-SqString::operator [](unsigned int pos)
+SqString::operator [](int pos)
 {
+    assert(pos >= 0 );
     assert(pos < size_ );
 
     return buf_[pos];
Index: squid3/src/SqString.h
diff -u squid3/src/SqString.h:1.4 squid3/src/SqString.h:1.1.2.7
--- squid3/src/SqString.h:1.4	Sun May 20 01:50:27 2007
+++ squid3/src/SqString.h	Fri May 25 01:17:39 2007
@@ -87,6 +87,11 @@
     SqString (SqString const &);
     ~SqString();
 
+    //
+    // operator to cast to a const char *
+    //
+    operator char const *() const { return c_str(); }
+
     SqString &operator =(char const *);
     SqString &operator =(SqString const &);
     bool operator ==(SqString const &) const;
@@ -99,8 +104,8 @@
     _SQUID_INLINE_ int size() const;
     _SQUID_INLINE_ char const * c_str() const;
 
-    const char& operator [](unsigned int) const;
-    char& operator [](unsigned int);
+    const char& operator [](int) const;
+    char& operator [](int);
 
     void clear();
 
Index: squid3/src/SquidString.h
diff -u squid3/src/SquidString.h:1.9 squid3/src/SquidString.h:1.8.8.6
--- squid3/src/SquidString.h:1.9	Thu May 17 23:51:20 2007
+++ squid3/src/SquidString.h	Fri May 25 01:17:39 2007
@@ -66,7 +66,6 @@
  *        initBuf(char*)  -> operator=(char*)
  *        reset(char*)    -> operator=(char*)
  *    - make init(char*) private for use by various assignment/costructor
- *    - define standard string operators
  *    - define debugs stream operator
  *
  */
@@ -83,18 +82,6 @@
 typedef SqString string;
 
 
-    /* Overload standard C functions using the basic string API */
-
-inline int strncasecmp(const string &lhs, const string &rhs, size_t len) { return strncasecmp(lhs.c_str(), rhs.c_str(), len); }
-inline int strcasecmp(const string &lhs, const string &rhs) { return strcasecmp(lhs.c_str(), rhs.c_str()); }
-
-inline int strncmp(const string &lhs, const string &rhs, size_t len) { return strncmp(lhs.c_str(), rhs.c_str(), len); }
-inline int strcmp(const string &lhs, const string &rhs) { return strcmp(lhs.c_str(), rhs.c_str()); }
-
-inline const char * strpbrk(const string &lhs, const string &rhs) { return strpbrk(lhs.c_str(), rhs.c_str()); }
-
-inline const char * strstr(const string &lhs, const string &rhs) { return strstr(lhs.c_str(), rhs.c_str()); }
-
 inline std::ostream& operator <<(std::ostream &os, const string &s) { os << s.c_str(); return os; }
 
 #endif /* SQUID_STRING_H */
Index: squid3/src/tests/testString.cc
diff -u squid3/src/tests/testString.cc:1.5 squid3/src/tests/testString.cc:1.2.12.4
--- squid3/src/tests/testString.cc:1.5	Wed May 23 14:51:22 2007
+++ squid3/src/tests/testString.cc	Thu May 24 22:11:52 2007
@@ -82,7 +82,7 @@
 void
 testString::testAppend()
 {
-    // FIXME: make tests for this.
+    // FIXME: make more tests for this.
     string aStr("hello");
 
     aStr.append(" world");

