[Commits] [wesnoth/wesnoth] 876710: Use std::to_string() or equivalent wherever possib...

GitHub noreply at github.com
Thu Mar 31 00:19:26 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 876710af8c24191ded7d9b82e5ee667aca216832
      https://github.com/wesnoth/wesnoth/commit/876710af8c24191ded7d9b82e5ee667aca216832
  Author: Charles Dang <exodia339 at gmail.com>
  Date:   2016-03-31 (Thu, 31 Mar 2016)

  Changed paths:
    M src/actions/move.cpp
    M src/addon/client.cpp
    M src/addon/manager_ui.cpp
    M src/ai/composite/aspect.hpp
    M src/ai/composite/value_translator.hpp
    M src/ai/formula/ai.cpp
    M src/ai/formula/stage_unit_formulas.cpp
    M src/ai/manager.cpp
    M src/ai/testing.cpp
    M src/carryover.cpp
    M src/color_range.cpp
    M src/config.cpp
    M src/editor/editor_display.cpp
    M src/editor/editor_preferences.cpp
    M src/editor/map/context_manager.cpp
    M src/editor/map/editor_map.cpp
    M src/formula/callable_objects.cpp
    M src/formula/variant.cpp
    M src/game_board.cpp
    M src/game_classification.cpp
    M src/game_display.cpp
    M src/game_initialization/connect_engine.cpp
    M src/game_initialization/create_engine.cpp
    M src/game_initialization/multiplayer_connect.cpp
    M src/game_initialization/multiplayer_lobby.cpp
    M src/game_initialization/multiplayer_ui.cpp
    M src/game_initialization/multiplayer_wait.cpp
    M src/game_preferences.cpp
    M src/game_state.cpp
    M src/generators/default_map_generator.cpp
    M src/gui/dialogs/addon/description.cpp
    M src/gui/dialogs/addon/list.cpp
    M src/gui/dialogs/campaign_selection.cpp
    M src/gui/dialogs/debug_clock.cpp
    M src/gui/dialogs/editor/resize_map.cpp
    M src/gui/dialogs/editor/set_starting_position.cpp
    M src/gui/dialogs/gamestate_inspector.cpp
    M src/gui/dialogs/label_settings.cpp
    M src/gui/dialogs/lobby/lobby.cpp
    M src/gui/dialogs/multiplayer/mp_change_control.cpp
    M src/gui/dialogs/preferences_dialog.cpp
    M src/gui/dialogs/unit_recruit.cpp
    M src/gui/widgets/debug.cpp
    M src/gui/widgets/listbox.cpp
    M src/gui/widgets/unit_preview_pane.cpp
    M src/hotkey/hotkey_handler.cpp
    M src/hotkey/hotkey_item.cpp
    M src/image_modifications.cpp
    M src/map/label.cpp
    M src/menu_events.cpp
    M src/network.cpp
    M src/pathfind/teleport.cpp
    M src/play_controller.cpp
    M src/preferences.cpp
    M src/replay.cpp
    M src/reports.cpp
    M src/save_index.cpp
    M src/scripting/game_lua_kernel.cpp
    M src/scripting/lua_map_location_ops.cpp
    M src/serialization/preprocessor.cpp
    M src/serialization/string_utils.cpp
    M src/synced_context.cpp
    M src/synced_user_choice.cpp
    M src/team.cpp
    M src/teambuilder.cpp
    M src/terrain/filter.cpp
    M src/terrain/translation.cpp
    M src/tests/test_lexical_cast.cpp
    M src/tests/test_make_enum.cpp
    M src/tests/test_mp_connect.cpp
    M src/tools/sdl2/window.cpp
    M src/units/animation.cpp
    M src/units/filter.cpp
    M src/units/frame.cpp
    M src/units/types.cpp
    M src/units/unit.cpp
    M src/util.hpp
    M src/whiteboard/manager.cpp
    M src/widgets/progressbar.cpp

  Log Message:
  -----------
  Use std::to_string() or equivalent wherever possible

This commit removes the utility srt_cast() function and replaces its calls,
along with calls to lexical_cast<std::string>() (and its boost variant),
with std::to_string().

In a few cases where the input type isn't compatible with to_string,
lexical_cast<std::string> is still used.

In other cases where lexical_cast was operating on MAKE_ENUM enums, the
call has been replaced with ENUM::enum_to_string, which is faster.





More information about the Commits mailing list