From: Amos Jeffries Date: Sun, 1 Dec 2013 07:24:58 +0000 (-0700) Subject: Portability: std::string:npos is not always appropriate for String::npos X-Git-Tag: SQUID_3_5_0_1~483 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=74b07187c5ca52606ee16cf9e9029a5053107641;p=thirdparty%2Fsquid.git Portability: std::string:npos is not always appropriate for String::npos On some systems such as Windows MinGW the signed/unsigned property of std::string::npos does not match up with the Squdi String class size_type signed/unsigned property. Resulting in compiler signed vs unsigned mismatch errors when compiling. This is an iCelero project. --- diff --git a/src/SquidString.h b/src/SquidString.h index dabd1e204f..e8f69f3c3b 100644 --- a/src/SquidString.h +++ b/src/SquidString.h @@ -53,7 +53,7 @@ public: ~String(); typedef size_t size_type; //storage size intentionally unspecified - const static size_type npos = std::string::npos; + const static size_type npos = -1; String &operator =(char const *); String &operator =(String const &);