Added -Wnon-virtual-dtor and -Wcast-qual warning flags
[supertux.git] / src / util / utf8_iterator.cpp
index 33b061f..01234d2 100644 (file)
@@ -1,5 +1,5 @@
 //  SuperTux
-//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmx.de>
+//  Copyright (C) 2009 Ingo Ruhnke <grumbel@gmail.com>
 //
 //  This program is free software: you can redistribute it and/or modify
 //  it under the terms of the GNU General Public License as published by
@@ -24,7 +24,6 @@ namespace {
 
 bool     has_multibyte_mark(unsigned char c);
 uint32_t decode_utf8(const std::string& text, size_t& p);
-std::string encode_utf8(uint32_t code);
 
 /**
  * returns true if this byte matches a bitmask of 10xx.xxxx, i.e. it is the 2nd, 3rd or 4th byte of a multibyte utf8 string
@@ -95,23 +94,23 @@ UTF8Iterator::UTF8Iterator(const std::string& text_) :
   try {
     chr = decode_utf8(text, pos);
   } catch (std::exception) {
-    log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
+    log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
     chr = 0;
   }
 }
 
-  bool 
+  bool
 UTF8Iterator::done() const
   {
     return pos > text.size();
   }
 
-  UTF8Iterator& 
+  UTF8Iterator&
 UTF8Iterator::operator++() {
     try {
       chr = decode_utf8(text, pos);
     } catch (std::exception) {
-      log_debug << "Malformed utf-8 sequence beginning with " << *((uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
+      log_debug << "Malformed utf-8 sequence beginning with " << *((const uint32_t*)(text.c_str() + pos)) << " found " << std::endl;
       chr = 0;
       ++pos;
     }