summaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-10-23 20:31:43 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-10-23 20:31:43 +0000
commitf689c19d25b634a1883f402eff6a07d73fa5da21 (patch)
tree9707ecf47b75db1c5c2aa4fcea0246c27275951a /src/utils
parent0c3a3264db6b746c64a3f3145b73c0e5a846e7fc (diff)
downloadmanaserv-f689c19d25b634a1883f402eff6a07d73fa5da21.tar.gz
manaserv-f689c19d25b634a1883f402eff6a07d73fa5da21.tar.bz2
manaserv-f689c19d25b634a1883f402eff6a07d73fa5da21.tar.xz
manaserv-f689c19d25b634a1883f402eff6a07d73fa5da21.zip
Fixed compiler warnings, including a forgotten initialization of an item's
script pointer.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/string.cpp12
-rw-r--r--src/utils/string.hpp3
2 files changed, 8 insertions, 7 deletions
diff --git a/src/utils/string.cpp b/src/utils/string.cpp
index 04d5f031..0785429d 100644
--- a/src/utils/string.cpp
+++ b/src/utils/string.cpp
@@ -18,14 +18,14 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
-#include <string>
-#include <cctype>
+
#include "utils/string.hpp"
+#include <cctype>
+#include <algorithm>
+
std::string utils::toupper(std::string s)
{
- for (int j=0; j<s.length(); ++j)
- s[j]=std::toupper(s[j]);
+ std::transform(s.begin(), s.end(), s.begin(), (int(*)(int)) toupper);
return s;
-}
-
+}
diff --git a/src/utils/string.hpp b/src/utils/string.hpp
index 6561b9e4..ea70e72a 100644
--- a/src/utils/string.hpp
+++ b/src/utils/string.hpp
@@ -18,6 +18,7 @@
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
+
#ifndef UTILS_STRING_HPP
#define UTILS_STRING_HPP
@@ -28,4 +29,4 @@ namespace utils
std::string toupper(std::string);
}
-#endif
+#endif // UTILS_STRING_HPP