From 564f07b4b43e64dedca8727d4b5da0ae5a12577d Mon Sep 17 00:00:00 2001 From: Ingo Ruhnke Date: Sun, 3 Aug 2014 19:29:45 +0200 Subject: [PATCH] Updated to version 79b7bde of tinygettext --- external/tinygettext/.gitignore | 12 ++++++++ external/tinygettext/CMakeLists.txt | 24 ++++++++-------- external/tinygettext/SConstruct | 32 +++++++++++++--------- .../{ => include}/tinygettext/dictionary.hpp | 9 +++--- .../tinygettext/dictionary_manager.hpp | 10 +++---- .../{ => include}/tinygettext/file_system.hpp | 4 +-- .../{ => include}/tinygettext/iconv.hpp | 0 .../{ => include}/tinygettext/language.hpp | 14 ++++++++-- .../tinygettext/{ => include}/tinygettext/log.hpp | 0 .../{ => include}/tinygettext/log_stream.hpp | 0 .../{ => include}/tinygettext/plural_forms.hpp | 0 .../{ => include}/tinygettext/po_parser.hpp | 2 +- .../{ => include}/tinygettext/tinygettext.hpp | 0 .../{ => include}/tinygettext/unix_file_system.hpp | 2 +- .../{tinygettext => src}/dictionary.cpp | 5 ++-- .../{tinygettext => src}/dictionary_manager.cpp | 14 +++++----- .../tinygettext/{tinygettext => src}/iconv.cpp | 4 +-- .../tinygettext/{tinygettext => src}/language.cpp | 14 +++++----- external/tinygettext/{tinygettext => src}/log.cpp | 2 +- .../{tinygettext => src}/plural_forms.cpp | 8 +++--- .../tinygettext/{tinygettext => src}/po_parser.cpp | 18 ++++++------ .../{tinygettext => src}/tinygettext.cpp | 0 .../{tinygettext => src}/unix_file_system.cpp | 6 ++-- 23 files changed, 106 insertions(+), 74 deletions(-) create mode 100644 external/tinygettext/.gitignore rename external/tinygettext/{ => include}/tinygettext/dictionary.hpp (96%) rename external/tinygettext/{ => include}/tinygettext/dictionary_manager.hpp (93%) rename external/tinygettext/{ => include}/tinygettext/file_system.hpp (86%) rename external/tinygettext/{ => include}/tinygettext/iconv.hpp (100%) rename external/tinygettext/{ => include}/tinygettext/language.hpp (91%) rename external/tinygettext/{ => include}/tinygettext/log.hpp (100%) rename external/tinygettext/{ => include}/tinygettext/log_stream.hpp (100%) rename external/tinygettext/{ => include}/tinygettext/plural_forms.hpp (100%) rename external/tinygettext/{ => include}/tinygettext/po_parser.hpp (96%) rename external/tinygettext/{ => include}/tinygettext/tinygettext.hpp (100%) rename external/tinygettext/{ => include}/tinygettext/unix_file_system.hpp (94%) rename external/tinygettext/{tinygettext => src}/dictionary.cpp (98%) rename external/tinygettext/{tinygettext => src}/dictionary_manager.cpp (94%) rename external/tinygettext/{tinygettext => src}/iconv.cpp (98%) rename external/tinygettext/{tinygettext => src}/language.cpp (98%) rename external/tinygettext/{tinygettext => src}/log.cpp (98%) rename external/tinygettext/{tinygettext => src}/plural_forms.cpp (94%) rename external/tinygettext/{tinygettext => src}/po_parser.cpp (97%) rename external/tinygettext/{tinygettext => src}/tinygettext.cpp (100%) rename external/tinygettext/{tinygettext => src}/unix_file_system.cpp (91%) diff --git a/external/tinygettext/.gitignore b/external/tinygettext/.gitignore new file mode 100644 index 000000000..d498d4569 --- /dev/null +++ b/external/tinygettext/.gitignore @@ -0,0 +1,12 @@ +*.o +*~ +/.sconsign.dblite +/CMakeCache.txt +/CMakeFiles/ +/Makefile +/cmake_install.cmake +/libtinygettext.so +/src/libtinygettext.a +/test/po_parser_test +/test/tinygettext_test +/tinygettext.pc diff --git a/external/tinygettext/CMakeLists.txt b/external/tinygettext/CMakeLists.txt index 6c1d78b83..a25898e69 100644 --- a/external/tinygettext/CMakeLists.txt +++ b/external/tinygettext/CMakeLists.txt @@ -6,12 +6,12 @@ # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA @@ -92,8 +92,8 @@ ENDIF(HAVE_ICONV_CONST) ## build list of source files -FILE(GLOB TINYGETTEXT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tinygettext/*.cpp) -FILE(GLOB TINYGETTEXT_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} tinygettext/*.hpp) +FILE(GLOB TINYGETTEXT_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*.cpp) +FILE(GLOB TINYGETTEXT_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/tinygettext/*.hpp) ## define a target for building the library @@ -101,13 +101,13 @@ ADD_LIBRARY(tinygettext ${TINYGETTEXT_SOURCES}) ## Add tinygettext dir to search path -INCLUDE_DIRECTORIES(${tinygettext_SOURCE_DIR}) +INCLUDE_DIRECTORIES(include/) ## Debug options OPTION(WERROR "Stops on first compiler warning in debug mode" OFF) IF(CMAKE_COMPILER_IS_GNUCC) - ADD_DEFINITIONS(-O3 -Wall -Wextra -Weffc++ -pedantic) + ADD_DEFINITIONS(-std=c++0x -O3 -Wall -Wextra -Weffc++ -pedantic) # -ansi fails in MinGW OPTION(WARNINGS "Enable long list of warnings for compiler to check" ON) IF(WARNINGS) @@ -119,12 +119,12 @@ IF(CMAKE_COMPILER_IS_GNUCC) -Wsign-promo -Wswitch-enum -Wcast-align -Wcast-qual -Wdisabled-optimization - -Wfloat-equal + -Wfloat-equal -Wformat=2 - -Winit-self + -Winit-self -Winvalid-pch -Wunsafe-loop-optimizations - -Wlogical-op - -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn + -Wlogical-op + -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wredundant-decls -Wshadow @@ -143,7 +143,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) ## Extra definitions -ADD_DEFINITIONS(-DVERSION=\\\"${VERSION}\\\") +ADD_DEFINITIONS(-DVERSION=${VERSION}) ## Generate test executables in the right place @@ -175,3 +175,5 @@ INSTALL(FILES ${TINYGETTEXT_HEADERS} DESTINATION include/tinygettext) INSTALL(FILES ${tinygettext_BINARY_DIR}/tinygettext.pc DESTINATION ${LIB_SUBDIR}/pkgconfig) + +# EOF # diff --git a/external/tinygettext/SConstruct b/external/tinygettext/SConstruct index 92613fd47..a31abf95c 100644 --- a/external/tinygettext/SConstruct +++ b/external/tinygettext/SConstruct @@ -1,8 +1,14 @@ # -*- python -*- -env = Environment(CXXFLAGS=['-O0', +import os + +env = Environment(ENV=os.environ, + CXX="g++", + CXXFLAGS=['-O0', '-g3', + '-std=c++0x', '-Wall', + '-Wextra', '-Wcast-qual', '-Wconversion', '-Weffc++', @@ -12,24 +18,24 @@ env = Environment(CXXFLAGS=['-O0', '-Wno-unused-parameter', '-Wnon-virtual-dtor', '-Wshadow', - '-ansi', + # '-ansi', # conflicts with -std=c++0x '-pedantic', ], - CPPPATH=['tinygettext', '.']) + CPPPATH=['include', 'src']) # env.ParseConfig("sdl-config --cflags --libs") # env['CPPDEFINES'] += HAVE_SDL -libtinygettext = env.StaticLibrary('tinygettext/tinygettext', - ['tinygettext/tinygettext.cpp', - 'tinygettext/language.cpp', - 'tinygettext/plural_forms.cpp', - 'tinygettext/dictionary.cpp', - 'tinygettext/dictionary_manager.cpp', - 'tinygettext/unix_file_system.cpp', - 'tinygettext/po_parser.cpp', - 'tinygettext/iconv.cpp', - 'tinygettext/log.cpp']) +libtinygettext = env.StaticLibrary('src/tinygettext', + ['src/tinygettext.cpp', + 'src/language.cpp', + 'src/plural_forms.cpp', + 'src/dictionary.cpp', + 'src/dictionary_manager.cpp', + 'src/unix_file_system.cpp', + 'src/po_parser.cpp', + 'src/iconv.cpp', + 'src/log.cpp']) env.Program('test/tinygettext_test', ['test/tinygettext_test.cpp', libtinygettext]) env.Program('test/po_parser_test', ['test/po_parser_test.cpp', libtinygettext]) diff --git a/external/tinygettext/tinygettext/dictionary.hpp b/external/tinygettext/include/tinygettext/dictionary.hpp similarity index 96% rename from external/tinygettext/tinygettext/dictionary.hpp rename to external/tinygettext/include/tinygettext/dictionary.hpp index 743e075a0..5f08710f8 100644 --- a/external/tinygettext/tinygettext/dictionary.hpp +++ b/external/tinygettext/include/tinygettext/dictionary.hpp @@ -18,9 +18,10 @@ #ifndef HEADER_TINYGETTEXT_DICTIONARY_HPP #define HEADER_TINYGETTEXT_DICTIONARY_HPP -#include -#include #include +#include +#include + #include "plural_forms.hpp" namespace tinygettext { @@ -31,10 +32,10 @@ namespace tinygettext { class Dictionary { private: - typedef std::map > Entries; + typedef std::unordered_map > Entries; Entries entries; - typedef std::map CtxtEntries; + typedef std::unordered_map CtxtEntries; CtxtEntries ctxt_entries; std::string charset; diff --git a/external/tinygettext/tinygettext/dictionary_manager.hpp b/external/tinygettext/include/tinygettext/dictionary_manager.hpp similarity index 93% rename from external/tinygettext/tinygettext/dictionary_manager.hpp rename to external/tinygettext/include/tinygettext/dictionary_manager.hpp index 7c3d7f3bc..c3f6d9574 100644 --- a/external/tinygettext/tinygettext/dictionary_manager.hpp +++ b/external/tinygettext/include/tinygettext/dictionary_manager.hpp @@ -18,11 +18,11 @@ #ifndef HEADER_TINYGETTEXT_DICTIONARY_MANAGER_HPP #define HEADER_TINYGETTEXT_DICTIONARY_MANAGER_HPP -#include +#include #include #include +#include #include -#include #include "dictionary.hpp" #include "language.hpp" @@ -37,7 +37,7 @@ class FileSystem; class DictionaryManager { private: - typedef std::map Dictionaries; + typedef std::unordered_map Dictionaries; Dictionaries dictionaries; typedef std::vector SearchPath; @@ -51,7 +51,7 @@ private: Dictionary empty_dict; - std::auto_ptr filesystem; + std::unique_ptr filesystem; void clear_cache(); @@ -85,7 +85,7 @@ public: /** Return a set of the available languages in their country code */ std::set get_languages(); - void set_filesystem(std::auto_ptr filesystem); + void set_filesystem(std::unique_ptr filesystem); private: DictionaryManager (const DictionaryManager&); diff --git a/external/tinygettext/tinygettext/file_system.hpp b/external/tinygettext/include/tinygettext/file_system.hpp similarity index 86% rename from external/tinygettext/tinygettext/file_system.hpp rename to external/tinygettext/include/tinygettext/file_system.hpp index af47aaf96..67ec33b9f 100644 --- a/external/tinygettext/tinygettext/file_system.hpp +++ b/external/tinygettext/include/tinygettext/file_system.hpp @@ -30,8 +30,8 @@ class FileSystem public: virtual ~FileSystem() {} - virtual std::vector open_directory(const std::string& pathname) =0; - virtual std::auto_ptr open_file(const std::string& filename) =0; + virtual std::vector open_directory(const std::string& pathname) =0; + virtual std::unique_ptr open_file(const std::string& filename) =0; }; } // namespace tinygettext diff --git a/external/tinygettext/tinygettext/iconv.hpp b/external/tinygettext/include/tinygettext/iconv.hpp similarity index 100% rename from external/tinygettext/tinygettext/iconv.hpp rename to external/tinygettext/include/tinygettext/iconv.hpp diff --git a/external/tinygettext/tinygettext/language.hpp b/external/tinygettext/include/tinygettext/language.hpp similarity index 91% rename from external/tinygettext/tinygettext/language.hpp rename to external/tinygettext/include/tinygettext/language.hpp index 90eccc1d4..de37cc8c4 100644 --- a/external/tinygettext/tinygettext/language.hpp +++ b/external/tinygettext/include/tinygettext/language.hpp @@ -19,6 +19,7 @@ #define HEADER_TINYGETTEXT_LANGUAGE_HPP #include +#include namespace tinygettext { @@ -74,16 +75,25 @@ public: variable: {language}_{country}@{modifier} */ std::string str() const; - bool operator==(const Language& rhs); - bool operator!=(const Language& rhs); + bool operator==(const Language& rhs) const; + bool operator!=(const Language& rhs) const; friend bool operator<(const Language& lhs, const Language& rhs); + friend struct Language_hash; }; inline bool operator<(const Language& lhs, const Language& rhs) { return lhs.language_spec < rhs.language_spec; } +struct Language_hash +{ + size_t operator()(const Language& v) const + { + return reinterpret_cast(v.language_spec); + } +}; + } // namespace tinygettext #endif diff --git a/external/tinygettext/tinygettext/log.hpp b/external/tinygettext/include/tinygettext/log.hpp similarity index 100% rename from external/tinygettext/tinygettext/log.hpp rename to external/tinygettext/include/tinygettext/log.hpp diff --git a/external/tinygettext/tinygettext/log_stream.hpp b/external/tinygettext/include/tinygettext/log_stream.hpp similarity index 100% rename from external/tinygettext/tinygettext/log_stream.hpp rename to external/tinygettext/include/tinygettext/log_stream.hpp diff --git a/external/tinygettext/tinygettext/plural_forms.hpp b/external/tinygettext/include/tinygettext/plural_forms.hpp similarity index 100% rename from external/tinygettext/tinygettext/plural_forms.hpp rename to external/tinygettext/include/tinygettext/plural_forms.hpp diff --git a/external/tinygettext/tinygettext/po_parser.hpp b/external/tinygettext/include/tinygettext/po_parser.hpp similarity index 96% rename from external/tinygettext/tinygettext/po_parser.hpp rename to external/tinygettext/include/tinygettext/po_parser.hpp index 329af5913..14d4487e6 100644 --- a/external/tinygettext/tinygettext/po_parser.hpp +++ b/external/tinygettext/include/tinygettext/po_parser.hpp @@ -50,7 +50,7 @@ private: void parse(); void next_line(); std::string get_string(unsigned int skip); - void get_string_line(std::ostringstream& str,unsigned int skip); + void get_string_line(std::ostringstream& str, size_t skip); bool is_empty_line(); bool prefix(const char* ); void error(const std::string& msg) __attribute__((__noreturn__)); diff --git a/external/tinygettext/tinygettext/tinygettext.hpp b/external/tinygettext/include/tinygettext/tinygettext.hpp similarity index 100% rename from external/tinygettext/tinygettext/tinygettext.hpp rename to external/tinygettext/include/tinygettext/tinygettext.hpp diff --git a/external/tinygettext/tinygettext/unix_file_system.hpp b/external/tinygettext/include/tinygettext/unix_file_system.hpp similarity index 94% rename from external/tinygettext/tinygettext/unix_file_system.hpp rename to external/tinygettext/include/tinygettext/unix_file_system.hpp index 80f3e6db4..aa2552442 100644 --- a/external/tinygettext/tinygettext/unix_file_system.hpp +++ b/external/tinygettext/include/tinygettext/unix_file_system.hpp @@ -28,7 +28,7 @@ public: UnixFileSystem(); std::vector open_directory(const std::string& pathname); - std::auto_ptr open_file(const std::string& filename); + std::unique_ptr open_file(const std::string& filename); }; } // namespace tinygettext diff --git a/external/tinygettext/tinygettext/dictionary.cpp b/external/tinygettext/src/dictionary.cpp similarity index 98% rename from external/tinygettext/tinygettext/dictionary.cpp rename to external/tinygettext/src/dictionary.cpp index 9765d751d..1a7642af6 100644 --- a/external/tinygettext/tinygettext/dictionary.cpp +++ b/external/tinygettext/src/dictionary.cpp @@ -16,8 +16,9 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include "log_stream.hpp" -#include "dictionary.hpp" + +#include "tinygettext/log_stream.hpp" +#include "tinygettext/dictionary.hpp" namespace tinygettext { diff --git a/external/tinygettext/tinygettext/dictionary_manager.cpp b/external/tinygettext/src/dictionary_manager.cpp similarity index 94% rename from external/tinygettext/tinygettext/dictionary_manager.cpp rename to external/tinygettext/src/dictionary_manager.cpp index f923470f7..c3e991727 100644 --- a/external/tinygettext/tinygettext/dictionary_manager.cpp +++ b/external/tinygettext/src/dictionary_manager.cpp @@ -15,7 +15,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "dictionary_manager.hpp" +#include "tinygettext/dictionary_manager.hpp" #include #include @@ -24,9 +24,9 @@ #include #include -#include "log_stream.hpp" -#include "po_parser.hpp" -#include "unix_file_system.hpp" +#include "tinygettext/log_stream.hpp" +#include "tinygettext/po_parser.hpp" +#include "tinygettext/unix_file_system.hpp" namespace tinygettext { @@ -146,7 +146,7 @@ DictionaryManager::get_dictionary(const Language& language) std::string pofile = *p + "/" + best_filename; try { - std::auto_ptr in = filesystem->open_file(pofile); + std::unique_ptr in = filesystem->open_file(pofile); if (!in.get()) { log_error << "error: failure opening: " << pofile << std::endl; @@ -232,9 +232,9 @@ DictionaryManager::add_directory(const std::string& pathname) } void -DictionaryManager::set_filesystem(std::auto_ptr filesystem_) +DictionaryManager::set_filesystem(std::unique_ptr filesystem_) { - filesystem = filesystem_; + filesystem = std::move(filesystem_); } } // namespace tinygettext diff --git a/external/tinygettext/tinygettext/iconv.cpp b/external/tinygettext/src/iconv.cpp similarity index 98% rename from external/tinygettext/tinygettext/iconv.cpp rename to external/tinygettext/src/iconv.cpp index c0b8b6072..4723cb2ce 100644 --- a/external/tinygettext/tinygettext/iconv.cpp +++ b/external/tinygettext/src/iconv.cpp @@ -23,8 +23,8 @@ #include #include -#include "iconv.hpp" -#include "log_stream.hpp" +#include "tinygettext/iconv.hpp" +#include "tinygettext/log_stream.hpp" namespace tinygettext { diff --git a/external/tinygettext/tinygettext/language.cpp b/external/tinygettext/src/language.cpp similarity index 98% rename from external/tinygettext/tinygettext/language.cpp rename to external/tinygettext/src/language.cpp index 4e7672b03..10a4e4b39 100644 --- a/external/tinygettext/tinygettext/language.cpp +++ b/external/tinygettext/src/language.cpp @@ -15,10 +15,10 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "language.hpp" +#include "tinygettext/language.hpp" -#include #include +#include #include namespace tinygettext { @@ -285,7 +285,7 @@ LanguageSpec languages[] = { std::string resolve_language_alias(const std::string& name) { - typedef std::map Aliases; + typedef std::unordered_map Aliases; static Aliases language_aliases; if (language_aliases.empty()) { @@ -363,7 +363,7 @@ resolve_language_alias(const std::string& name) Language Language::from_spec(const std::string& language, const std::string& country, const std::string& modifier) { - static std::map > language_map; + static std::unordered_map > language_map; if (language_map.empty()) { // Init language_map @@ -371,7 +371,7 @@ Language::from_spec(const std::string& language, const std::string& country, con language_map[languages[i].language].push_back(&languages[i]); } - std::map >::iterator i = language_map.find(language); + std::unordered_map >::iterator i = language_map.find(language); if (i != language_map.end()) { std::vector& lst = i->second; @@ -553,13 +553,13 @@ Language::str() const } bool -Language::operator==(const Language& rhs) +Language::operator==(const Language& rhs) const { return language_spec == rhs.language_spec; } bool -Language::operator!=(const Language& rhs) +Language::operator!=(const Language& rhs) const { return language_spec != rhs.language_spec; } diff --git a/external/tinygettext/tinygettext/log.cpp b/external/tinygettext/src/log.cpp similarity index 98% rename from external/tinygettext/tinygettext/log.cpp rename to external/tinygettext/src/log.cpp index be8e2e691..37f31f98e 100644 --- a/external/tinygettext/tinygettext/log.cpp +++ b/external/tinygettext/src/log.cpp @@ -16,7 +16,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include -#include "log.hpp" +#include "tinygettext/log.hpp" namespace tinygettext { diff --git a/external/tinygettext/tinygettext/plural_forms.cpp b/external/tinygettext/src/plural_forms.cpp similarity index 94% rename from external/tinygettext/tinygettext/plural_forms.cpp rename to external/tinygettext/src/plural_forms.cpp index 8271437b7..5a2fd5577 100644 --- a/external/tinygettext/tinygettext/plural_forms.cpp +++ b/external/tinygettext/src/plural_forms.cpp @@ -15,9 +15,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "plural_forms.hpp" +#include "tinygettext/plural_forms.hpp" -#include +#include namespace tinygettext { @@ -46,7 +46,7 @@ unsigned int plural4_ar(int n) { return static_cast( n==1 ? 0 : n= PluralForms PluralForms::from_string(const std::string& str) { - static std::map plural_forms; + static std::unordered_map plural_forms; if (plural_forms.empty()) { @@ -73,7 +73,7 @@ PluralForms::from_string(const std::string& str) if (!isspace(str[i])) space_less_str += str[i]; - std::map::const_iterator it= plural_forms.find(space_less_str); + std::unordered_map::const_iterator it= plural_forms.find(space_less_str); if (it != plural_forms.end()) { return it->second; diff --git a/external/tinygettext/tinygettext/po_parser.cpp b/external/tinygettext/src/po_parser.cpp similarity index 97% rename from external/tinygettext/tinygettext/po_parser.cpp rename to external/tinygettext/src/po_parser.cpp index 5ceb3fd26..ec9840cbd 100644 --- a/external/tinygettext/tinygettext/po_parser.cpp +++ b/external/tinygettext/src/po_parser.cpp @@ -15,21 +15,21 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "po_parser.hpp" +#include "tinygettext/po_parser.hpp" #include #include #include #include #include -#include +#include #include -#include "language.hpp" -#include "log_stream.hpp" -#include "iconv.hpp" -#include "dictionary.hpp" -#include "plural_forms.hpp" +#include "tinygettext/language.hpp" +#include "tinygettext/log_stream.hpp" +#include "tinygettext/iconv.hpp" +#include "tinygettext/dictionary.hpp" +#include "tinygettext/plural_forms.hpp" namespace tinygettext { @@ -91,7 +91,7 @@ POParser::next_line() } void -POParser::get_string_line(std::ostringstream& out,unsigned int skip) +POParser::get_string_line(std::ostringstream& out, size_t skip) { if (skip+1 >= static_cast(current_line.size())) error("unexpected end of line"); @@ -207,7 +207,7 @@ next: if (pedantic) warning("leading whitespace before string"); - get_string_line(out, i); + get_string_line(out, i); goto next; } else if (isspace(current_line[i])) diff --git a/external/tinygettext/tinygettext/tinygettext.cpp b/external/tinygettext/src/tinygettext.cpp similarity index 100% rename from external/tinygettext/tinygettext/tinygettext.cpp rename to external/tinygettext/src/tinygettext.cpp diff --git a/external/tinygettext/tinygettext/unix_file_system.cpp b/external/tinygettext/src/unix_file_system.cpp similarity index 91% rename from external/tinygettext/tinygettext/unix_file_system.cpp rename to external/tinygettext/src/unix_file_system.cpp index 5e14d17f1..0b2051f20 100644 --- a/external/tinygettext/tinygettext/unix_file_system.cpp +++ b/external/tinygettext/src/unix_file_system.cpp @@ -15,7 +15,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include "unix_file_system.hpp" +#include "tinygettext/unix_file_system.hpp" #include #include @@ -54,10 +54,10 @@ UnixFileSystem::open_directory(const std::string& pathname) } } -std::auto_ptr +std::unique_ptr UnixFileSystem::open_file(const std::string& filename) { - return std::auto_ptr(new std::ifstream(filename.c_str())); + return std::unique_ptr(new std::ifstream(filename.c_str())); } } // namespace tinygettext -- 2.11.0