[Supertux-Commit] [tinygettext commit] r152 - in branches/tinygettext-portable: . src

codesite-noreply at google.com codesite-noreply at google.com
Thu Feb 12 15:34:48 PST 2009


Author: grumbel
Date: Thu Feb 12 14:48:47 2009
New Revision: 152

Modified:
    branches/tinygettext-portable/TODO
    branches/tinygettext-portable/src/dictionary.cpp
    branches/tinygettext-portable/src/dictionary_manager.cpp
    branches/tinygettext-portable/src/dictionary_manager.hpp
    branches/tinygettext-portable/src/iconv.cpp
    branches/tinygettext-portable/src/log.cpp
    branches/tinygettext-portable/src/po_parser.cpp

Log:
Made the  
code '-ansi', '-pedantic', '-Wall', '-Werror', '-Wnon-virtual-dtor', '-Weffc++'  
clean

Modified: branches/tinygettext-portable/TODO
==============================================================================
--- branches/tinygettext-portable/TODO	(original)
+++ branches/tinygettext-portable/TODO	Thu Feb 12 14:48:47 2009
@@ -24,6 +24,10 @@
  tinygettext API related stuff:
  ==============================

+* make DirOp a single function:
+
+  std::vector<std::string> open_directory(const std::string& filename);
+
  * translate, translate_ctxt, translate_ctxt_plural, ... could be
    unified via overloading, not sure if that is a good idea. For the
    same reason add_translation() could be de-overloaded, to
@@ -36,9 +40,12 @@
    to make it more obvious:

    - POParser::pedantic
+
    - enumerate_files (list files in directory)
    - free_list (cleanup, of the above)
+
    - open file (return std::istream)
+
    - iconv (???)
    - logging (log_callback(std::string))


Modified: branches/tinygettext-portable/src/dictionary.cpp
==============================================================================
--- branches/tinygettext-portable/src/dictionary.cpp	(original)
+++ branches/tinygettext-portable/src/dictionary.cpp	Thu Feb 12 14:48:47  
2009
@@ -24,7 +24,10 @@
  namespace tinygettext {
  
  Dictionary::Dictionary(const std::string& charset_)
-  : charset(charset_)
+  : entries(),
+    ctxt_entries(),
+    charset(charset_),
+    plural_forms()
  {
  }


Modified: branches/tinygettext-portable/src/dictionary_manager.cpp
==============================================================================
--- branches/tinygettext-portable/src/dictionary_manager.cpp	(original)
+++ branches/tinygettext-portable/src/dictionary_manager.cpp	Thu Feb 12  
14:48:47 2009
@@ -39,10 +39,14 @@
  }

  DictionaryManager::DictionaryManager(const std::string& charset_)
-  : charset(charset_),
+  : dictionaries(),
+    search_path(),
+    charset(charset_),
      use_fuzzy(true),
+    current_language(),
      current_dict(0),
-    empty_dict()
+    empty_dict(),
+    dir_op()
  {
    dir_op.enumerate_files = unix_enumerate_files;
    dir_op.free_list       = unix_free_list;

Modified: branches/tinygettext-portable/src/dictionary_manager.hpp
==============================================================================
--- branches/tinygettext-portable/src/dictionary_manager.hpp	(original)
+++ branches/tinygettext-portable/src/dictionary_manager.hpp	Thu Feb 12  
14:48:47 2009
@@ -85,6 +85,10 @@
    std::set<Language> get_languages();

    void set_dir_op(const DirOp& dir_op);
+
+private:
+  DictionaryManager (const DictionaryManager&);
+  DictionaryManager& operator= (const DictionaryManager&);
  };

  } // namespace tinygettext

Modified: branches/tinygettext-portable/src/iconv.cpp
==============================================================================
--- branches/tinygettext-portable/src/iconv.cpp	(original)
+++ branches/tinygettext-portable/src/iconv.cpp	Thu Feb 12 14:48:47 2009
@@ -35,11 +35,15 @@
  #endif

  IConv::IConv()
-  : cd(0)
+  : to_charset(),
+    from_charset(),
+    cd(0)
  {}

  IConv::IConv(const std::string& from_charset_, const std::string&  
to_charset_)
- : cd(0)
+  : to_charset(),
+    from_charset(),
+    cd(0)
  {
    set_charsets(from_charset_, to_charset_);
  }

Modified: branches/tinygettext-portable/src/log.cpp
==============================================================================
--- branches/tinygettext-portable/src/log.cpp	(original)
+++ branches/tinygettext-portable/src/log.cpp	Thu Feb 12 14:48:47 2009
@@ -51,7 +51,8 @@
  }
  
  Log::Log(log_callback_t callback_)
-  : callback(callback_)
+  : callback(callback_),
+    out()
  {
  }


Modified: branches/tinygettext-portable/src/po_parser.cpp
==============================================================================
--- branches/tinygettext-portable/src/po_parser.cpp	(original)
+++ branches/tinygettext-portable/src/po_parser.cpp	Thu Feb 12 14:48:47 2009
@@ -46,9 +46,9 @@
  class POParserError {};

  POParser::POParser(const std::string& filename_, std::istream& in_,  
Dictionary& dict_, bool use_fuzzy_)
-  : filename(filename_), in(in_), dict(dict_), use_fuzzy(use_fuzzy_),
+  : filename(filename_), in(in_), dict(dict_), use_fuzzy(use_fuzzy_),  
conv(),
      running(false), eof(false), big5(false),
-    line_number(0)
+    line_number(0), current_line()
  {
  }

@@ -326,9 +326,9 @@
    // skip UTF-8 intro that some text editors produce
    // see http://en.wikipedia.org/wiki/Byte-order_mark
    if (current_line.size() >= 3 &&
-      current_line[0] == 0xef &&
-      current_line[1] == 0xbb &&
-      current_line[2] == 0xbf)
+      current_line[0] == static_cast<char>(0xef) &&
+      current_line[1] == static_cast<char>(0xbb) &&
+      current_line[2] == static_cast<char>(0xbf))
      {
        current_line = current_line.substr(3);
      }


More information about the Supertux-Commit mailing list