[wesnoth-commits] [wesnoth/wesnoth] 1deacd: Convert custom unicode type aliases to proper type...

GitHub noreply at github.com
Wed Apr 4 15:54:32 UTC 2018


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 1deacd89f640e1ddada75e1286c14a09ab8cce62
      https://github.com/wesnoth/wesnoth/commit/1deacd89f640e1ddada75e1286c14a09ab8cce62
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2018-04-04 (Wed, 04 Apr 2018)

  Changed paths:
    M src/addon/client.cpp
    M src/addon/validation.cpp
    M src/desktop/windows_tray_notification.cpp
    M src/font/marked-up_text.cpp
    M src/font/marked-up_text.hpp
    M src/font/text.cpp
    M src/font/text.hpp
    M src/gui/core/event/dispatcher.cpp
    M src/gui/core/event/dispatcher.hpp
    M src/gui/core/event/distributor.cpp
    M src/gui/core/event/distributor.hpp
    M src/gui/core/event/handler.cpp
    M src/gui/widgets/password_box.cpp
    M src/gui/widgets/password_box.hpp
    M src/gui/widgets/text_box.cpp
    M src/gui/widgets/text_box_base.cpp
    M src/gui/widgets/text_box_base.hpp
    M src/hotkey/hotkey_item.cpp
    M src/preferences/credentials.cpp
    M src/savegame.cpp
    M src/serialization/ucs4_convert_impl.hpp
    M src/serialization/ucs4_iterator_base.hpp
    M src/serialization/unicode.cpp
    M src/serialization/unicode.hpp
    M src/serialization/unicode_cast.hpp
    R src/serialization/unicode_types.hpp
    A src/serialization/utf8_exception.hpp
    M src/server/player_network.cpp
    M src/tests/test_serialization.cpp
    M src/utils/markov_generator.cpp
    M src/utils/markov_generator.hpp

  Log Message:
  -----------
  Convert custom unicode type aliases to proper types (available as of C++11)

This changes:
utf8::char_t   ->  char
utf8::string   ->  std::string
utf16::char_t  ->  char16_t
utf16::string  ->  std::u16string
ucs4::char_t   ->  char32_t
ucs4::string   ->  std::u32string

utf16::string and ucs4::string are now proper strings instead of vectors of characters too.

In order to get this change to compile at all, I needed to add a ucs4_convert_impl::convert_impl
specialization for wchar_t alongside the new char16_t specialization; both point to the same
conversion implementation type.

This commit doesn't do any additional cleanup. I'm sure if we looked, we could get rid of a
lot of the custom conversion code and probably a bunch of stuff that might have had to do with
supporting utf16::string and ucs4::string being vectors instead of basic_string specializations.
Either way, I don't know the code (or encoding handling in general) to make a call as to what's
needed or not. I'll let someone else do that.




More information about the Commits mailing list