]> git.lyx.org Git - features.git/blobdiff - src/support/lstrings.C
fixes because of SUN CC warnings, bmtable now compiled with C compilator, countChar...
[features.git] / src / support / lstrings.C
index 573c6a0a36358d8bd362e9e60042fd087adb4fe8..06875d2159097c8322a1233b83991582abdf5471 100644 (file)
@@ -89,14 +89,6 @@ int  strToInt(string const & str)
 
 string lowercase(string const & a)
 {
-#if 0
-       string tmp;
-       string::const_iterator cit = a.begin();
-       for(; cit != a.end(); ++cit) {
-               tmp += static_cast<char>(tolower(*cit));
-       }
-       return tmp;
-#endif
        string tmp(a);
        transform(tmp.begin(), tmp.end(), tmp.begin(), tolower);
        return tmp;
@@ -159,14 +151,6 @@ string tostr(bool b)
 }
 
 
-#if 0
-string tostr(float f)
-{
-       return tostr(double(f));
-}
-#endif
-
-
 string tostr(double d)
 {
        // should use string stream
@@ -234,9 +218,15 @@ bool contains(char const * a, char const * b)
 }
 
 
-int countChar(string const & a, char const c)
+unsigned int countChar(string const & a, char const c)
 {
+#ifdef HAVE_STD_COUNT
        return count(a.begin(), a.end(), c);
+#else
+       unsigned int n = 0;
+       count(a.begin(), a.end(), c, n);
+       return n;
+#endif
 }