From ba24612f73edd95814e1fe40bc10f6fbe0af6099 Mon Sep 17 00:00:00 2001 From: Tommy Date: Mon, 18 Jul 2022 17:19:15 +1200 Subject: [PATCH] Remove trailing newlines from multiline log messages --- src/actions/attack.cpp | 2 +- src/actions/move.cpp | 2 +- src/addon/client.cpp | 2 +- src/addon/manager.cpp | 4 +- src/ai/composite/ai.cpp | 2 +- src/ai/contexts.cpp | 4 +- src/ai/default/attack.cpp | 4 +- src/ai/default/ca.cpp | 24 +++---- src/ai/default/ca_move_to_targets.cpp | 2 +- src/ai/default/contexts.cpp | 2 +- src/ai/default/recruitment.cpp | 2 +- src/ai/formula/function_table.cpp | 4 +- src/ai/simulated_actions.cpp | 6 +- src/config.cpp | 2 +- src/config_cache.cpp | 8 +-- src/desktop/dbus_features.cpp | 12 ++-- src/desktop/version.cpp | 3 +- src/display.cpp | 8 +-- src/draw.cpp | 20 +++--- src/draw_manager.cpp | 9 ++- src/editor/map/context_manager.cpp | 4 +- src/editor/map/map_context.cpp | 4 +- src/editor/palette/terrain_palettes.cpp | 2 +- src/editor/toolkit/editor_toolkit.cpp | 2 +- src/filesystem.cpp | 11 ++- src/filesystem_common.cpp | 2 +- src/floating_label.cpp | 4 +- src/font/font_config.cpp | 3 +- src/font/text.cpp | 14 ++-- src/formula/string_utils.cpp | 2 +- src/game_events/action_wml.cpp | 6 +- src/game_events/menu_item.cpp | 4 +- src/game_events/pump.cpp | 3 +- src/game_initialization/connect_engine.cpp | 9 ++- src/game_initialization/lobby_data.cpp | 2 +- src/generators/default_map_generator_job.cpp | 4 +- src/gettext.cpp | 10 +-- src/gui/auxiliary/iterator/policy_order.hpp | 24 +++---- src/gui/core/canvas.cpp | 6 +- src/gui/core/event/distributor.cpp | 6 +- src/gui/core/event/handler.cpp | 6 +- src/gui/core/gui_definition.cpp | 2 +- src/gui/core/widget_definition.cpp | 3 +- src/gui/core/window_builder/helper.cpp | 12 ++-- src/gui/dialogs/chat_log.cpp | 30 ++++---- src/gui/dialogs/multiplayer/lobby.cpp | 14 ++-- .../dialogs/multiplayer/mp_change_control.cpp | 2 +- src/gui/dialogs/tooltip.cpp | 5 +- src/gui/dialogs/unit_create.cpp | 2 +- src/gui/widgets/addon_list.cpp | 2 +- src/gui/widgets/button.cpp | 2 +- src/gui/widgets/chatbox.cpp | 4 +- src/gui/widgets/container_base.cpp | 2 +- src/gui/widgets/drawing.cpp | 2 +- src/gui/widgets/grid.cpp | 57 ++++++++------- src/gui/widgets/horizontal_scrollbar.cpp | 2 +- src/gui/widgets/image.cpp | 2 +- src/gui/widgets/label.cpp | 2 +- src/gui/widgets/listbox.cpp | 4 +- src/gui/widgets/menu_button.cpp | 2 +- src/gui/widgets/minimap.cpp | 2 +- src/gui/widgets/multi_page.cpp | 2 +- src/gui/widgets/multimenu_button.cpp | 2 +- src/gui/widgets/panel.cpp | 2 +- src/gui/widgets/password_box.cpp | 2 +- src/gui/widgets/progress_bar.cpp | 2 +- src/gui/widgets/repeating_button.cpp | 2 +- src/gui/widgets/scroll_label.cpp | 2 +- src/gui/widgets/scrollbar.cpp | 2 +- src/gui/widgets/scrollbar_container.cpp | 8 +-- src/gui/widgets/scrollbar_panel.cpp | 2 +- src/gui/widgets/slider.cpp | 2 +- src/gui/widgets/spacer.cpp | 2 +- src/gui/widgets/stacked_widget.cpp | 2 +- src/gui/widgets/styled_widget.cpp | 20 +++--- src/gui/widgets/text_box.cpp | 2 +- src/gui/widgets/toggle_button.cpp | 2 +- src/gui/widgets/toggle_panel.cpp | 2 +- src/gui/widgets/tree_view.cpp | 2 +- src/gui/widgets/unit_preview_pane.cpp | 2 +- src/gui/widgets/vertical_scrollbar.cpp | 2 +- src/gui/widgets/widget.cpp | 6 +- src/gui/widgets/window.cpp | 14 ++-- src/halo.cpp | 2 - src/hotkey/command_executor.cpp | 2 +- src/image_modifications.cpp | 22 +++--- src/movetype.cpp | 6 +- src/mt_rng.cpp | 4 +- src/network_asio.cpp | 2 +- src/picture.cpp | 13 ++-- src/playsingle_controller.cpp | 2 +- src/preferences/general.cpp | 4 +- src/replay.cpp | 2 +- src/saved_game.cpp | 2 +- src/scripting/lua_fileops.cpp | 2 +- src/serialization/preprocessor.cpp | 12 ++-- src/serialization/schema_validator.cpp | 4 +- src/serialization/string_utils.cpp | 2 +- src/server/campaignd/server.cpp | 12 ++-- src/server/common/dbconn.cpp | 2 +- src/server/common/server_base.cpp | 6 +- src/server/common/simple_wml.cpp | 6 +- src/server/wesnothd/ban.cpp | 5 +- src/server/wesnothd/game.cpp | 23 +++--- src/server/wesnothd/server.cpp | 70 +++++++++---------- src/sound.cpp | 2 +- src/synced_commands.cpp | 2 +- src/synced_context.cpp | 2 +- src/synced_user_choice.cpp | 2 +- src/team.cpp | 15 ++-- src/teambuilder.cpp | 5 +- src/terrain/builder.cpp | 6 +- src/terrain/filter.cpp | 8 +-- src/terrain/type_data.cpp | 8 +-- src/theme.cpp | 2 +- src/tooltips.cpp | 4 +- src/units/frame.cpp | 4 +- src/units/map.cpp | 8 +-- src/units/race.cpp | 2 +- src/units/types.cpp | 2 +- src/units/unit.cpp | 2 +- src/variable.cpp | 4 +- src/video.cpp | 24 +++---- src/wesnothd_connection.cpp | 2 +- src/whiteboard/attack.cpp | 8 +-- src/whiteboard/move.cpp | 6 +- src/whiteboard/recall.cpp | 2 +- src/whiteboard/recruit.cpp | 2 +- src/whiteboard/side_actions.cpp | 5 +- src/whiteboard/suppose_dead.cpp | 2 +- src/wml_exception.cpp | 2 +- 131 files changed, 385 insertions(+), 438 deletions(-) diff --git a/src/actions/attack.cpp b/src/actions/attack.cpp index 85cc09d6b0f..d92bb3c3b27 100644 --- a/src/actions/attack.cpp +++ b/src/actions/attack.cpp @@ -1428,7 +1428,7 @@ void attack::perform() << a_stats_->damage << "-" << a_stats_->num_blows << "(" << a_stats_->chance_to_hit << "%) vs DEF: " << (d_stats_->weapon ? d_stats_->weapon->name() : "none") << " " << d_stats_->damage << "-" << d_stats_->num_blows << "(" << d_stats_->chance_to_hit << "%)" - << (defender_strikes_first ? " defender first-strike" : "") << "\n"; + << (defender_strikes_first ? " defender first-strike" : ""); // Play the pre-fight animation unit_display::unit_draw_weapon(a_.loc_, a_.get_unit(), a_stats_->weapon, d_stats_->weapon, d_.loc_, d_.get_unit_ptr()); diff --git a/src/actions/move.cpp b/src/actions/move.cpp index 7d3dd04f6c4..e1490b1f985 100644 --- a/src/actions/move.cpp +++ b/src/actions/move.cpp @@ -1235,7 +1235,7 @@ std::size_t move_unit_and_record(const std::vector &steps, // Avoid some silliness. if ( steps.size() < 2 || (steps.size() == 2 && steps.front() == steps.back()) ) { DBG_NG << "Ignoring a unit trying to jump on its hex at " << - ( steps.empty() ? map_location::null_location() : steps.front() ) << ".\n"; + ( steps.empty() ? map_location::null_location() : steps.front() ) << "."; return 0; } //if we have no fog activated then we always skip sighted diff --git a/src/addon/client.cpp b/src/addon/client.cpp index aec14c0f218..e34cde50a40 100644 --- a/src/addon/client.cpp +++ b/src/addon/client.cpp @@ -111,7 +111,7 @@ void addons_client::connect() const std::string id_desc = server_id_.empty() ? "" : server_id_; LOG_ADDONS << "Server " << id_desc << " version " << version_desc - << " supports: " << utils::join(server_capabilities_, " ") << '\n'; + << " supports: " << utils::join(server_capabilities_, " "); } bool addons_client::request_addons_list(config& cfg) diff --git a/src/addon/manager.cpp b/src/addon/manager.cpp index 3c678cfd381..f695328803d 100644 --- a/src/addon/manager.cpp +++ b/src/addon/manager.cpp @@ -106,7 +106,7 @@ void get_addon_install_info(const std::string& addon_name, config& cfg) } catch(const config::error& e) { ERR_CFG << "Failed to read add-on installation information for '" << addon_name << "' from " << info_path << ":\n" - << e.message << std::endl; + << e.message; } } @@ -231,7 +231,7 @@ static filesystem::blacklist_pattern_list read_ignore_patterns(const std::string LOG_CFG << "searching for .ign file for '" << addon_name << "'..."; if (!filesystem::file_exists(ign_file)) { LOG_CFG << "no .ign file found for '" << addon_name << "'\n" - << "using default ignore patterns...\n"; + << "using default ignore patterns..."; return filesystem::default_blacklist; } LOG_CFG << "found .ign file: " << ign_file; diff --git a/src/ai/composite/ai.cpp b/src/ai/composite/ai.cpp index e9c0931cfce..2419e2818a8 100644 --- a/src/ai/composite/ai.cpp +++ b/src/ai/composite/ai.cpp @@ -55,7 +55,7 @@ ai_composite::ai_composite( default_ai_context &context, const config &cfg) void ai_composite::on_create() { LOG_AI_COMPOSITE << "side "<< get_side() << " : "<<" created AI with id=["<< - cfg_["id"]<<"]"<second->get_new_instance(*this,engine_name); if (!new_engine) { ERR_AI << "side "<(0.01,support); LOG_AI << "attack option has base value " << value << " with exposure " << exposure << ": " - << vulnerability << "/" << support << " = " << (vulnerability/std::max(support,0.1)) << "\n"; + << vulnerability << "/" << support << " = " << (vulnerability/std::max(support,0.1)); value -= exposure*(1.0-aggression); } @@ -327,7 +327,7 @@ double attack_analysis::rating(double aggression, const readonly_context& ai_obj << " vulnerability: " << vulnerability << " support: " << support << " quality: " << terrain_quality - << " alternative quality: " << alternative_terrain_quality << "\n"; + << " alternative quality: " << alternative_terrain_quality; return value; } diff --git a/src/ai/default/ca.cpp b/src/ai/default/ca.cpp index 09cc5d7b87c..d3a0fa51212 100644 --- a/src/ai/default/ca.cpp +++ b/src/ai/default/ca.cpp @@ -173,7 +173,7 @@ double combat_phase::evaluate() int time_taken = SDL_GetTicks() - ticks; LOG_AI_TESTING_AI_DEFAULT << "took " << time_taken << " ticks for " << analysis.size() - << " positions. Analyzing...\n"; + << " positions. Analyzing..."; ticks = SDL_GetTicks(); @@ -214,7 +214,7 @@ double combat_phase::evaluate() const double rating = it->rating(get_aggression(),*this); LOG_AI_TESTING_AI_DEFAULT << "attack option rated at " << rating << " (" - << (it->uses_leader ? get_leader_aggression() : get_aggression()) << ")\n"; + << (it->uses_leader ? get_leader_aggression() : get_aggression()) << ")"; if(rating > choice_rating_) { choice_it = it; @@ -652,7 +652,7 @@ void get_villages_phase::get_villages( if(!reachmap.empty()) { DBG_AI_TESTING_AI_DEFAULT << reachmap.size() << " units left after removing the ones who " - "can't reach a village, send the to the dispatcher.\n"; + "can't reach a village, send the to the dispatcher."; dump_reachmap(reachmap); @@ -662,7 +662,7 @@ void get_villages_phase::get_villages( } LOG_AI_TESTING_AI_DEFAULT << "Village assignment done: " << (SDL_GetTicks() - ticks) - << " ms, resulted in " << moves_.size() << " units being dispatched.\n"; + << " ms, resulted in " << moves_.size() << " units being dispatched."; } @@ -776,7 +776,7 @@ void get_villages_phase::find_villages( } DBG_AI_TESTING_AI_DEFAULT << moves.size() << " units already dispatched, " - << reachmap.size() << " left to evaluate.\n"; + << reachmap.size() << " left to evaluate."; } void get_villages_phase::dispatch(treachmap& reachmap, tmoves& moves) @@ -830,7 +830,7 @@ void get_villages_phase::dispatch(treachmap& reachmap, tmoves& moves) } DBG_AI_TESTING_AI_DEFAULT << reachmap.size() << " units left for complex dispatch with " - << village_count << " villages left.\n"; + << village_count << " villages left."; dump_reachmap(reachmap); @@ -871,7 +871,7 @@ bool get_villages_phase::dispatch_unit_simple(treachmap& reachmap, tmoves& moves if(reachmap.size() == 1) { // One unit left. DBG_AI_TESTING_AI_DEFAULT << "Dispatched _last_ unit at " << reachmap.begin()->first - << " to village " << reachmap.begin()->second[0] << '\n'; + << " to village " << reachmap.begin()->second[0]; moves.emplace_back(reachmap.begin()->second[0], reachmap.begin()->first); @@ -959,7 +959,7 @@ get_villages_phase::treachmap::iterator get_villages_phase::remove_unit( if(unit->first == leader_loc_ && best_leader_loc_ != map_location::null_location()) { DBG_AI_TESTING_AI_DEFAULT << "Dispatch leader at " << leader_loc_ << " closer to the keep at " - << best_leader_loc_ << '\n'; + << best_leader_loc_; moves.emplace_back(best_leader_loc_, leader_loc_); } @@ -1103,11 +1103,11 @@ void get_villages_phase::dispatch_complex( // Dispatch DBG_AI_TESTING_AI_DEFAULT << "Found a square.\nDispatched unit at " << units[src_itor->second] - << " to village " << village1 << '\n'; + << " to village " << village1; moves.emplace_back(village1, units[src_itor->second]); DBG_AI_TESTING_AI_DEFAULT << "Dispatched unit at " << units[dst_itor->second] - << " to village " << village2 << '\n'; + << " to village " << village2; moves.emplace_back(village2, units[dst_itor->second]); // Remove the units @@ -1157,7 +1157,7 @@ void get_villages_phase::dispatch_complex( DBG_AI_TESTING_AI_DEFAULT << "Too many units " << unit_count << " and villages " << village_count<<" found, evaluate only the first " - << max_options << " options;\n"; + << max_options << " options;"; std::vector perm (max_options, 0); for(std::size_t i =0; i < max_options; ++i) { @@ -1285,7 +1285,7 @@ void get_villages_phase::full_dispatch(treachmap& reachmap, tmoves& moves) treachmap::const_iterator itor = reachmap.begin(); for(std::size_t i = 0; i < reachmap.size(); ++i, ++itor) { DBG_AI_TESTING_AI_DEFAULT << "Dispatched unit at " << itor->first - << " to village " << itor->second[i] << '\n'; + << " to village " << itor->second[i]; moves.emplace_back(itor->second[i], itor->first); } } diff --git a/src/ai/default/ca_move_to_targets.cpp b/src/ai/default/ca_move_to_targets.cpp index 597561ea7f8..bc61d4350b6 100644 --- a/src/ai/default/ca_move_to_targets.cpp +++ b/src/ai/default/ca_move_to_targets.cpp @@ -509,7 +509,7 @@ std::pair move_to_targets_phase::choose_move(std::vec } } else { LOG_AI << "massing to attack " << best_target->loc.wml_x() << "," << best_target->loc.wml_y() - << " " << our_strength << "\n"; + << " " << our_strength; const double value = best_target->value; const map_location target_loc = best_target->loc; diff --git a/src/ai/default/contexts.cpp b/src/ai/default/contexts.cpp index dc527d01555..cb56c689375 100644 --- a/src/ai/default/contexts.cpp +++ b/src/ai/default/contexts.cpp @@ -206,7 +206,7 @@ std::vector default_ai_context_impl::find_targets(const move_map& enemy_ double value = village_value * (1.0 - leader_distance / corner_distance); LOG_AI << "found village target... " << *t << " with value: " << value - << " distance: " << leader_distance << '\n'; + << " distance: " << leader_distance; targets.emplace_back(*t,value,ai_target::type::village); } } diff --git a/src/ai/default/recruitment.cpp b/src/ai/default/recruitment.cpp index e916ef517b6..fd106e2f486 100644 --- a/src/ai/default/recruitment.cpp +++ b/src/ai/default/recruitment.cpp @@ -208,7 +208,7 @@ double recruitment::evaluate() { void recruitment::execute() { LOG_AI_RECRUITMENT << "\n\n\n------------AI RECRUITMENT BEGIN---------------\n"; LOG_AI_RECRUITMENT << "TURN: " << resources::tod_manager->turn() << - " SIDE: " << current_team().side() << "\n"; + " SIDE: " << current_team().side(); /* * Check which leaders can recruit and collect them in leader_data. diff --git a/src/ai/formula/function_table.cpp b/src/ai/formula/function_table.cpp index 24c0a412675..cd010687849 100644 --- a/src/ai/formula/function_table.cpp +++ b/src/ai/formula/function_table.cpp @@ -600,7 +600,7 @@ DEFINE_WFL_FUNCTION(calculate_outcome, 3, 4) args()[0]->evaluate(variables, add_debug_info(fdb, 0, "calculate_outcome:attacker_current_location")).convert_to()->loc(); if(units.count(attacker_location) == 0) { ERR_AI << "Performing calculate_outcome() with non-existent attacker at (" << - attacker_location.wml_x() << "," << attacker_location.wml_y() << ")\n"; + attacker_location.wml_x() << "," << attacker_location.wml_y() << ")"; return variant(); } @@ -608,7 +608,7 @@ DEFINE_WFL_FUNCTION(calculate_outcome, 3, 4) args()[2]->evaluate(variables,add_debug_info(fdb, 2, "calculate_outcome:defender_location")).convert_to()->loc(); if(units.count(defender_location) == 0) { ERR_AI << "Performing calculate_outcome() with non-existent defender at (" << - defender_location.wml_x() << "," << defender_location.wml_y() << ")\n"; + defender_location.wml_x() << "," << defender_location.wml_y() << ")"; return variant(); } diff --git a/src/ai/simulated_actions.cpp b/src/ai/simulated_actions.cpp index 459ba7c744d..f74e463b5b4 100644 --- a/src/ai/simulated_actions.cpp +++ b/src/ai/simulated_actions.cpp @@ -52,7 +52,7 @@ bool simulated_attack(const map_location& attacker_loc, const map_location& defe unit_map::iterator defend_unit = resources::gameboard->units().find(defender_loc); LOG_AI_SIM_ACTIONS << attack_unit->type_name() << " at " << attacker_loc << " attack " - << defend_unit->type_name() << " at " << defender_loc << std::endl; + << defend_unit->type_name() << " at " << defender_loc; LOG_AI_SIM_ACTIONS << "attacker's hp before attack: " << attack_unit->hitpoints(); LOG_AI_SIM_ACTIONS << "defender's hp before attack: " << defend_unit->hitpoints(); @@ -134,7 +134,7 @@ bool simulated_recall(int side, const std::string& unit_id, const map_location& own_team.spend_gold(recall_unit->recall_cost()<0 ? own_team.recall_cost() : recall_unit->recall_cost()); LOG_AI_SIM_ACTIONS << "recall " << recall_unit->type_name() << " at " - << recall_location << " spend " << own_team.recall_cost() << " gold" << std::endl; + << recall_location << " spend " << own_team.recall_cost() << " gold"; return true; } @@ -148,7 +148,7 @@ bool simulated_recruit(int side, const unit_type* u, const map_location& recruit resources::gameboard->get_team(side).spend_gold(u->cost()); LOG_AI_SIM_ACTIONS << "recruit " << u->type_name() << " at " - << recruit_location << " spend " << u->cost() << " gold" << std::endl; + << recruit_location << " spend " << u->cost() << " gold"; return true; } diff --git a/src/config.cpp b/src/config.cpp index 03e62582147..8efba2a7cf3 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -422,7 +422,7 @@ config& config::child(config_key_type key, int n) return *i->second.at(n); } catch(const std::out_of_range&) { DBG_CF << "The config object has only »" << i->second.size() << "« children named »" << key - << "«; request for the index »" << n << "« cannot be honored.\n"; + << "«; request for the index »" << n << "« cannot be honored."; if(throw_when_child_not_found::do_throw()) { throw error("Child at index not found"); diff --git a/src/config_cache.cpp b/src/config_cache.cpp index f7250b7a9d0..5f52456917b 100644 --- a/src/config_cache.cpp +++ b/src/config_cache.cpp @@ -349,7 +349,7 @@ bool config_cache::clean_cache() filesystem::get_files_in_dir(filesystem::get_cache_dir(), &files, &dirs, filesystem::name_mode::ENTIRE_FILE_PATH); LOG_CACHE << "clean_cache(): " << files.size() << " files, " - << dirs.size() << " dirs to check\n"; + << dirs.size() << " dirs to check"; const std::string& exclude_current = cache_file_prefix_ + "*"; @@ -369,7 +369,7 @@ bool config_cache::purge_cache() filesystem::get_files_in_dir(filesystem::get_cache_dir(), &files, &dirs, filesystem::name_mode::ENTIRE_FILE_PATH); LOG_CACHE << "purge_cache(): deleting " << files.size() << " files, " - << dirs.size() << " dirs\n"; + << dirs.size() << " dirs"; bool status = true; @@ -393,7 +393,7 @@ bool config_cache::delete_cache_files(const std::vector& paths, if(utils::wildcard_string_match(fn, exclude_pattern)) { LOG_CACHE << "delete_cache_files(): skipping " << file_path - << " excluded by '" << exclude_pattern << "'\n"; + << " excluded by '" << exclude_pattern << "'"; continue; } } @@ -401,7 +401,7 @@ bool config_cache::delete_cache_files(const std::vector& paths, LOG_CACHE << "delete_cache_files(): deleting " << file_path; if(!filesystem::delete_directory(file_path)) { ERR_CACHE << "delete_cache_files(): could not delete " - << file_path << '\n'; + << file_path; status = false; } } diff --git a/src/desktop/dbus_features.cpp b/src/desktop/dbus_features.cpp index 9c889495347..cbd22e1cf23 100644 --- a/src/desktop/dbus_features.cpp +++ b/src/desktop/dbus_features.cpp @@ -166,9 +166,9 @@ uint32_t send_dbus_notification(DBusConnection *connection, uint32_t replaces_id std::string app_icon_ = filesystem::normalize_path(game_config::path + "/" + game_config::images::app_icon); if (!filesystem::file_exists(app_icon_)) { - ERR_DU << "Error: Could not find notification icon.\n" - << "raw path =\'" << game_config::path << "\' / \'" << game_config::images::app_icon << "\'\n" - << "normalized path =\'" << app_icon_ << "\'\n"; + ERR_DU << "Error: Could not find notification icon."; + ERR_DU << "raw path =\'" << game_config::path << "\' / \'" << game_config::images::app_icon << "\'"; + ERR_DU << "normalized path =\'" << app_icon_ << "\'"; } else { DBG_DU << "app_icon_=\'" << app_icon_ << "\'"; } @@ -297,9 +297,9 @@ void send_notification(const std::string & owner, const std::string & message, b wnotify visual(id,owner,message); std::pair result = noticias.insert(visual); if (!result.second) { - ERR_DU << "Failed to insert a dbus notification message:\n" - << "New Item:\n" << "\tid=" << id << "\n\towner=" << owner << "\n\tmessage=" << message << "\n" - << "Old Item:\n" << "\tid=" << result.first->id << "\n\towner=" << result.first->owner << "\n\tmessage=" << result.first->message << "\n"; + ERR_DU << "Failed to insert a dbus notification message:"; + ERR_DU << "New Item:\n" << "\tid=" << id << "\n\towner=" << owner << "\n\tmessage=" << message; + ERR_DU << "Old Item:\n" << "\tid=" << result.first->id << "\n\towner=" << result.first->owner << "\n\tmessage=" << result.first->message; } } } diff --git a/src/desktop/version.cpp b/src/desktop/version.cpp index e03f186f670..f7fc5baaf85 100644 --- a/src/desktop/version.cpp +++ b/src/desktop/version.cpp @@ -314,8 +314,7 @@ std::string os_version() #pragma warning(disable:4996) #endif if(!GetVersionEx(reinterpret_cast(&v))) { - ERR_DU << "os_version: GetVersionEx error (" - << GetLastError() << ")\n"; + ERR_DU << "os_version: GetVersionEx error (" << GetLastError() << ')'; return base; } #ifdef _MSC_VER diff --git a/src/display.cpp b/src/display.cpp index c39485b398a..4d64191e4f0 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -85,8 +85,6 @@ static lg::log_domain log_display("display"); #define MinZoom (zoom_levels.front()) #define MaxZoom (zoom_levels.back()) -using std::endl; - namespace { // if this is enabled with :benchmark, then everything is marked as invalid and redrawn each time bool benchmark = false; @@ -787,7 +785,7 @@ surface display::screenshot(bool map_screenshot) WRN_DP << "Excessively large map screenshot area"; } LOG_DP << "creating " << area.w << " by " << area.h - << " texture for map screenshot" << std::endl; + << " texture for map screenshot"; texture output_texture(area.w, area.h, SDL_TEXTUREACCESS_TARGET); auto target_setter = draw::set_render_target(output_texture); auto clipper = draw::override_clip(area); @@ -1422,7 +1420,7 @@ void display::draw_panel(const theme::panel& panel) texture tex(image::get_texture(panel.image())); if (!tex) { ERR_DP << "failed to load panel " << panel.get_id() - << " texture: " << panel.image() << endl; + << " texture: " << panel.image(); return; } @@ -2689,7 +2687,7 @@ void display::draw_invalidated() { SDL_Rect clip_rect = get_clip_rect(); auto clipper = draw::reduce_clip(clip_rect); DBG_DP << "drawing " << invalidated_.size() << " invalidated hexes" - << " with clip " << clip_rect << endl; + << " with clip " << clip_rect; for (const map_location& loc : invalidated_) { int xpos = get_location_x(loc); int ypos = get_location_y(loc); diff --git a/src/draw.cpp b/src/draw.cpp index bba7b1e4e88..a8ef2723d53 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -29,8 +29,6 @@ static lg::log_domain log_draw("draw"); #define DBG_D LOG_STREAM(debug, log_draw) #define WRN_D LOG_STREAM(warn, log_draw) -using std::endl; - static SDL_Renderer* renderer() { return CVideo::get_singleton().get_renderer(); @@ -173,7 +171,7 @@ void draw::rect(const SDL_Rect& rect, const color_t& c) void draw::line(int from_x, int from_y, int to_x, int to_y) { DBG_D << "line from (" << from_x << ',' << from_y - << ") to (" << to_x << ',' << to_y << ')' << endl; + << ") to (" << to_x << ',' << to_y << ')'; SDL_RenderDrawLine(renderer(), from_x, from_y, to_x, to_y); } @@ -181,7 +179,7 @@ void draw::line(int from_x, int from_y, int to_x, int to_y, const color_t& c) { DBG_D << "line from (" << from_x << ',' << from_y << ") to (" << to_x << ',' << to_y - << ") with colour " << c << endl; + << ") with colour " << c; SDL_SetRenderDrawColor(renderer(), c.r, c.g, c.b, c.a); SDL_RenderDrawLine(renderer(), from_x, from_y, to_x, to_y); } @@ -207,7 +205,7 @@ void draw::circle(int cx, int cy, int r, const color_t& c, uint8_t octants) void draw::circle(int cx, int cy, int r, uint8_t octants) { DBG_D << "circle (" << cx << ',' << cy - << ") -> " << r << ", oct " << int(octants) << endl; + << ") -> " << r << ", oct " << int(octants); // Algorithm based on // http://de.wikipedia.org/wiki/Rasterung_von_Kreisen#Methode_von_Horn @@ -249,7 +247,7 @@ void draw::disc(int cx, int cy, int r, const color_t& c, uint8_t octants) void draw::disc(int cx, int cy, int r, uint8_t octants) { DBG_D << "disc (" << cx << ',' << cy - << ") -> " << r << ", oct " << int(octants) << endl; + << ") -> " << r << ", oct " << int(octants); int d = -r; int x = r; @@ -355,7 +353,7 @@ void draw::flipped( if (!tex) { DBG_D << "null flipped"; return; } DBG_D << "flipped (" << flip_h << '|' << flip_v - << ") to " << dst << " from " << src << endl; + << ") to " << dst << " from " << src; SDL_RendererFlip flip = get_flip(flip_h, flip_v); SDL_RenderCopyEx(renderer(), tex, &src, &dst, 0.0, nullptr, flip); @@ -373,7 +371,7 @@ void draw::flipped( if (!tex) { DBG_D << "null flipped"; return; } DBG_D << "flipped (" << flip_h << '|' << flip_v - << ") to " << dst << endl; + << ") to " << dst; SDL_RendererFlip flip = get_flip(flip_h, flip_v); SDL_RenderCopyEx(renderer(), tex, nullptr, &dst, 0.0, nullptr, flip); @@ -395,7 +393,7 @@ void draw::tiled(const texture& tex, const SDL_Rect& dst, bool centered, { if (!tex) { DBG_D << "null tiled"; return; } DBG_D << "tiled (" << centered << '|' << mirrored - << ") " << dst << endl; + << ") " << dst; // Reduce clip to dst. auto clipper = draw::reduce_clip(dst); @@ -423,7 +421,7 @@ void draw::tiled_highres(const texture& tex, const SDL_Rect& dst, { if (!tex) { DBG_D << "null tiled_highres"; return; } DBG_D << "tiled_highres (" << centered << '|' << mirrored - << ") " << dst << endl; + << ") " << dst; const int pixel_scale = CVideo::get_singleton().get_pixel_scale(); @@ -639,6 +637,6 @@ draw::render_target_setter::~render_target_setter() draw::render_target_setter draw::set_render_target(const texture& t) { DBG_D << "setting render target to " - << t.w() << 'x' << t.h() << " texture" << endl; + << t.w() << 'x' << t.h() << " texture"; return draw::render_target_setter(t); } diff --git a/src/draw_manager.cpp b/src/draw_manager.cpp index c210d22b457..ed3a4c5cb92 100644 --- a/src/draw_manager.cpp +++ b/src/draw_manager.cpp @@ -33,7 +33,6 @@ static lg::log_domain log_draw_man("draw/manager"); #define LOG_DM LOG_STREAM(info, log_draw_man) #define DBG_DM LOG_STREAM(debug, log_draw_man) -using std::endl; using gui2::top_level_drawable; namespace { @@ -55,7 +54,7 @@ void invalidate_region(const rect& region) { if (drawing_) { ERR_DM << "Attempted to invalidate region " << region - << " during draw" << endl; + << " during draw"; throw game::error("invalidate during draw"); } @@ -74,7 +73,7 @@ void invalidate_region(const rect& region) // This region contains a previously invalidated region, // might as well supercede it with this. DBG_DM << "superceding previous invalidation " << r - << " with " << region << endl; + << " with " << region; //STREAMING_LOG << '\''; r = region; return; @@ -85,7 +84,7 @@ void invalidate_region(const rect& region) // This won't always be the best, // but it also won't ever be the worst. DBG_DM << "merging " << region << " with " << r - << " to invalidate " << m << endl; + << " to invalidate " << m; //STREAMING_LOG << ':'; r = m; return; @@ -95,7 +94,7 @@ void invalidate_region(const rect& region) cumulative_area += r.area(); if (progressive_cover.area() <= cumulative_area) { DBG_DM << "conglomerating invalidations to " - << progressive_cover << endl; + << progressive_cover; //STREAMING_LOG << '%'; // replace the first one, so we can easily prune later invalidated_regions_[0] = progressive_cover; diff --git a/src/editor/map/context_manager.cpp b/src/editor/map/context_manager.cpp index 30458fef1f6..74a27b7bcf3 100644 --- a/src/editor/map/context_manager.cpp +++ b/src/editor/map/context_manager.cpp @@ -692,7 +692,7 @@ void context_manager::init_map_generators(const game_config_view& game_config) map_generators_.emplace_back(create_map_generator(i["map_generation"].empty() ? i["scenario_generation"] : i["map_generation"], generator_cfg.value())); } else { ERR_ED << "Scenario \"" << i["name"] << "\" with id " << i["id"] - << " has map_generation= but no [generator] tag" << std::endl; + << " has map_generation= but no [generator] tag"; } } } @@ -916,7 +916,7 @@ void context_manager::load_map(const std::string& filename, bool new_context) if(get_map_context().get_map_data_key().empty()) { ERR_ED << "Internal error, map context filename changed: " << filename << " -> " << get_map_context().get_filename() - << " with no apparent scenario load\n"; + << " with no apparent scenario load"; } else { utils::string_map symbols; symbols["old"] = filename; diff --git a/src/editor/map/map_context.cpp b/src/editor/map/map_context.cpp index 94243d160a3..bcc6e9273b6 100644 --- a/src/editor/map/map_context.cpp +++ b/src/editor/map/map_context.cpp @@ -685,7 +685,7 @@ void map_context::set_map(const editor_map& map) void map_context::perform_action(const editor_action& action) { LOG_ED << "Performing action " << action.get_id() << ": " << action.get_name() << ", actions count is " - << action.get_instance_count() << std::endl; + << action.get_instance_count(); auto undo = action.perform(*this); if(actions_since_save_ < 0) { // set to a value that will make it impossible to get to zero, as at this point @@ -705,7 +705,7 @@ void map_context::perform_action(const editor_action& action) void map_context::perform_partial_action(const editor_action& action) { LOG_ED << "Performing (partial) action " << action.get_id() << ": " << action.get_name() << ", actions count is " - << action.get_instance_count() << std::endl; + << action.get_instance_count(); if(!can_undo()) { throw editor_logic_exception("Empty undo stack in perform_partial_action()"); } diff --git a/src/editor/palette/terrain_palettes.cpp b/src/editor/palette/terrain_palettes.cpp index 1cf170bbc06..03048432a01 100644 --- a/src/editor/palette/terrain_palettes.cpp +++ b/src/editor/palette/terrain_palettes.cpp @@ -118,7 +118,7 @@ void terrain_palette::setup(const game_config_view& cfg) DBG_ED << "Palette: processing terrain " << t_info.name() << "(editor name: '" << t_info.editor_name() << "') " << "(" << t_info.number() << ")" - << ": " << t_info.editor_group() << "\n"; + << ": " << t_info.editor_group(); // don't display terrains that were automatically created from base+overlay if (t_info.is_combined()) continue; diff --git a/src/editor/toolkit/editor_toolkit.cpp b/src/editor/toolkit/editor_toolkit.cpp index b45da7667b0..3747179bd1c 100644 --- a/src/editor/toolkit/editor_toolkit.cpp +++ b/src/editor/toolkit/editor_toolkit.cpp @@ -112,7 +112,7 @@ void editor_toolkit::hotkey_set_mouse_action(hotkey::HOTKEY_COMMAND command) palette_manager_->active_palette().hide(false); } else { ERR_ED << "Invalid hotkey command (" - << static_cast(command) << ") passed to set_mouse_action\n"; + << static_cast(command) << ") passed to set_mouse_action"; } } diff --git a/src/filesystem.cpp b/src/filesystem.cpp index bbc4f59cb61..217faec8617 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -407,8 +407,7 @@ void get_files_in_dir(const std::string& dir, if(checksum != nullptr) { std::time_t mtime = bfs::last_write_time(di->path(), ec); if(ec) { - LOG_FS << "Failed to read modification time of " << di->path().string() << ": " << ec.message() - << '\n'; + LOG_FS << "Failed to read modification time of " << di->path().string() << ": " << ec.message(); } else if(mtime > checksum->modified) { checksum->modified = mtime; } @@ -440,7 +439,7 @@ void get_files_in_dir(const std::string& dir, LOG_FS << "Failed to get file status of " << inner_main.string() << ": " << ec.message(); } else if(reorder == reorder_mode::DO_REORDER && main_st.type() == bfs::regular_file) { LOG_FS << "_main.cfg found : " - << (mode == name_mode::ENTIRE_FILE_PATH ? inner_main.string() : inner_main.filename().string()) << '\n'; + << (mode == name_mode::ENTIRE_FILE_PATH ? inner_main.string() : inner_main.filename().string()); push_if_exists(files, inner_main, mode == name_mode::ENTIRE_FILE_PATH); } else { push_if_exists(dirs, di->path(), mode == name_mode::ENTIRE_FILE_PATH); @@ -649,7 +648,7 @@ void set_user_data_dir(std::string newprefdir) // ERR_FS << "Could not determine path to user's Documents folder! (" << std::hex << "0x" << res << std::dec << ") " << "User config/data directories may be unavailable for " - << "this session. Please report this as a bug.\n"; + << "this session. Please report this as a bug."; user_data_dir = bfs::path(get_cwd()) / newprefdir; } else { bfs::path games_path = bfs::path(docs_path) / "My Games"; @@ -1367,7 +1366,7 @@ static bool is_legal_file(const std::string& filename_str) if(filename_str.find('\\') != std::string::npos) { ERR_FS << "Illegal path '" << filename_str - << R"end(' ("\" not allowed, for compatibility with GNU/Linux and macOS).)end" << std::endl; + << R"end(' ("\" not allowed, for compatibility with GNU/Linux and macOS).)end"; return false; } @@ -1459,7 +1458,7 @@ std::string get_binary_file_location(const std::string& type, const std::string& result = bpath.string(); } else { WRN_FS << "Conflicting files in binary_path: '" << result - << "' and '" << bpath.string() << "'\n"; + << "' and '" << bpath.string() << "'"; } } } diff --git a/src/filesystem_common.cpp b/src/filesystem_common.cpp index a9004434ce0..b4b7b78714c 100644 --- a/src/filesystem_common.cpp +++ b/src/filesystem_common.cpp @@ -262,7 +262,7 @@ const file_tree_checksum& data_tree_checksum(bool reset) get_file_tree_checksum_internal(get_user_data_dir() + "/data/",checksum); LOG_FS << "calculated data tree checksum: " << checksum.nfiles << " files; " - << checksum.sum_size << " bytes" << std::endl; + << checksum.sum_size << " bytes"; } return checksum; diff --git a/src/floating_label.cpp b/src/floating_label.cpp index b3e503bd840..1df206b2ffa 100644 --- a/src/floating_label.cpp +++ b/src/floating_label.cpp @@ -36,8 +36,6 @@ static lg::log_domain log_font("font"); static lg::log_domain log_display("display"); #define ERR_DP LOG_STREAM(err, log_display) -using std::endl; - namespace { typedef std::map label_map; @@ -217,7 +215,7 @@ void floating_label::update(int time) draw_manager::invalidate_region(draw_loc); DBG_FT << "updating floating label from " << screen_loc_ - << " to " << draw_loc << std::endl; + << " to " << draw_loc; screen_loc_ = draw_loc; alpha_ = new_alpha; diff --git a/src/font/font_config.cpp b/src/font/font_config.cpp index eb74acb11e5..6d249fd25e0 100644 --- a/src/font/font_config.cpp +++ b/src/font/font_config.cpp @@ -99,8 +99,7 @@ bool load_font_config() filesystem::scoped_istream stream = preprocess_file(cfg_path); read(cfg, *stream); } catch(const config::error &e) { - ERR_FT << "could not read fonts.cfg:\n" - << e.message << '\n'; + ERR_FT << "could not read fonts.cfg:\n" << e.message; return false; } diff --git a/src/font/text.cpp b/src/font/text.cpp index a7ec4b19bb1..9579ddc85f2 100644 --- a/src/font/text.cpp +++ b/src/font/text.cpp @@ -341,7 +341,7 @@ bool pango_text::set_text(const std::string& text, const bool markedup) if(text != narrow) { ERR_GUI_L << "pango_text::" << __func__ << " text '" << text - << "' contains invalid utf-8, trimmed the invalid parts.\n"; + << "' contains invalid utf-8, trimmed the invalid parts."; } if(markedup) { if(!this->set_markup(narrow, *layout_)) { @@ -634,7 +634,7 @@ PangoRectangle pango_text::calculate_size(PangoLayout& layout) const << " text '" << gui2::debug_truncate(text_) << "' maximum_width " << maximum_width << " width " << size.x + size.width - << ".\n"; + << "."; DBG_GUI_L << "pango_text::" << __func__ << " text '" << gui2::debug_truncate(text_) @@ -644,14 +644,14 @@ PangoRectangle pango_text::calculate_size(PangoLayout& layout) const << " maximum_width " << maximum_width << " maximum_height " << maximum_height_ << " result " << size - << ".\n"; + << "."; if(maximum_width != -1 && size.x + size.width > maximum_width) { DBG_GUI_L << "pango_text::" << __func__ << " text '" << gui2::debug_truncate(text_) << " ' width " << size.x + size.width << " greater as the wanted maximum of " << maximum_width - << ".\n"; + << "."; } // The maximum height is handled here instead of using the library - see the comments in set_maximum_height() @@ -660,7 +660,7 @@ PangoRectangle pango_text::calculate_size(PangoLayout& layout) const << " text '" << gui2::debug_truncate(text_) << " ' height " << size.y + size.height << " greater as the wanted maximum of " << maximum_height_ - << ".\n"; + << "."; size.height = maximum_height_ - std::max(0, size.y); } @@ -855,7 +855,7 @@ bool pango_text::set_markup(std::string_view text, PangoLayout& layout) } else { ERR_GUI_L << "pango_text::" << __func__ << " text '" << text - << "' has broken markup, set to normal text.\n"; + << "' has broken markup, set to normal text."; set_text(_("The text contains invalid Pango markup: ") + std::string(text), false); } @@ -937,7 +937,7 @@ bool pango_text::validate_markup(std::string_view text, char** raw_text, std::st /* Replacement worked, still warn the user about the error. */ WRN_GUI_L << "pango_text::" << __func__ << " text '" << text - << "' has unescaped ampersands '&', escaped them.\n"; + << "' has unescaped ampersands '&', escaped them."; return true; } diff --git a/src/formula/string_utils.cpp b/src/formula/string_utils.cpp index ea4b985736f..cac44a99fdd 100644 --- a/src/formula/string_utils.cpp +++ b/src/formula/string_utils.cpp @@ -131,7 +131,7 @@ static std::string do_interpolation(const std::string &str, const variable_set& if(paren_nesting_level > 0) { ERR_NG << "Formula in WML string cannot be evaluated due to " << "a missing closing parenthesis:\n\t--> \"" - << std::string(var_begin, var_end) << "\"\n"; + << std::string(var_begin, var_end) << "\""; res.replace(var_begin, var_end, ""); continue; } diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index ebd9ddb25a1..c257d084220 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -487,8 +487,8 @@ WML_HANDLER_FUNCTION(recall,, cfg) const std::string player_id = resources::gameboard->teams()[index].save_id_or_number(); if(resources::gameboard->teams()[index].recall_list().size() < 1) { - DBG_NG << "recall list is empty when trying to recall!\n" - << "player_id: " << player_id << " side: " << index+1 << "\n"; + DBG_NG << "recall list is empty when trying to recall!"; + DBG_NG << "player_id: " << player_id << " side: " << index+1; continue; } @@ -856,7 +856,7 @@ WML_HANDLER_FUNCTION(tunnel,, cfg) cfg.get_children("target").empty() || cfg.get_children("filter").empty()) { ERR_WML << "[tunnel] is missing a mandatory tag:\n" - << cfg.get_config().debug(); + << cfg.get_config().debug(); } else { pathfind::teleport_group tunnel(delay ? cfg : vconfig(cfg.get_parsed_config()), false); resources::tunnels->add(tunnel); diff --git a/src/game_events/menu_item.cpp b/src/game_events/menu_item.cpp index 242e42e13b5..22833e249c9 100644 --- a/src/game_events/menu_item.cpp +++ b/src/game_events/menu_item.cpp @@ -242,8 +242,8 @@ void wml_menu_item::to_config(config& cfg) const } if(!use_hotkey_ && !use_wml_menu_) { - ERR_NG << "Bad data: wml_menu_item with both use_wml_menu and use_hotkey set to false is not supposed to be " - "possible."; + ERR_NG << "Bad data: wml_menu_item with both use_wml_menu and " + "use_hotkey set to false is not supposed to be possible."; cfg["use_hotkey"] = false; } diff --git a/src/game_events/pump.cpp b/src/game_events/pump.cpp index 7cc592d4682..b8c7cc60a89 100644 --- a/src/game_events/pump.cpp +++ b/src/game_events/pump.cpp @@ -444,7 +444,8 @@ pump_result_t wml_event_pump::operator()() if(impl_->instance_count >= game_config::max_loop) { ERR_NG << "game_events pump waiting to process new events because " - << "recursion level would exceed maximum: " << game_config::max_loop << '\n'; + << "recursion level would exceed maximum: " + << game_config::max_loop; return pump_result_t(); } diff --git a/src/game_initialization/connect_engine.cpp b/src/game_initialization/connect_engine.cpp index c19c010544e..7cbf802a722 100644 --- a/src/game_initialization/connect_engine.cpp +++ b/src/game_initialization/connect_engine.cpp @@ -341,7 +341,7 @@ bool connect_engine::can_start_game() const if(!side->ready_for_start()) { const int side_num = side->index() + 1; DBG_MP << "not all sides are ready, side " << - side_num << " not ready\n"; + side_num << " not ready"; return false; } @@ -527,8 +527,7 @@ void connect_engine::start_game_commandline(const commandline_options& cmdline_o // Update sides with commandline parameters. if(cmdline_opts.multiplayer_turns) { - DBG_MP << "\tsetting turns: " << *cmdline_opts.multiplayer_turns << - std::endl; + DBG_MP << "\tsetting turns: " << *cmdline_opts.multiplayer_turns; scenario()["turns"] = *cmdline_opts.multiplayer_turns; } @@ -666,7 +665,7 @@ std::pair connect_engine::process_network_data(const config& data) update_and_send_diff(); ERR_CF << "ERROR: Couldn't assign a side to '" << - name << "'\n"; + name << "'"; return result; } @@ -1206,7 +1205,7 @@ void side_engine::resolve_random(randomness::mt_rng & rng, const std::vector$addon is incompatible. They have version $host_ver while you have version $local_ver.", { diff --git a/src/generators/default_map_generator_job.cpp b/src/generators/default_map_generator_job.cpp index 663f674e93e..3203081e46c 100644 --- a/src/generators/default_map_generator_job.cpp +++ b/src/generators/default_map_generator_job.cpp @@ -364,7 +364,7 @@ height_map default_map_generator_job::generate_height_map(size_t width, size_t h LOG_NG << "generate_height_map" << " lowest=" << lowest - << " highest =" << highest << " \n"; + << " highest =" << highest; // Normalize the heights to the range 0-1000: highest -= lowest; for(x = 0; std::size_t(x) != res.size(); ++x) { @@ -701,7 +701,7 @@ std::string default_map_generator_job::default_generate_map(generator_data data, << " island_off_center=" << data.island_off_center << " max_lakes=" << data.max_lakes << " link_castles=" << data.link_castles - << " show_labels=" << data.show_labels << "\n"; + << " show_labels=" << data.show_labels; // Odd widths are nasty VALIDATE(is_even(data.width), _("Random maps with an odd width aren't supported.")); diff --git a/src/gettext.cpp b/src/gettext.cpp index 612b59c7f90..af3fe01b1c0 100644 --- a/src/gettext.cpp +++ b/src/gettext.cpp @@ -145,7 +145,7 @@ namespace static void log_po_error(const std::string& lang, const std::string& dom, const std::string& detail) { ERR_G << "Error opening language file for " << lang << ", textdomain " << dom - << ":\n " << detail << '\n' << std::flush; + << ":\n " << detail; } const char* get(int domain_id, const char* ctx, const char* msg_id) const override @@ -245,7 +245,7 @@ namespace // so we can't possibly support that, and odds are it's a user // mistake (as in bug #23839). ERR_G << "illegal textdomain name '" << domain - << "', skipping textdomain\n"; + << "', skipping textdomain"; return; } @@ -318,7 +318,7 @@ namespace << "' country='" << info.country() << "' language='" << info.language() << "' encoding='" << info.encoding() - << "' variant='" << info.variant() << "')\n"; + << "' variant='" << info.variant() << "')"; } catch(const bl::conv::conversion_error&) { @@ -330,7 +330,7 @@ namespace << "' language='" << info.language() << "' encoding='" << info.encoding() << "' variant='" << info.variant() - << "'" << std::endl; + << "'"; } catch(const std::runtime_error&) { @@ -342,7 +342,7 @@ namespace << "' language='" << info.language() << "' encoding='" << info.encoding() << "' variant='" << info.variant() - << "'" << std::endl; + << "'"; } is_dirty_ = false; } diff --git a/src/gui/auxiliary/iterator/policy_order.hpp b/src/gui/auxiliary/iterator/policy_order.hpp index 1d4b301469d..6afa36d5c12 100644 --- a/src/gui/auxiliary/iterator/policy_order.hpp +++ b/src/gui/auxiliary/iterator/policy_order.hpp @@ -63,8 +63,7 @@ public: bool next() { if(at_end()) { - ERR_GUI_I << "Tried to move beyond end of the iteration range." - << std::endl; + ERR_GUI_I << "Tried to move beyond end of the iteration range."; throw range_error("Tried to move beyond end of range."); } @@ -83,7 +82,7 @@ public: case walker_base::fail: TST_GUI_I << "\n"; ERR_GUI_E << "Tried to move beyond end of " - "the widget iteration range.\n"; + "the widget iteration range."; throw range_error("Tried to move beyond end of range."); } } else { @@ -103,7 +102,7 @@ public: case walker_base::fail: TST_GUI_I << "\n"; ERR_GUI_E << "Tried to move beyond end of " - "the grid iteration range.\n"; + "the grid iteration range."; throw range_error("Tried to move beyond end of range."); } } else { @@ -135,7 +134,7 @@ public: case walker_base::fail: TST_GUI_I << "\n"; ERR_GUI_E << "Tried to move beyond end of " - "the child iteration range.\n"; + "the child iteration range."; throw range_error("Tried to move beyond end of range."); } } else { @@ -154,7 +153,7 @@ public: { if(at_end()) { ERR_GUI_I << "Tried to defer beyond end its " - "iteration range iterator.\n"; + "iteration range iterator."; throw logic_error("Tried to defer an invalid iterator."); } if(!visit_widget::at_end(*root_)) { @@ -167,7 +166,7 @@ public: return *visit_child::get(*root_); } ERR_GUI_I << "The iterator ended in an unknown " - "state while deferring itself.\n"; + "state while deferring itself."; throw logic_error("Tried to defer an invalid iterator."); } @@ -205,8 +204,7 @@ public: bool next() { if(at_end()) { - ERR_GUI_I << "Tried to move beyond end of the iteration range." - << std::endl; + ERR_GUI_I << "Tried to move beyond end of the iteration range."; throw range_error("Tried to move beyond end of range."); } @@ -225,7 +223,7 @@ public: case walker_base::fail: TST_GUI_I << "\n"; ERR_GUI_E << "Tried to move beyond end of the " - "widget iteration range.\n"; + "widget iteration range."; throw range_error("Tried to move beyond end of range."); } } else { @@ -245,7 +243,7 @@ public: case walker_base::fail: TST_GUI_I << "\n"; ERR_GUI_E << "Tried to move beyond end of the grid " - "iteration range.\n"; + "iteration range."; throw range_error("Tried to move beyond end of range."); } } else { @@ -279,7 +277,7 @@ public: { if(at_end()) { ERR_GUI_I << "Tried to defer beyond end of the iteration " - "range iterator.\n"; + "range iterator."; throw logic_error("Tried to defer an invalid iterator."); } if(!visit_widget::at_end(*root_)) { @@ -292,7 +290,7 @@ public: return *visit_child::get(*root_); } ERR_GUI_I << "The iterator ended in an unknown " - "state while deferring iteself.\n"; + "state while deferring iteself."; throw logic_error("Tried to defer an invalid iterator."); } diff --git a/src/gui/core/canvas.cpp b/src/gui/core/canvas.cpp index 93856c36737..94cb643e4d0 100644 --- a/src/gui/core/canvas.cpp +++ b/src/gui/core/canvas.cpp @@ -126,7 +126,7 @@ void rectangle_shape::draw(wfl::map_formula_callable& variables) // Draw the border draw::set_color(border_color); DBG_GUI_D << "border thickness " << border_thickness_ - << ", colour " << border_color << std::endl; + << ", colour " << border_color; for(int i = 0; i < border_thickness_; ++i) { const SDL_Rect dimensions { x + i, @@ -555,13 +555,13 @@ void canvas::parse_cfg(const config& cfg) blur_depth_ = function.cfg["depth"]; } else { ERR_GUI_P << "Canvas: found a pre commit function" - << " of an invalid type " << type << ".\n"; + << " of an invalid type " << type << "."; } } } else { ERR_GUI_P << "Canvas: found a shape of an invalid type " << type - << ".\n"; + << "."; assert(false); } diff --git a/src/gui/core/event/distributor.cpp b/src/gui/core/event/distributor.cpp index 354c4476dc8..71e1614a7c8 100644 --- a/src/gui/core/event/distributor.cpp +++ b/src/gui/core/event/distributor.cpp @@ -329,7 +329,7 @@ void mouse_motion::start_hover_timer(widget* widget, const point& coordinate) } DBG_GUI_E << LOG_HEADER << "Start hover timer for widget '" << widget->id() - << "' at address " << widget << ".\n"; + << "' at address " << widget << "."; hover_timer_ = add_timer(50, std::bind(&mouse_motion::show_tooltip, this)); @@ -347,7 +347,7 @@ void mouse_motion::stop_hover_timer() assert(hover_widget_); DBG_GUI_E << LOG_HEADER << "Stop hover timer for widget '" << hover_widget_->id() << "' at address " << hover_widget_ - << ".\n"; + << "."; if(!remove_timer(hover_timer_)) { ERR_GUI_E << LOG_HEADER << "Failed to remove hover timer."; @@ -480,7 +480,7 @@ void mouse_button::signal_handler_sdl_button_down( if(mouse_over != mouse_focus_) { #ifdef GUI2_SHOW_UNHANDLED_EVENT_WARNINGS WRN_GUI_E << LOG_HEADER << ". Mouse down on non focused widget " - << "and mouse not captured, we missed events.\n"; + << "and mouse not captured, we missed events."; #endif mouse_focus_ = mouse_over; } diff --git a/src/gui/core/event/handler.cpp b/src/gui/core/event/handler.cpp index 7f9dd9c89af..8c02167d530 100644 --- a/src/gui/core/event/handler.cpp +++ b/src/gui/core/event/handler.cpp @@ -522,7 +522,7 @@ void sdl_event_handler::handle_event(const SDL_Event& event) default: #ifdef GUI2_SHOW_UNHANDLED_EVENT_WARNINGS WRN_GUI_E << "Unhandled event " << static_cast(event.type) - << ".\n"; + << "."; #endif break; } @@ -670,7 +670,7 @@ void sdl_event_handler::mouse_button_up(const point& position, const uint8_t but default: #ifdef GUI2_SHOW_UNHANDLED_EVENT_WARNINGS WRN_GUI_E << "Unhandled 'mouse button up' event for button " - << static_cast(button) << ".\n"; + << static_cast(button) << "."; #endif break; } @@ -691,7 +691,7 @@ void sdl_event_handler::mouse_button_down(const point& position, const uint8_t b default: #ifdef GUI2_SHOW_UNHANDLED_EVENT_WARNINGS WRN_GUI_E << "Unhandled 'mouse button down' event for button " - << static_cast(button) << ".\n"; + << static_cast(button) << "."; #endif break; } diff --git a/src/gui/core/gui_definition.cpp b/src/gui/core/gui_definition.cpp index 2a9a8b7a14b..3c6704317b1 100644 --- a/src/gui/core/gui_definition.cpp +++ b/src/gui/core/gui_definition.cpp @@ -230,7 +230,7 @@ resolution_definition_ptr get_control(const std::string& control_type, const std if(!found_fallback) { if(definition != "default") { LOG_GUI_G << "Control: type '" << control_type << "' definition '" << definition - << "' not found, falling back to 'default'.\n"; + << "' not found, falling back to 'default'."; return get_control(control_type, "default"); } diff --git a/src/gui/core/widget_definition.cpp b/src/gui/core/widget_definition.cpp index 926cfb6beda..0deb482b6ba 100644 --- a/src/gui/core/widget_definition.cpp +++ b/src/gui/core/widget_definition.cpp @@ -48,8 +48,7 @@ resolution_definition::resolution_definition(const config& cfg) , text_font_style(decode_font_style(cfg["text_font_style"])) , state() { - DBG_GUI_P << "Parsing resolution " << window_width << ", " << window_height - << '\n'; + DBG_GUI_P << "Parsing resolution " << window_width << ", " << window_height; linked_groups = parse_linked_group_definitions(cfg); } diff --git a/src/gui/core/window_builder/helper.cpp b/src/gui/core/window_builder/helper.cpp index fb971b30dd2..14bc5b7d5ce 100644 --- a/src/gui/core/window_builder/helper.cpp +++ b/src/gui/core/window_builder/helper.cpp @@ -44,7 +44,7 @@ unsigned get_v_align(const std::string& v_align) } else { if(!v_align.empty() && v_align != "center") { ERR_GUI_E << "Invalid vertical alignment '" << v_align - << "' falling back to 'center'.\n"; + << "' falling back to 'center'."; } return grid::VERTICAL_ALIGN_CENTER; } @@ -59,7 +59,7 @@ unsigned get_h_align(const std::string& h_align) } else { if(!h_align.empty() && h_align != "center") { ERR_GUI_E << "Invalid horizontal alignment '" << h_align - << "' falling back to 'center'.\n"; + << "' falling back to 'center'."; } return grid::HORIZONTAL_ALIGN_CENTER; } @@ -98,7 +98,7 @@ unsigned read_flags(const config& cfg) if(!(cfg["vertical_alignment"]).empty()) { ERR_GUI_P << "vertical_grow and vertical_alignment " - "can't be combined, alignment is ignored.\n"; + "can't be combined, alignment is ignored."; } } else { flags |= v_flags; @@ -109,7 +109,7 @@ unsigned read_flags(const config& cfg) if(!(cfg["horizontal_alignment"]).empty()) { ERR_GUI_P << "horizontal_grow and horizontal_alignment " - "can't be combined, alignment is ignored.\n"; + "can't be combined, alignment is ignored."; } } else { flags |= h_flags; @@ -126,7 +126,7 @@ scrollbar_mode get_scrollbar_mode(const std::string& scrollbar_mode) if(scrollbar_mode_map.find(scrollbar_mode) == scrollbar_mode_map.end()) { ERR_GUI_E << "Invalid scrollbar mode '" << scrollbar_mode << "'." - << "Falling back to 'initial_auto'." << std::endl; + << "Falling back to 'initial_auto'."; return scrollbar_container::AUTO_VISIBLE_FIRST_RUN; } @@ -144,7 +144,7 @@ int get_retval(const std::string& retval_id, return result; } else { ERR_GUI_E << "Window builder: retval_id '" << retval_id - << "' is unknown.\n"; + << "' is unknown."; } } diff --git a/src/gui/dialogs/chat_log.cpp b/src/gui/dialogs/chat_log.cpp index c1533f68cf9..1ff6eb21317 100644 --- a/src/gui/dialogs/chat_log.cpp +++ b/src/gui/dialogs/chat_log.cpp @@ -213,8 +213,7 @@ public: void next_page() { - LOG_CHAT_LOG << "Entering chat_log::controller::next_page" - << std::endl; + LOG_CHAT_LOG << "Entering chat_log::controller::next_page"; if(model_.page >= model_.count_of_pages() - 1) { return; } @@ -226,16 +225,14 @@ public: void previous_page() { - LOG_CHAT_LOG << "Entering chat_log::controller::previous_page" - << std::endl; + LOG_CHAT_LOG << "Entering chat_log::controller::previous_page"; if(model_.page == 0) { return; } model_.page--; LOG_CHAT_LOG << "Set page to " << model_.page + 1; update_view_from_model(); - LOG_CHAT_LOG << "Exiting chat_log::controller::previous_page" - << std::endl; + LOG_CHAT_LOG << "Exiting chat_log::controller::previous_page"; } void filter() @@ -248,14 +245,12 @@ public: void handle_page_number_changed() { LOG_CHAT_LOG - << "Entering chat_log::controller::handle_page_number_changed" - << std::endl; + << "Entering chat_log::controller::handle_page_number_changed"; model_.page = model_.page_number->get_value() - 1; LOG_CHAT_LOG << "Set page to " << model_.page + 1; update_view_from_model(); LOG_CHAT_LOG - << "Exiting chat_log::controller::handle_page_number_changed" - << std::endl; + << "Exiting chat_log::controller::handle_page_number_changed"; } std::pair calculate_log_line_range() @@ -266,8 +261,7 @@ public: const int page = model_.page; const int count_of_pages = std::max(1, model_.count_of_pages()); - LOG_CHAT_LOG << "Page: " << page + 1 << " of " << count_of_pages - << '\n'; + LOG_CHAT_LOG << "Page: " << page + 1 << " of " << count_of_pages; const int first = page * page_size; const int last = page < (count_of_pages - 1) @@ -281,8 +275,8 @@ public: void update_view_from_model(bool select_last_page = false) { - LOG_CHAT_LOG << "Entering chat_log::controller::update_view_from_model" - << std::endl; + LOG_CHAT_LOG + << "Entering chat_log::controller::update_view_from_model"; model_.msg_label->set_use_markup(true); int size = model_.chat_log_history.size(); LOG_CHAT_LOG << "Number of chat messages: " << size; @@ -305,16 +299,16 @@ public: model_.populate_chat_message_list(first, last); model_.page_number->set_value_range(1, count_of_pages); model_.page_number->set_active(count_of_pages > 1); - LOG_CHAT_LOG << "Maximum value of page number slider: " - << count_of_pages << std::endl; + LOG_CHAT_LOG + << "Maximum value of page number slider: " << count_of_pages; model_.page_number->set_value(page + 1); std::ostringstream cur_page_text; cur_page_text << (page + 1) << '/' << std::max(1, count_of_pages); model_.page_label->set_label(cur_page_text.str()); - LOG_CHAT_LOG << "Exiting chat_log::controller::update_view_from_model" - << std::endl; + LOG_CHAT_LOG + << "Exiting chat_log::controller::update_view_from_model"; } void handle_copy_button_clicked() diff --git a/src/gui/dialogs/multiplayer/lobby.cpp b/src/gui/dialogs/multiplayer/lobby.cpp index 9317b940201..129eb7734b5 100644 --- a/src/gui/dialogs/multiplayer/lobby.cpp +++ b/src/gui/dialogs/multiplayer/lobby.cpp @@ -287,7 +287,7 @@ void mp_lobby::update_gamelist_diff() if(list_i != gamelistbox_->get_item_count()) { gamelistbox_->add_row(make_game_row_data(game), list_i); DBG_LB << "Added a game listbox row not at the end" << list_i - << " " << gamelistbox_->get_item_count() << "\n"; + << " " << gamelistbox_->get_item_count(); list_rows_deleted--; } else { gamelistbox_->add_row(make_game_row_data(game)); @@ -309,7 +309,7 @@ void mp_lobby::update_gamelist_diff() ERR_LB << "gamelist_id_at_row_ overflow! " << list_i << " + " << list_rows_deleted << " >= " << gamelist_id_at_row_.size() - << " -- triggering a full refresh\n"; + << " -- triggering a full refresh"; refresh_lobby(); return; } @@ -317,7 +317,7 @@ void mp_lobby::update_gamelist_diff() int listbox_game_id = gamelist_id_at_row_[list_i + list_rows_deleted]; if(game.id != listbox_game_id) { ERR_LB << "Listbox game id does not match expected id " - << listbox_game_id << " " << game.id << " (row " << list_i << ")\n"; + << listbox_game_id << " " << game.id << " (row " << list_i << ")"; refresh_lobby(); return; } @@ -331,7 +331,7 @@ void mp_lobby::update_gamelist_diff() next_gamelist_id_at_row.push_back(game.id); } else if(game.display_status == mp::game_info::disp_status::DELETED) { LOG_LB << "Deleting game from listbox " << game.id << " (row " - << list_i << ")\n"; + << list_i << ")"; gamelistbox_->remove_row(list_i); ++list_rows_deleted; } else { @@ -352,7 +352,7 @@ void mp_lobby::update_gamelist_diff() next_gamelist_id_at_row.swap(gamelist_id_at_row_); if(select_row >= static_cast(gamelistbox_->get_item_count())) { ERR_LB << "Would select a row beyond the listbox" << select_row << " " - << gamelistbox_->get_item_count() << "\n"; + << gamelistbox_->get_item_count(); select_row = gamelistbox_->get_item_count() - 1; } @@ -519,7 +519,7 @@ void mp_lobby::update_gamelist_filter() DBG_LB << "mp_lobby::update_gamelist_filter"; lobby_info_.apply_game_filter(); DBG_LB << "Games in lobby_info: " << lobby_info_.games().size() - << ", games in listbox: " << gamelistbox_->get_item_count() << "\n"; + << ", games in listbox: " << gamelistbox_->get_item_count(); assert(lobby_info_.games().size() == gamelistbox_->get_item_count()); update_visible_games(); @@ -877,7 +877,7 @@ void mp_lobby::enter_game_by_index(const int index, JOIN_MODE mode) } catch(const std::out_of_range&) { // Game index was invalid! ERR_LB << "Attempted to join/observe a game with index out of range: " << index << ". " - << "Games vector size is " << lobby_info_.games().size() << std::endl; + << "Games vector size is " << lobby_info_.games().size(); } } diff --git a/src/gui/dialogs/multiplayer/mp_change_control.cpp b/src/gui/dialogs/multiplayer/mp_change_control.cpp index 990c5c840fb..44081c82156 100644 --- a/src/gui/dialogs/multiplayer/mp_change_control.cpp +++ b/src/gui/dialogs/multiplayer/mp_change_control.cpp @@ -169,7 +169,7 @@ void mp_change_control::post_show(window& window) if(window.get_retval() == retval::OK) { DBG_GUI << "Main: changing control of side " << sides_[selected_side_] << " to nick " - << nicks_[selected_nick_] << std::endl; + << nicks_[selected_nick_]; menu_handler_.request_control_change( sides_[selected_side_], diff --git a/src/gui/dialogs/tooltip.cpp b/src/gui/dialogs/tooltip.cpp index eaba8369b7c..afc847d4eb6 100644 --- a/src/gui/dialogs/tooltip.cpp +++ b/src/gui/dialogs/tooltip.cpp @@ -158,7 +158,7 @@ void show(const std::string& window_id, catch(const window_builder_invalid_id&) { ERR_CFG << "Tip with the requested id '" << window_id - << "' doesn't exist, fall back to the default.\n"; + << "' doesn't exist, fall back to the default."; t.set_window_id("tooltip_large"); try { @@ -166,8 +166,7 @@ void show(const std::string& window_id, } catch(const window_builder_invalid_id&) { - ERR_CFG << "Default tooltip doesn't exist, no message shown." - << std::endl; + ERR_CFG << "Default tooltip doesn't exist, no message shown."; } } } diff --git a/src/gui/dialogs/unit_create.cpp b/src/gui/dialogs/unit_create.cpp index 6e0f93cada6..fba7701e6fc 100644 --- a/src/gui/dialogs/unit_create.cpp +++ b/src/gui/dialogs/unit_create.cpp @@ -146,7 +146,7 @@ void unit_create::post_show(window& window) } else if(static_cast(selected_row) >= units_.size()) { // FIXME: maybe assert? ERR_GUI_G << "unit create dialog has more list items than known unit " - "types; not good\n"; + "types; not good"; return; } diff --git a/src/gui/widgets/addon_list.cpp b/src/gui/widgets/addon_list.cpp index d3c29f37e75..eef77ecefb1 100644 --- a/src/gui/widgets/addon_list.cpp +++ b/src/gui/widgets/addon_list.cpp @@ -468,7 +468,7 @@ std::unique_ptr builder_addon_list::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed add-on list '" << id << - "' with definition '" << definition << "'.\n"; + "' with definition '" << definition << "'."; const auto conf = widget->cast_config_to(); assert(conf != nullptr); diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index f046250c092..5e6a2451efd 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -184,7 +184,7 @@ std::unique_ptr builder_button::build() const widget->set_retval(get_retval(retval_id_, retval_, id)); DBG_GUI_G << "Window builder: placed button '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/chatbox.cpp b/src/gui/widgets/chatbox.cpp index 60ec13b82f1..f021842c858 100644 --- a/src/gui/widgets/chatbox.cpp +++ b/src/gui/widgets/chatbox.cpp @@ -579,7 +579,7 @@ void chatbox::process_message(const ::config& data, bool whisper /*= false*/) { std::string sender = data["sender"]; DBG_LB << "process message from " << sender << " " << (whisper ? "(w)" : "") - << ", len " << data["message"].str().size() << '\n'; + << ", len " << data["message"].str().size(); if(preferences::is_ignored(sender)) { return; @@ -676,7 +676,7 @@ std::unique_ptr builder_chatbox::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed unit preview pane '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; const auto conf = widget->cast_config_to(); assert(conf); diff --git a/src/gui/widgets/container_base.cpp b/src/gui/widgets/container_base.cpp index a6691c12ad0..6fc462aea2c 100644 --- a/src/gui/widgets/container_base.cpp +++ b/src/gui/widgets/container_base.cpp @@ -173,7 +173,7 @@ point container_base::calculate_best_size() const DBG_GUI_L << LOG_HEADER << " border size " << border_size << " returning " - << result << ".\n"; + << result << "."; return result; } diff --git a/src/gui/widgets/drawing.cpp b/src/gui/widgets/drawing.cpp index cecd3d45f94..8dce55758b6 100644 --- a/src/gui/widgets/drawing.cpp +++ b/src/gui/widgets/drawing.cpp @@ -134,7 +134,7 @@ std::unique_ptr builder_drawing::build() const widget->set_drawing_data(draw); DBG_GUI_G << "Window builder: placed drawing '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/grid.cpp b/src/gui/widgets/grid.cpp index 1969870478e..434ae04c634 100644 --- a/src/gui/widgets/grid.cpp +++ b/src/gui/widgets/grid.cpp @@ -84,7 +84,7 @@ void grid::set_child(std::unique_ptr widget, if(cell.get_widget()) { // free a child when overwriting it WRN_GUI_G << LOG_HEADER << " child '" << cell.id() << "' at cell '" - << row << ',' << col << "' will be replaced.\n"; + << row << ',' << col << "' will be replaced."; } // copy data @@ -246,7 +246,7 @@ void grid::request_reduce_width(const unsigned maximum_width) for(std::size_t col = 0; col < cols_; ++col) { if(too_wide - reduced >= col_width_[col]) { DBG_GUI_L << LOG_HEADER << " column " << col - << " is too small to be reduced.\n"; + << " is too small to be reduced."; continue; } @@ -259,7 +259,7 @@ void grid::request_reduce_width(const unsigned maximum_width) unsigned reduction = col_width_[col] - width; DBG_GUI_L << LOG_HEADER << " reduced " << reduction - << " pixels for column " << col << ".\n"; + << " pixels for column " << col << "."; size.x -= reduction; reduced += reduction; @@ -333,7 +333,7 @@ void grid::request_reduce_height(const unsigned maximum_height) if(too_high - reduced >= row_height_[row]) { DBG_GUI_L << LOG_HEADER << " row " << row << " height " << row_height_[row] << " want to reduce " << too_high - << " is too small to be reduced fully try 1 pixel.\n"; + << " is too small to be reduced fully try 1 pixel."; wanted_height = 1; } @@ -352,7 +352,7 @@ void grid::request_reduce_height(const unsigned maximum_height) DBG_GUI_L << LOG_HEADER << " row " << row << " height " << row_height_[row] << " want to reduce " << too_high - << " reduced " << reduction << " pixels.\n"; + << " reduced " << reduction << " pixels."; size.y -= reduction; reduced += reduction; @@ -366,7 +366,7 @@ void grid::request_reduce_height(const unsigned maximum_height) size = calculate_best_size(); DBG_GUI_L << LOG_HEADER << " Requested maximum " << maximum_height - << " resulting height " << size.y << ".\n"; + << " resulting height " << size.y << "."; set_layout_size(size); } @@ -452,12 +452,12 @@ point grid::calculate_best_size() const for(unsigned row = 0; row < rows_; ++row) { DBG_GUI_L << LOG_HEADER << " the row_height_ for row " << row - << " will be " << row_height_[row] << ".\n"; + << " will be " << row_height_[row] << "."; } for(unsigned col = 0; col < cols_; ++col) { DBG_GUI_L << LOG_HEADER << " the col_width_ for column " << col - << " will be " << col_width_[col] << ".\n"; + << " will be " << col_width_[col] << "."; } const point result( @@ -502,7 +502,7 @@ void grid::place(const point& origin, const point& size) assert(col_grow_factor_.size() == cols_); DBG_GUI_L << LOG_HEADER << " best size " << best_size << " available size " - << size << ".\n"; + << size << "."; /***** BEST_SIZE *****/ @@ -536,7 +536,7 @@ void grid::place(const point& origin, const point& size) DBG_GUI_L << LOG_HEADER << " extra width " << w << " will be divided amount " << w_size << " units in " - << cols_ << " columns.\n"; + << cols_ << " columns."; if(w_size == 0) { // If all sizes are 0 reset them to 1 @@ -553,7 +553,7 @@ void grid::place(const point& origin, const point& size) col_width_[i] += w_normal * col_grow_factor_[i]; DBG_GUI_L << LOG_HEADER << " column " << i << " with grow factor " << col_grow_factor_[i] - << " set width to " << col_width_[i] << ".\n"; + << " set width to " << col_width_[i] << "."; } } @@ -563,7 +563,7 @@ void grid::place(const point& origin, const point& size) row_grow_factor_.begin(), row_grow_factor_.end(), 0); DBG_GUI_L << LOG_HEADER << " extra height " << h << " will be divided amount " << h_size << " units in " - << rows_ << " rows.\n"; + << rows_ << " rows."; if(h_size == 0) { // If all sizes are 0 reset them to 1 @@ -580,7 +580,7 @@ void grid::place(const point& origin, const point& size) row_height_[i] += h_normal * row_grow_factor_[i]; DBG_GUI_L << LOG_HEADER << " row " << i << " with grow factor " << row_grow_factor_[i] << " set height to " - << row_height_[i] << ".\n"; + << row_height_[i] << "."; } } @@ -717,7 +717,7 @@ void grid::set_rows_cols(const unsigned rows, const unsigned cols) if(!children_.empty()) { WRN_GUI_G << LOG_HEADER << " resizing a non-empty grid " - << " may give unexpected problems.\n"; + << " may give unexpected problems."; } rows_ = rows; @@ -733,14 +733,13 @@ point grid::child::get_best_size() const if(!widget_) { DBG_GUI_L << LOG_CHILD_HEADER << " has widget " << false - << " returning " << border_space() << ".\n"; + << " returning " << border_space() << "."; return border_space(); } if(widget_->get_visible() == widget::visibility::invisible) { DBG_GUI_L << LOG_CHILD_HEADER << " has widget " << true - << " widget visible " << false << " returning 0,0" - << ".\n"; + << " widget visible " << false << " returning 0,0."; return point(); } @@ -748,7 +747,7 @@ point grid::child::get_best_size() const DBG_GUI_L << LOG_CHILD_HEADER << " has widget " << true << " widget visible " << true << " returning " << best_size - << ".\n"; + << "."; return best_size; } @@ -783,7 +782,7 @@ void grid::child::place(point origin, point size) if(size <= best_size) { DBG_GUI_L << LOG_CHILD_HEADER << " in best size range setting widget to " << origin << " x " - << size << ".\n"; + << size << "."; get_widget()->place(origin, size); return; @@ -800,7 +799,7 @@ void grid::child::place(point origin, point size) DBG_GUI_L << LOG_CHILD_HEADER << " in maximum size range setting widget to " << origin - << " x " << size << ".\n"; + << " x " << size << "."; get_widget()->place(origin, size); return; @@ -819,7 +818,7 @@ void grid::child::place(point origin, point size) widget_size.y = size.y; } DBG_GUI_L << LOG_CHILD_HEADER << " vertical growing from " - << best_size.y << " to " << widget_size.y << ".\n"; + << best_size.y << " to " << widget_size.y << "."; } else if(v_flag == VERTICAL_ALIGN_TOP) { // Do nothing. @@ -838,7 +837,7 @@ void grid::child::place(point origin, point size) } else { ERR_GUI_L << LOG_CHILD_HEADER << " Invalid vertical alignment '" - << v_flag << "' specified.\n"; + << v_flag << "' specified."; assert(false); } @@ -851,7 +850,7 @@ void grid::child::place(point origin, point size) widget_size.x = size.x; } DBG_GUI_L << LOG_CHILD_HEADER << " horizontal growing from " - << best_size.x << " to " << widget_size.x << ".\n"; + << best_size.x << " to " << widget_size.x << "."; } else if(h_flag == HORIZONTAL_ALIGN_LEFT) { // Do nothing. @@ -866,16 +865,16 @@ void grid::child::place(point origin, point size) widget_orig.x += (size.x - widget_size.x); DBG_GUI_L << LOG_CHILD_HEADER - << " horizontally aligned at the right.\n"; + << " horizontally aligned at the right."; } else { ERR_GUI_L << LOG_CHILD_HEADER << " No horizontal alignment '" << h_flag - << "' specified.\n"; + << "' specified."; assert(false); } DBG_GUI_L << LOG_CHILD_HEADER << " resize widget to " << widget_orig - << " x " << widget_size << ".\n"; + << " x " << widget_size << "."; get_widget()->place(widget_orig, widget_size); } @@ -967,7 +966,7 @@ void grid::layout(const point& origin) const point size(col_width_[col], row_height_[row]); DBG_GUI_L << LOG_HEADER << " set widget at " << row << ',' << col << " at origin " << orig << " with size " << size - << ".\n"; + << "."; if(get_child(row, col).get_widget()) { get_child(row, col).place(orig, size); @@ -1035,7 +1034,7 @@ unsigned grid_implementation::row_request_reduce_height( } DBG_GUI_L << LOG_IMPL_HEADER << " maximum row height " << maximum_height - << " returning " << required_height << ".\n"; + << " returning " << required_height << "."; return required_height; } @@ -1060,7 +1059,7 @@ unsigned grid_implementation::column_request_reduce_width( } DBG_GUI_L << LOG_IMPL_HEADER << " maximum column width " << maximum_width - << " returning " << required_width << ".\n"; + << " returning " << required_width << "."; return required_width; } diff --git a/src/gui/widgets/horizontal_scrollbar.cpp b/src/gui/widgets/horizontal_scrollbar.cpp index a39a9e92a71..fc160bbd565 100644 --- a/src/gui/widgets/horizontal_scrollbar.cpp +++ b/src/gui/widgets/horizontal_scrollbar.cpp @@ -153,7 +153,7 @@ std::unique_ptr builder_horizontal_scrollbar::build() const DBG_GUI_G << "Window builder:" << " placed horizontal scrollbar '" << id << "' with definition '" - << definition << "'.\n"; + << definition << "'."; return widget; } diff --git a/src/gui/widgets/image.cpp b/src/gui/widgets/image.cpp index a54357cca87..503bbf5ee4f 100644 --- a/src/gui/widgets/image.cpp +++ b/src/gui/widgets/image.cpp @@ -127,7 +127,7 @@ std::unique_ptr builder_image::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed image '" << id << "' with definition '" - << definition << "'.\n"; + << definition << "'."; return widget; } diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp index 99788cb4329..ac47c5a0210 100644 --- a/src/gui/widgets/label.cpp +++ b/src/gui/widgets/label.cpp @@ -267,7 +267,7 @@ std::unique_ptr builder_label::build() const lbl->set_link_color(conf->link_color); DBG_GUI_G << "Window builder: placed label '" << id << "' with definition '" - << definition << "'.\n"; + << definition << "'."; return lbl; } diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index d43ac9c6858..e660e016266 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -381,7 +381,7 @@ void listbox::resize_content(const int width_modification, const int height_modification_pos) { DBG_GUI_L << LOG_HEADER << " current size " << content_grid()->get_size() << " width_modification " - << width_modification << " height_modification " << height_modification << ".\n"; + << width_modification << " height_modification " << height_modification << "."; if(content_resize_request( width_modification, height_modification, width_modification_pos, height_modification_pos)) @@ -413,7 +413,7 @@ void listbox::resize_content(const widget& row) } DBG_GUI_L << LOG_HEADER << " current size " << content_grid()->get_size() << " row size " << row.get_best_size() - << ".\n"; + << "."; const point content = content_grid()->get_size(); point size = row.get_best_size(); diff --git a/src/gui/widgets/menu_button.cpp b/src/gui/widgets/menu_button.cpp index b0c6c2911cf..085b30b9697 100644 --- a/src/gui/widgets/menu_button.cpp +++ b/src/gui/widgets/menu_button.cpp @@ -258,7 +258,7 @@ std::unique_ptr builder_menu_button::build() const } DBG_GUI_G << "Window builder: placed menu_button '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/minimap.cpp b/src/gui/widgets/minimap.cpp index 4945ececae7..42e6307abf7 100644 --- a/src/gui/widgets/minimap.cpp +++ b/src/gui/widgets/minimap.cpp @@ -129,7 +129,7 @@ std::unique_ptr builder_minimap::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed minimap '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/multi_page.cpp b/src/gui/widgets/multi_page.cpp index 2ffda4dc888..dbc7dee9e95 100644 --- a/src/gui/widgets/multi_page.cpp +++ b/src/gui/widgets/multi_page.cpp @@ -228,7 +228,7 @@ std::unique_ptr builder_multi_page::build() const widget->set_page_builders(builders); DBG_GUI_G << "Window builder: placed multi_page '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; const auto conf = widget->cast_config_to(); assert(conf); diff --git a/src/gui/widgets/multimenu_button.cpp b/src/gui/widgets/multimenu_button.cpp index 5e517f82207..d646daec607 100644 --- a/src/gui/widgets/multimenu_button.cpp +++ b/src/gui/widgets/multimenu_button.cpp @@ -283,7 +283,7 @@ std::unique_ptr builder_multimenu_button::build() const } DBG_GUI_G << "Window builder: placed multimenu_button '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/panel.cpp b/src/gui/widgets/panel.cpp index 305172d9615..2f1a0ffe39d 100644 --- a/src/gui/widgets/panel.cpp +++ b/src/gui/widgets/panel.cpp @@ -132,7 +132,7 @@ std::unique_ptr builder_panel::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed panel '" << id << "' with definition '" - << definition << "'.\n"; + << definition << "'."; widget->init_grid(*grid); return widget; diff --git a/src/gui/widgets/password_box.cpp b/src/gui/widgets/password_box.cpp index 1b0f88240de..d9dd8b4cfc9 100644 --- a/src/gui/widgets/password_box.cpp +++ b/src/gui/widgets/password_box.cpp @@ -130,7 +130,7 @@ std::unique_ptr builder_password_box::build() const widget->set_value(label_string); DBG_GUI_G << "Window builder: placed password box '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/progress_bar.cpp b/src/gui/widgets/progress_bar.cpp index 94f8ecf16ab..8bfd0478ac4 100644 --- a/src/gui/widgets/progress_bar.cpp +++ b/src/gui/widgets/progress_bar.cpp @@ -109,7 +109,7 @@ std::unique_ptr builder_progress_bar::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed progress bar '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/repeating_button.cpp b/src/gui/widgets/repeating_button.cpp index 5a641f63425..376de99decc 100644 --- a/src/gui/widgets/repeating_button.cpp +++ b/src/gui/widgets/repeating_button.cpp @@ -200,7 +200,7 @@ std::unique_ptr builder_repeating_button::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed repeating button '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/scroll_label.cpp b/src/gui/widgets/scroll_label.cpp index 9dcfb632ff3..02709b97f3f 100644 --- a/src/gui/widgets/scroll_label.cpp +++ b/src/gui/widgets/scroll_label.cpp @@ -214,7 +214,7 @@ std::unique_ptr builder_scroll_label::build() const widget->finalize_setup(); DBG_GUI_G << "Window builder: placed scroll label '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/scrollbar.cpp b/src/gui/widgets/scrollbar.cpp index 0c8feb909f7..b8d4f328a11 100644 --- a/src/gui/widgets/scrollbar.cpp +++ b/src/gui/widgets/scrollbar.cpp @@ -229,7 +229,7 @@ void scrollbar_base::recalculate() assert(window); window->invalidate_layout(); ERR_GUI_G << LOG_HEADER - << " Can't recalculate size, force a window layout phase.\n"; + << " Can't recalculate size, force a window layout phase."; return; } diff --git a/src/gui/widgets/scrollbar_container.cpp b/src/gui/widgets/scrollbar_container.cpp index d997c95970c..5b72f351e22 100644 --- a/src/gui/widgets/scrollbar_container.cpp +++ b/src/gui/widgets/scrollbar_container.cpp @@ -193,7 +193,7 @@ void scrollbar_container::request_reduce_height(const unsigned maximum_height) if(resized && scrollbar_size.y > size.y) { vertical_scrollbar_grid_->set_visible(widget::visibility::invisible); DBG_GUI_L << LOG_HEADER << " request failed, showing the scrollbar" - << " increased the height to " << scrollbar_size.y << ".\n"; + << " increased the height to " << scrollbar_size.y << "."; return; } @@ -264,7 +264,7 @@ void scrollbar_container::request_reduce_width(const unsigned maximum_width) if(horizontal_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN && scrollbar_size.x > size.x) { horizontal_scrollbar_grid_->set_visible(widget::visibility::invisible); DBG_GUI_L << LOG_HEADER << " request failed, showing the scrollbar" - << " increased the width to " << scrollbar_size.x << ".\n"; + << " increased the width to " << scrollbar_size.x << "."; return; } @@ -310,7 +310,7 @@ point scrollbar_container::calculate_best_size() const horizontal_scrollbar.y + std::max(vertical_scrollbar.y, content.y)); DBG_GUI_L << LOG_HEADER << " vertical_scrollbar " << vertical_scrollbar << " horizontal_scrollbar " - << horizontal_scrollbar << " content " << content << " result " << result << ".\n"; + << horizontal_scrollbar << " content " << content << " result " << result << "."; return result; } @@ -608,7 +608,7 @@ bool scrollbar_container::content_resize_request(const int width_modification, const int height_modification_pos) { DBG_GUI_L << LOG_HEADER << " wanted width modification " << width_modification << " wanted height modification " - << height_modification << ".\n"; + << height_modification << "."; if(get_size() == point()) { DBG_GUI_L << LOG_HEADER << " initial setup not done, bailing out."; diff --git a/src/gui/widgets/scrollbar_panel.cpp b/src/gui/widgets/scrollbar_panel.cpp index ffd800b3a0d..578a96de097 100644 --- a/src/gui/widgets/scrollbar_panel.cpp +++ b/src/gui/widgets/scrollbar_panel.cpp @@ -104,7 +104,7 @@ std::unique_ptr builder_scrollbar_panel::build() const panel->set_horizontal_scrollbar_mode(horizontal_scrollbar_mode); DBG_GUI_G << "Window builder: placed scrollbar_panel '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; const auto conf = panel->cast_config_to(); assert(conf); diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 446ed9379c0..48a53356073 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -97,7 +97,7 @@ void slider::set_value(int value) << " desired_value=" << value << " minimum_value=" << minimum_value_ << " maximum_value=" << get_maximum_value() - << " step_size=" << step_size_ << "\n"; + << " step_size=" << step_size_; assert(false); } diff --git a/src/gui/widgets/spacer.cpp b/src/gui/widgets/spacer.cpp index 6687417d933..401039b3018 100644 --- a/src/gui/widgets/spacer.cpp +++ b/src/gui/widgets/spacer.cpp @@ -132,7 +132,7 @@ std::unique_ptr builder_spacer::build() const auto widget = std::make_unique(*this, width_, height_); DBG_GUI_G << "Window builder: placed spacer '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/stacked_widget.cpp b/src/gui/widgets/stacked_widget.cpp index 43c8bff3461..2864f96286c 100644 --- a/src/gui/widgets/stacked_widget.cpp +++ b/src/gui/widgets/stacked_widget.cpp @@ -252,7 +252,7 @@ std::unique_ptr builder_stacked_widget::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed stacked widget '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; const auto conf = widget->cast_config_to(); assert(conf); diff --git a/src/gui/widgets/styled_widget.cpp b/src/gui/widgets/styled_widget.cpp index c0631f57ae2..429fcbb6f97 100644 --- a/src/gui/widgets/styled_widget.cpp +++ b/src/gui/widgets/styled_widget.cpp @@ -209,7 +209,7 @@ void styled_widget::request_reduce_width(const unsigned maximum_width) DBG_GUI_L << LOG_HEADER << " label '" << debug_truncate(label_) << "' maximum_width " << maximum_width << " result " << size - << ".\n"; + << "."; } else if(label_.empty() || text_can_shrink()) { point size = get_best_size(); @@ -219,10 +219,10 @@ void styled_widget::request_reduce_width(const unsigned maximum_width) DBG_GUI_L << LOG_HEADER << " styled_widget " << id() << " maximum_width " << maximum_width << " result " << size - << ".\n"; + << "."; } else { DBG_GUI_L << LOG_HEADER << " label '" << debug_truncate(label_) - << "' failed; either no label or wrapping not allowed.\n"; + << "' failed; either no label or wrapping not allowed."; } } @@ -238,7 +238,7 @@ void styled_widget::request_reduce_height(const unsigned maximum_height) DBG_GUI_L << LOG_HEADER << " styled_widget " << id() << " maximum_height " << maximum_height << " result " << size - << ".\n"; + << "."; } } @@ -259,7 +259,7 @@ point styled_widget::calculate_best_size() const */ point result = get_best_text_size(minimum, maximum); DBG_GUI_L << LOG_HEADER << " label '" << debug_truncate(label_) - << "' result " << result << ".\n"; + << "' result " << result << "."; return result; } @@ -434,7 +434,7 @@ int styled_widget::get_text_maximum_height() const void styled_widget::impl_draw_background() { DBG_GUI_D << LOG_HEADER << " label '" << debug_truncate(label_) << "' size " - << get_rectangle() << ".\n"; + << get_rectangle() << "."; get_canvas(get_state()).draw(); } @@ -475,7 +475,7 @@ point styled_widget::get_best_text_size(point minimum_size, point maximum_size) if(get_characters_per_line() != 0 && !can_wrap()) { WRN_GUI_L << LOG_HEADER << " Limited the number of characters per line, " - << "but wrapping is not set, output may not be as expected.\n"; + << "but wrapping is not set, output may not be as expected."; } DBG_GUI_L << LOG_HEADER << "\n" @@ -488,7 +488,7 @@ point styled_widget::get_best_text_size(point minimum_size, point maximum_size) << "can_wrap: " << can_wrap() << "\n" << "characters_per_line: " << get_characters_per_line() << "\n" << "truncated: " << renderer_.is_truncated() << "\n" - << "renderer size: " << renderer_.get_size() << "\n\n" + << "renderer size: " << renderer_.get_size() << "\n" << std::noboolalpha; const point border(config_->text_extra_width, @@ -516,7 +516,7 @@ point styled_widget::get_best_text_size(point minimum_size, point maximum_size) } DBG_GUI_L << LOG_HEADER << " label '" << debug_truncate(label_) - << "' result " << size << ".\n"; + << "' result " << size << "."; return size; } @@ -606,7 +606,7 @@ builder_styled_widget::builder_styled_widget(const config& cfg) DBG_GUI_P << "Window builder: found styled_widget with id '" << id - << "' and definition '" << definition << "'.\n"; + << "' and definition '" << definition << "'."; } std::unique_ptr builder_styled_widget::build(const replacements_map& /*replacements*/) const diff --git a/src/gui/widgets/text_box.cpp b/src/gui/widgets/text_box.cpp index 6b75181a314..7512515e466 100644 --- a/src/gui/widgets/text_box.cpp +++ b/src/gui/widgets/text_box.cpp @@ -443,7 +443,7 @@ std::unique_ptr builder_text_box::build() const widget->set_hint_data(hint_text, hint_image); DBG_GUI_G << "Window builder: placed text box '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/toggle_button.cpp b/src/gui/widgets/toggle_button.cpp index 461fb5bb0f4..1242eb5f569 100644 --- a/src/gui/widgets/toggle_button.cpp +++ b/src/gui/widgets/toggle_button.cpp @@ -236,7 +236,7 @@ std::unique_ptr builder_toggle_button::build() const widget->set_retval(get_retval(retval_id_, retval_, id)); DBG_GUI_G << "Window builder: placed toggle button '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; return widget; } diff --git a/src/gui/widgets/toggle_panel.cpp b/src/gui/widgets/toggle_panel.cpp index 126613287f1..7c2346128fd 100644 --- a/src/gui/widgets/toggle_panel.cpp +++ b/src/gui/widgets/toggle_panel.cpp @@ -330,7 +330,7 @@ std::unique_ptr builder_toggle_panel::build() const widget->set_retval(get_retval(retval_id_, retval_, id)); DBG_GUI_G << "Window builder: placed toggle panel '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; widget->init_grid(*grid); return widget; diff --git a/src/gui/widgets/tree_view.cpp b/src/gui/widgets/tree_view.cpp index 8319e1c7bab..5fe09661cb5 100644 --- a/src/gui/widgets/tree_view.cpp +++ b/src/gui/widgets/tree_view.cpp @@ -113,7 +113,7 @@ void tree_view::resize_content(const int width_modification, const int height_modification_pos) { DBG_GUI_L << LOG_HEADER << " current size " << content_grid()->get_size() << " width_modification " - << width_modification << " height_modification " << height_modification << ".\n"; + << width_modification << " height_modification " << height_modification << "."; if(content_resize_request( width_modification, diff --git a/src/gui/widgets/unit_preview_pane.cpp b/src/gui/widgets/unit_preview_pane.cpp index eec70869677..bcee40a00c7 100644 --- a/src/gui/widgets/unit_preview_pane.cpp +++ b/src/gui/widgets/unit_preview_pane.cpp @@ -629,7 +629,7 @@ std::unique_ptr builder_unit_preview_pane::build() const auto widget = std::make_unique(*this); DBG_GUI_G << "Window builder: placed unit preview pane '" << id - << "' with definition '" << definition << "'.\n"; + << "' with definition '" << definition << "'."; const auto conf = widget->cast_config_to(); assert(conf); diff --git a/src/gui/widgets/vertical_scrollbar.cpp b/src/gui/widgets/vertical_scrollbar.cpp index a82a1aa911c..42c51810164 100644 --- a/src/gui/widgets/vertical_scrollbar.cpp +++ b/src/gui/widgets/vertical_scrollbar.cpp @@ -143,7 +143,7 @@ std::unique_ptr builder_vertical_scrollbar::build() const DBG_GUI_G << "Window builder:" << " placed vertical scrollbar '" << id << "' with definition '" - << definition << "'.\n"; + << definition << "'."; return widget; } diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index df38750bd29..5c93f66554f 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -78,8 +78,8 @@ widget::widget(const builder_widget& builder) widget::~widget() { DBG_GUI_LF - << "widget destroy: " << static_cast(this) << " (id: " << id_ - << ")\n"; + << "widget destroy: " << static_cast(this) + << " (id: " << id_ << ')'; widget* p = parent(); while(p) { @@ -103,7 +103,7 @@ void widget::set_id(const std::string& id) DBG_GUI_LF << "set id of " << static_cast(this) << " to '" << id << "' " << "(was '" << id_ << "'). Widget type: " - << (this_ctrl ? this_ctrl->get_control_type() : typeid(widget).name()) << "\n"; + << (this_ctrl ? this_ctrl->get_control_type() : typeid(widget).name()); id_ = id; } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index c728559d315..890f5de09e6 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -1023,7 +1023,7 @@ void window_implementation::layout(window& window, DBG_GUI_L << LOG_IMPL_HEADER << " best size : " << size << " maximum size : " << maximum_width << ',' - << maximum_height << ".\n"; + << maximum_height << "."; if(size.x <= static_cast(maximum_width) && size.y <= static_cast(maximum_height)) { @@ -1038,11 +1038,11 @@ void window_implementation::layout(window& window, if(size.x > static_cast(maximum_width)) { DBG_GUI_L << LOG_IMPL_HEADER << " Result: Resize width failed." << " Wanted width " << maximum_width - << " resulting width " << size.x << ".\n"; + << " resulting width " << size.x << "."; throw layout_exception_width_resize_failed(); } DBG_GUI_L << LOG_IMPL_HEADER - << " Status: Resize width succeeded.\n"; + << " Status: Resize width succeeded."; } if(size.y > static_cast(maximum_height)) { @@ -1052,11 +1052,11 @@ void window_implementation::layout(window& window, if(size.y > static_cast(maximum_height)) { DBG_GUI_L << LOG_IMPL_HEADER << " Result: Resize height failed." << " Wanted height " << maximum_height - << " resulting height " << size.y << ".\n"; + << " resulting height " << size.y << "."; throw layout_exception_height_resize_failed(); } DBG_GUI_L << LOG_IMPL_HEADER - << " Status: Resize height succeeded.\n"; + << " Status: Resize height succeeded."; } assert(size.x <= static_cast(maximum_width) @@ -1069,7 +1069,7 @@ void window_implementation::layout(window& window, catch(const layout_exception_width_modified&) { DBG_GUI_L << LOG_IMPL_HEADER - << " Status: Width has been modified, rerun.\n"; + << " Status: Width has been modified, rerun."; window.layout_initialize(false); window.layout_linked_widgets(); @@ -1139,7 +1139,7 @@ void window::signal_handler_click_dismiss(const event::ui_event event, const int mouse_button_mask) { DBG_GUI_E << LOG_HEADER << ' ' << event << " mouse_button_mask " - << static_cast(mouse_button_mask) << ".\n"; + << static_cast(mouse_button_mask) << "."; handled = halt = click_dismiss(mouse_button_mask); } diff --git a/src/halo.cpp b/src/halo.cpp index 9b1fd5a09cc..49d7b7a07d4 100644 --- a/src/halo.cpp +++ b/src/halo.cpp @@ -36,8 +36,6 @@ static lg::log_domain log_halo("halo"); #define LOG_HL LOG_STREAM(info, log_halo) #define DBG_HL LOG_STREAM(debug, log_halo) -using std::endl; - namespace halo { diff --git a/src/hotkey/command_executor.cpp b/src/hotkey/command_executor.cpp index 95a65a3c601..c77a3ae9f4d 100644 --- a/src/hotkey/command_executor.cpp +++ b/src/hotkey/command_executor.cpp @@ -606,7 +606,7 @@ void command_executor::queue_command(const SDL_Event& event, int index) bool release = event.type == SDL_KEYUP; if(press) { LOG_HK << "sending press event (keypress = " << - std::boolalpha << keypress << std::noboolalpha << ")\n"; + std::boolalpha << keypress << std::noboolalpha << ")"; } if(keypress) { press_event_sent_ = true; diff --git a/src/image_modifications.cpp b/src/image_modifications.cpp index 391e9d563f2..4af1c675af1 100644 --- a/src/image_modifications.cpp +++ b/src/image_modifications.cpp @@ -649,9 +649,8 @@ REGISTER_MOD_PARSER(TC, args) // Pass argseters for RC functor // if(!game_config::tc_info(params[1]).size()){ - ERR_DP << "could not load TC info for '" << params[1] - << "' palette\n" - << "bailing out from TC\n"; + ERR_DP << "could not load TC info for '" << params[1] << "' palette"; + ERR_DP << "bailing out from TC"; return nullptr; } @@ -663,10 +662,8 @@ REGISTER_MOD_PARSER(TC, args) rc_map = recolor_range(new_color,old_color); } catch(const config::error& e) { - ERR_DP << "caught config::error while processing TC: " - << e.message - << '\n' - << "bailing out from TC\n"; + ERR_DP << "caught config::error while processing TC: " << e.message; + ERR_DP << "bailing out from TC"; return nullptr; } @@ -695,10 +692,8 @@ REGISTER_MOD_PARSER(RC, args) } catch (const config::error& e) { ERR_DP << "caught config::error while processing color-range RC: " - << e.message - << '\n'; - ERR_DP - << "bailing out from RC\n"; + << e.message; + ERR_DP << "bailing out from RC"; rc_map.clear(); } @@ -729,10 +724,9 @@ REGISTER_MOD_PARSER(PAL, args) } catch(const config::error& e) { ERR_DP << "caught config::error while processing PAL function: " - << e.message - << '\n'; + << e.message; ERR_DP - << "bailing out from PAL\n"; + << "bailing out from PAL"; return nullptr; } diff --git a/src/movetype.cpp b/src/movetype.cpp index 23c710bd68f..642b11bf011 100644 --- a/src/movetype.cpp +++ b/src/movetype.cpp @@ -283,7 +283,7 @@ int movetype::terrain_info::data::calc_value( ERR_CF << "infinite terrain_info recursion on " << (params_.use_move ? "movement" : "defense") << ": " << t_translation::write_terrain_code(terrain) - << " depth " << recurse_count << '\n'; + << " depth " << recurse_count; return params_.default_value; } @@ -320,14 +320,14 @@ int movetype::terrain_info::data::calc_value( WRN_CF << "Terrain '" << terrain << "' has evaluated to " << result << " (" << (params_.use_move ? "cost" : "defense") << "), which is less than " << params_.min_value - << "; resetting to " << params_.min_value << ".\n"; + << "; resetting to " << params_.min_value << "."; result = params_.min_value; } if ( result > params_.max_value ) { WRN_CF << "Terrain '" << terrain << "' has evaluated to " << result << " (" << (params_.use_move ? "cost" : "defense") << "), which is more than " << params_.max_value - << "; resetting to " << params_.max_value << ".\n"; + << "; resetting to " << params_.max_value << "."; result = params_.max_value; } diff --git a/src/mt_rng.cpp b/src/mt_rng.cpp index 4bd1fab18e2..bde7fc7aca1 100644 --- a/src/mt_rng.cpp +++ b/src/mt_rng.cpp @@ -66,7 +66,7 @@ uint32_t mt_rng::get_next_random() ++random_calls_; DBG_RND << "pulled user random " << result << " for call " << random_calls_ - << " with seed " << std::hex << random_seed_ << std::endl; + << " with seed " << std::hex << random_seed_; return result; } @@ -83,7 +83,7 @@ void mt_rng::seed_random(const uint32_t seed, const unsigned int call_count) mt_.discard(call_count); random_calls_ = call_count; DBG_RND << "Seeded random with " << std::hex << random_seed_ << std::dec << " with " - << random_calls_ << " calls." << std::endl; + << random_calls_ << " calls."; } void mt_rng::seed_random(const std::string & seed_str, const unsigned int call_count) diff --git a/src/network_asio.cpp b/src/network_asio.cpp index b077e6a303e..3736dbe9d02 100644 --- a/src/network_asio.cpp +++ b/src/network_asio.cpp @@ -152,7 +152,7 @@ template auto verbose_verify(Verifier&& verifier) X509_NAME_oneline(X509_get_subject_name(cert), subject_name, 256); bool verified = verifier(preverified, ctx); DBG_NW << "Verifying TLS certificate: " << subject_name << ": " << - (verified ? "verified" : "failed") << std::endl; + (verified ? "verified" : "failed"); BIO* bio = BIO_new(BIO_s_mem()); char buffer[1024]; X509_print(bio, cert); diff --git a/src/picture.cpp b/src/picture.cpp index 84dee054f4d..3698e0c2328 100644 --- a/src/picture.cpp +++ b/src/picture.cpp @@ -510,7 +510,7 @@ static surface load_image_file(const image::locator& loc) location = filesystem::get_binary_file_location("images", webp_name); if(!location.empty()) { WRN_IMG << "Replaced missing '" << name << "' with found '" - << webp_name << "'." << std::endl; + << webp_name << "'."; } } @@ -569,7 +569,7 @@ static surface load_image_sub_file(const image::locator& loc) ERR_CFG << "Failed to apply a modification to an image:\n" << "Image: " << loc.get_filename() << "\n" << "Modifications: " << ss.str() << "\n" - << "Error: " << e.message << "\n"; + << "Error: " << e.message; } // NOTE: do this *after* applying the mod or you'll get crashes! @@ -844,15 +844,13 @@ surface get_surface( { DBG_IMG << "duplicate load: " << i_locator << " [" << type << "]" - << " (" << duplicate_loads_ << "/" << total_loads_ << " total)" - << std::endl; + << " (" << duplicate_loads_ << "/" << total_loads_ << " total)"; ++duplicate_loads_; } ++total_loads_; if(skip_cache) { - DBG_IMG << "surface cache [" << type << "] skip: " - << i_locator << std::endl; + DBG_IMG << "surface cache [" << type << "] skip: " << i_locator; i_locator.add_to_cache(skip, true); } else { i_locator.add_to_cache(imap, res); @@ -1164,8 +1162,7 @@ texture get_texture(const image::locator& i_locator, scale_quality quality, TYPE // Cache the texture. if(skip_cache) { - DBG_IMG << "texture cache [" << type << "] skip: " - << i_locator << std::endl; + DBG_IMG << "texture cache [" << type << "] skip: " << i_locator; } else { i_locator.add_to_cache(*cache, res); } diff --git a/src/playsingle_controller.cpp b/src/playsingle_controller.cpp index 4aed1ada138..be674b10f80 100644 --- a/src/playsingle_controller.cpp +++ b/src/playsingle_controller.cpp @@ -447,7 +447,7 @@ void playsingle_controller::play_side_impl() } else { // we should have skipped over empty controllers before so this shouldn't be possible ERR_NG << "Found invalid side controller " << side_controller::get_string(current_team().controller()) << " (" - << side_proxy_controller::get_string(current_team().proxy_controller()) << ") for side " << current_team().side() << "\n"; + << side_proxy_controller::get_string(current_team().proxy_controller()) << ") for side " << current_team().side(); } } diff --git a/src/preferences/general.cpp b/src/preferences/general.cpp index c5f89d391fa..91a1d23f34b 100644 --- a/src/preferences/general.cpp +++ b/src/preferences/general.cpp @@ -254,9 +254,7 @@ void load_base_prefs() { read(prefs, *stream); #endif } catch(const config::error& e) { - ERR_CFG << "Error loading preference, message: " - << e.what() - << std::endl; + ERR_CFG << "Error loading preference, message: " << e.what(); } } diff --git a/src/replay.cpp b/src/replay.cpp index 33d0ff15502..f73ea864276 100644 --- a/src/replay.cpp +++ b/src/replay.cpp @@ -788,7 +788,7 @@ REPLAY_RETURN do_replay_handle(bool one_move) // The same way it is possible that an unrenamable unit moves to a // hex where previously a renamable unit was. WRN_REPLAY << "attempt to rename unit at location: " - << loc << (u.valid() ? ", which is unrenamable" : ", where none exists (anymore)") << "\n"; + << loc << (u.valid() ? ", which is unrenamable" : ", where none exists (anymore)"); } } diff --git a/src/saved_game.cpp b/src/saved_game.cpp index 263934bd102..1cdb37b75e8 100644 --- a/src/saved_game.cpp +++ b/src/saved_game.cpp @@ -249,7 +249,7 @@ void saved_game::set_defaults() if(!is_loaded_game && !side["current_player"].empty()) { ERR_NG << "Removed invalid 'current_player' attribute from [side] while loading a scenario. Consider using " - "'side_name' instead\n"; + "'side_name' instead"; side["current_player"] = config::attribute_value(); } diff --git a/src/scripting/lua_fileops.cpp b/src/scripting/lua_fileops.cpp index 1446a09909c..ef9cff4b37f 100644 --- a/src/scripting/lua_fileops.cpp +++ b/src/scripting/lua_fileops.cpp @@ -270,7 +270,7 @@ public: << " goodbit:" << lfs->pistream_->good() << " endoffile:" << lfs->pistream_->eof() << " badbit:" << lfs->pistream_->bad() - << " failbit:" << lfs->pistream_->fail() << "\n"; + << " failbit:" << lfs->pistream_->fail(); #endif return lfs->buff_; } diff --git a/src/serialization/preprocessor.cpp b/src/serialization/preprocessor.cpp index 5b6acf23cbe..5704e49c636 100644 --- a/src/serialization/preprocessor.cpp +++ b/src/serialization/preprocessor.cpp @@ -1310,7 +1310,7 @@ bool preprocessor_data::get_chunk() WRN_PREPROC << "Redefining macro " << symbol << " without explicit #undef at " << lineno_string(new_pos.str()) << '\n' - << "previously defined at " << lineno_string(old_pos.str()) << '\n'; + << "previously defined at " << lineno_string(old_pos.str()); } buffer.erase(buffer.end() - 7, buffer.end()); @@ -1332,8 +1332,7 @@ bool preprocessor_data::get_chunk() skip_spaces(); const std::string& symbol = read_word(); bool found = !filesystem::get_wml_location(symbol, directory_).empty(); - DBG_PREPROC << "testing for file or directory " << symbol << ": " << (found ? "found" : "not found") - << '\n'; + DBG_PREPROC << "testing for file or directory " << symbol << ": " << (found ? "found" : "not found"); conditional_skip(negate ? found : !found); } else if(command == "ifver" || command == "ifnver") { const bool negate = command[2] == 'n'; @@ -1361,7 +1360,7 @@ bool preprocessor_data::get_chunk() const bool found = do_version_check(version1, vop, version2); DBG_PREPROC << "testing version '" << version1.str() << "' against '" << version2.str() << "' (" - << vopstr << "): " << (found ? "match" : "no match") << '\n'; + << vopstr << "): " << (found ? "match" : "no match"); conditional_skip(negate ? found : !found); } else { @@ -1555,8 +1554,7 @@ bool preprocessor_data::get_chunk() optional_arg_num++; - DBG_PREPROC << "Found override for " << argname << " in call to macro " << symbol - << "\n"; + DBG_PREPROC << "Found override for " << argname << " in call to macro " << symbol; } else { std::ostringstream warning; warning << "Unrecognized optional argument passed to macro '" << symbol << "': '" @@ -1590,7 +1588,7 @@ bool preprocessor_data::get_chunk() res << in.rdbuf(); DBG_PREPROC << "Setting default for optional argument " << argument.first << " in macro " - << symbol << "\n"; + << symbol; (*defines)[argument.first] = res.str(); } diff --git a/src/serialization/schema_validator.cpp b/src/serialization/schema_validator.cpp index 82b0c3cff3a..0ae33d611ee 100644 --- a/src/serialization/schema_validator.cpp +++ b/src/serialization/schema_validator.cpp @@ -187,8 +187,8 @@ schema_validator::schema_validator(const std::string& config_file_name, bool val counter_.emplace(); cache_.emplace(); root_.expand_all(root_); - LOG_VL << "Schema file " << config_file_name << " was read.\n" - << "Validator initialized\n"; + LOG_VL << "Schema file " << config_file_name << " was read."; + LOG_VL << "Validator initialized"; } } diff --git a/src/serialization/string_utils.cpp b/src/serialization/string_utils.cpp index 13ac3d84458..07707e2f799 100644 --- a/src/serialization/string_utils.cpp +++ b/src/serialization/string_utils.cpp @@ -175,7 +175,7 @@ std::vector square_parenthetical_split(const std::string& val, } if (padding*padding_end > 0 && s_begin.size() != s_end.size()) { ERR_GENERAL << "Square bracket padding sizes not matching: " - << s_begin << " and " << s_end <<".\n"; + << s_begin << " and " << s_end <<"."; } if (padding_end > padding) padding = padding_end; diff --git a/src/server/campaignd/server.cpp b/src/server/campaignd/server.cpp index 61ccd826e1d..34ec29c4402 100644 --- a/src/server/campaignd/server.cpp +++ b/src/server/campaignd/server.cpp @@ -417,7 +417,7 @@ void server::load_config() if(cfg_.has_child("campaigns")) { config& campaigns = cfg_.child("campaigns"); WRN_CS << "Old format addons have been detected in the config! They will be converted to the new file format! " - << campaigns.child_count("campaign") << " entries to be processed.\n"; + << campaigns.child_count("campaign") << " entries to be processed."; for(config& campaign : campaigns.child_range("campaign")) { const std::string& addon_id = campaign["name"].str(); const std::string& addon_file = campaign["filename"].str(); @@ -659,7 +659,7 @@ void server::handle_read_from_fifo(const boost::system::error_code& error, std:: mark_dirty(addon_id); write_config(); LOG_CS << "Set attribute on add-on '" << addon_id << "':\n" - << key << "=\"" << value << "\"\n"; + << key << "=\"" << value << "\""; } } } else if(ctl == "log") { @@ -906,7 +906,7 @@ void server::delete_addon(const std::string& id) if(!filesystem::delete_directory(fn)) { ERR_CS << "Could not delete the directory for addon '" << id - << "' (" << fn << "): " << strerror(errno) << '\n'; + << "' (" << fn << "): " << strerror(errno); } addons_.erase(id); @@ -1137,7 +1137,7 @@ void server::handle_request_campaign(const server::request& req) delivery_size += filesystem::file_size(update_pack_path); } else { ERR_CS << "Broken update sequence from version " << from << " to " - << to << " for the add-on '" << name << "', sending a full pack instead\n"; + << to << " for the add-on '" << name << "', sending a full pack instead"; force_use_full = true; break; } @@ -1498,7 +1498,7 @@ void server::handle_upload(const server::request& req) LOG_CS << req << "Upload type: " << (is_delta_upload ? "delta" : "full") << ", " - << (is_existing_upload ? "update" : "new") << '\n'; + << (is_existing_upload ? "update" : "new"); // Write general metadata attributes @@ -1774,7 +1774,7 @@ void server::handle_upload(const server::request& req) if(filesystem::file_size(prev_path) <= 0 || filesystem::file_size(next_path) <= 0) { ERR_CS << "Unable to automatically generate an update pack for '" << name << "' for version " << prev_version_name << " to " << next_version_name - << "!\n"; + << "!"; continue; } diff --git a/src/server/common/dbconn.cpp b/src/server/common/dbconn.cpp index 210db770fb8..8dbf8ed7d97 100644 --- a/src/server/common/dbconn.cpp +++ b/src/server/common/dbconn.cpp @@ -59,7 +59,7 @@ void dbconn::log_sql_exception(const std::string& text, const mariadb::exception { ERR_SQL << text << '\n' << "what: " << e.what() << '\n' - << "error id: " << e.error_id() << std::endl; + << "error id: " << e.error_id(); } mariadb::connection_ref dbconn::create_connection() diff --git a/src/server/common/server_base.cpp b/src/server/common/server_base.cpp index 9295ab21d0c..c846985ae33 100644 --- a/src/server/common/server_base.cpp +++ b/src/server/common/server_base.cpp @@ -509,13 +509,13 @@ template std::unique_ptr server_base::cor if(size == 0) { ERR_SERVER << log_address(socket) << - "\treceived invalid packet with payload size 0" << std::endl; + "\treceived invalid packet with payload size 0"; return {}; } if(size > simple_wml::document::document_size_limit) { ERR_SERVER << log_address(socket) << - "\treceived packet with payload size over size limit" << std::endl; + "\treceived packet with payload size over size limit"; return {}; } @@ -528,7 +528,7 @@ template std::unique_ptr server_base::cor } catch (simple_wml::error& e) { ERR_SERVER << log_address(socket) << - "\tsimple_wml error in received data: " << e.message << std::endl; + "\tsimple_wml error in received data: " << e.message; async_send_error(socket, "Invalid WML received: " + e.message); return {}; } diff --git a/src/server/common/simple_wml.cpp b/src/server/common/simple_wml.cpp index 389e12b6d1b..8250b67e60a 100644 --- a/src/server/common/simple_wml.cpp +++ b/src/server/common/simple_wml.cpp @@ -94,7 +94,7 @@ char* uncompress_buffer(const string_span& input, string_span* span) } catch (const std::bad_alloc& e) { ERR_SWML << "ERROR: bad_alloc caught in uncompress_buffer() state " << state << " alloc bytes " << nalloc << " with input: '" - << input << "' " << e.what() << std::endl; + << input << "' " << e.what(); throw error("Bad allocation request in uncompress_buffer()."); } } @@ -147,7 +147,7 @@ char* compress_buffer(const char* input, string_span* span, bool bzip2) } catch (const std::bad_alloc& e) { ERR_SWML << "ERROR: bad_alloc caught in compress_buffer() state " << state << " alloc bytes " << nalloc << " with input: '" - << input << "' " << e.what() << std::endl; + << input << "' " << e.what(); throw error("Bad allocation request in compress_buffer()."); } } @@ -1049,7 +1049,7 @@ const char* document::output() buf = new char[buf_size]; } catch (const std::bad_alloc& e) { ERR_SWML << "ERROR: Trying to allocate " << buf_size << " bytes. " - << e.what() << std::endl; + << e.what(); throw error("Bad allocation request in output()."); } buffers_.push_back(buf); diff --git a/src/server/wesnothd/ban.cpp b/src/server/wesnothd/ban.cpp index 534cad15684..80cf752473a 100644 --- a/src/server/wesnothd/ban.cpp +++ b/src/server/wesnothd/ban.cpp @@ -575,13 +575,12 @@ void ban_manager::check_ban_times(std::time_t time_now) if(ban->get_end_time() > time_now) { // No bans going to expire DBG_SERVER << "ban " << ban->get_ip() << " not removed. time: " << time_now << " end_time " - << ban->get_end_time() << "\n"; + << ban->get_end_time(); break; } // This ban is going to expire so delete it. - LOG_SERVER << "Remove a ban " << ban->get_ip() << ". time: " << time_now << " end_time " << ban->get_end_time() - << "\n"; + LOG_SERVER << "Remove a ban " << ban->get_ip() << ". time: " << time_now << " end_time " << ban->get_end_time(); std::ostringstream os; unban(os, ban->get_ip(), false); time_queue_.pop(); diff --git a/src/server/wesnothd/game.cpp b/src/server/wesnothd/game.cpp index a46b67ee658..59dff89fdee 100644 --- a/src/server/wesnothd/game.cpp +++ b/src/server/wesnothd/game.cpp @@ -279,8 +279,7 @@ void game::start_game(player_iterator starter) + "\tinit time: " + multiplayer["mp_countdown_init_time"].to_string() + "\taction bonus: " + multiplayer["mp_countdown_action_bonus"].to_string() + "\tturn bonus: " + multiplayer["mp_countdown_turn_bonus"].to_string() - : "") - << "\n"; + : ""); for(unsigned side_index = 0; side_index < sides.size(); ++side_index) { @@ -727,7 +726,7 @@ void game::mute_observer(const simple_wml::node& mute, player_iterator muter) } LOG_GAME << muter->client_ip() << "\t" << game::username(muter) << " muted: " << username << " (" - << (*user)->client_ip() << ")\tin game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")\n"; + << (*user)->client_ip() << ")\tin game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")"; muted_observers_.push_back(*user); send_and_record_server_message(username.to_string() + " has been muted."); @@ -759,7 +758,7 @@ void game::unmute_observer(const simple_wml::node& unmute, player_iterator unmut } LOG_GAME << unmuter->client_ip() << "\t" << game::username(unmuter) << " unmuted: " << username << " (" - << (*user)->client_ip() << ")\tin game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")\n"; + << (*user)->client_ip() << ")\tin game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")"; muted_observers_.erase(std::remove(muted_observers_.begin(), muted_observers_.end(), user), muted_observers_.end()); send_and_record_server_message(username.to_string() + " has been unmuted."); @@ -793,7 +792,7 @@ std::optional game::kick_member(const simple_wml::node& kick, p } LOG_GAME << kicker->client_ip() << "\t" << game::username(kicker) << "\tkicked: " << username << " (" - << (*user)->client_ip() << ")\tfrom game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")\n"; + << (*user)->client_ip() << ")\tfrom game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")"; send_and_record_server_message(username.to_string() + " has been kicked."); @@ -828,7 +827,7 @@ std::optional game::ban_user(const simple_wml::node& ban, playe } LOG_GAME << banner->client_ip() << "\t" << game::username(banner) << "\tbanned: " << username << " (" - << (*user)->client_ip() << ")\tfrom game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")\n"; + << (*user)->client_ip() << ")\tfrom game:\t\"" << name_ << "\" (" << id_ << ", " << db_id_ << ")"; bans_.push_back((*user)->client_ip()); name_bans_.push_back(username.to_string()); @@ -868,7 +867,7 @@ void game::unban_user(const simple_wml::node& unban, player_iterator unbanner) LOG_GAME << unbanner->client_ip() << "\t" << unbanner->info().name() << "\tunbanned: " << username << " (" << (*user)->client_ip() << ")\tfrom game:\t\"" << name_ << "\" (" - << id_ << ", " << db_id_ << ")\n"; + << id_ << ", " << db_id_ << ")"; bans_.erase(std::remove(bans_.begin(), bans_.end(), (*user)->client_ip()), bans_.end()); name_bans_.erase(std::remove(name_bans_.begin(), name_bans_.end(), username.to_string()), name_bans_.end()); @@ -973,10 +972,10 @@ bool game::process_turn(simple_wml::document& data, player_iterator user) for(simple_wml::node* command : commands) { DBG_GAME << "game " << id_ << ", " << db_id_ << " received [" << (*command).first_child() << "] from player '" << username(user) - << "'(" << ") during turn " << current_side_index_ + 1 << "," << current_turn_ << "\n"; + << "'(" << ") during turn " << current_side_index_ + 1 << "," << current_turn_; if(!is_legal_command(*command, user)) { LOG_GAME << "ILLEGAL COMMAND in game: " << id_ << ", " << db_id_ << " (((" << simple_wml::node_to_string(*command) - << ")))\n"; + << ")))"; std::stringstream msg; msg << "Removing illegal command '" << (*command).first_child().to_string() << "' from: " << username(user) @@ -1232,7 +1231,7 @@ void game::handle_choice(const simple_wml::node& data, player_iterator user) } DBG_GAME << "answering choice request " << request_id << " by player " - << user->info().name() << std::endl; + << user->info().name(); last_choice_request_id_ = request_id; if(data.child("random_seed")) { @@ -1394,7 +1393,7 @@ bool game::add_player(player_iterator player, bool observer) LOG_GAME << player->client_ip() << "\t" << user->info().name() << "\tjoined game:\t\"" - << name_ << "\" (" << id_ << ", " << db_id_ << ")" << (observer ? " as an observer" : "") << ".\n"; + << name_ << "\" (" << id_ << ", " << db_id_ << ")" << (observer ? " as an observer" : "") << "."; user->info().mark_available(id_, name_); user->info().set_status((observer) ? player::OBSERVING : player::PLAYING); @@ -1462,7 +1461,7 @@ bool game::remove_player(player_iterator player, const bool disconnect, const bo ? " at turn: " + lexical_cast_default(current_turn()) + " with reason: '" + termination_reason() + "'" : "") - << (observer ? " as an observer" : "") << (disconnect ? " and disconnected" : "") << ".\n"; + << (observer ? " as an observer" : "") << (disconnect ? " and disconnected" : "") << "."; if(game_ended && started_ && !(observer && destruct)) { send_server_message_to_all(user->info().name() + " ended the game.", player); diff --git a/src/server/wesnothd/server.cpp b/src/server/wesnothd/server.cpp index 77cd59ded74..6c474fb3806 100644 --- a/src/server/wesnothd/server.cpp +++ b/src/server/wesnothd/server.cpp @@ -356,7 +356,7 @@ void server::handle_read_from_fifo(const boost::system::error_code& error, std:: if(!cmd.empty() && cmd.at(0) == '+') { LOG_SERVER << "[admin_command_response]\n" << res << "\n" - << "[/admin_command_response]\n"; + << "[/admin_command_response]"; } else { LOG_SERVER << res; } @@ -603,8 +603,8 @@ void server::dump_stats(const boost::system::error_code& ec) return; } LOG_SERVER << "Statistics:" - << "\tnumber_of_games = " << games().size() << "\tnumber_of_users = " << player_connections_.size() - << "\n"; + << "\tnumber_of_games = " << games().size() + << "\tnumber_of_users = " << player_connections_.size(); start_dump_stats(); } @@ -704,7 +704,7 @@ void server::login_client(boost::asio::yield_context yield, SocketPtr socket) if(accepted_it != accepted_versions_.end()) { LOG_SERVER << log_address(socket) << "\tplayer joined using accepted version " << client_version - << ":\ttelling them to log in.\n"; + << ":\ttelling them to log in."; coro_send_doc(socket, login_response_, yield[ec]); if(check_error(ec, socket)) return; } else { @@ -715,7 +715,7 @@ void server::login_client(boost::asio::yield_context yield, SocketPtr socket) if(utils::wildcard_string_match(client_version, redirect_version.first)) { LOG_SERVER << log_address(socket) << "\tplayer joined using version " << client_version << ":\tredirecting them to " << redirect_version.second["host"] << ":" - << redirect_version.second["port"] << "\n"; + << redirect_version.second["port"]; simple_wml::node& redirect = response.root().add_child("redirect"); for(const auto& attr : redirect_version.second.attribute_range()) { @@ -728,7 +728,7 @@ void server::login_client(boost::asio::yield_context yield, SocketPtr socket) } LOG_SERVER << log_address(socket) << "\tplayer joined using unknown version " << client_version - << ":\trejecting them\n"; + << ":\trejecting them"; // For compatibility with older clients response.set_attr_dup("version", accepted_versions_.begin()->c_str()); @@ -785,7 +785,7 @@ void server::login_client(boost::asio::yield_context yield, SocketPtr socket) ); LOG_SERVER << log_address(socket) << "\t" << username << "\thas logged on" - << (registered ? " to a registered account" : "") << "\n"; + << (registered ? " to a registered account" : ""); std::shared_ptr last_sent; for(const auto& record : player_connections_.get()) { @@ -900,7 +900,7 @@ template bool server::is_login_allowed(boost::asio::yield_conte if(!is_moderator) { LOG_SERVER << log_address(socket) << "\t" << username << "\tis banned by user_handler (" << ban_type_desc - << ")\n"; + << ")"; if(auth_ban.duration) { // Temporary ban async_send_error(socket, "You are banned from this server: " + ban_reason, msg_numeric, {{"duration", ban_duration}}); @@ -911,7 +911,7 @@ template bool server::is_login_allowed(boost::asio::yield_conte return false; } else { LOG_SERVER << log_address(socket) << "\t" << username << "\tis banned by user_handler (" << ban_type_desc - << "), " << "ignoring due to moderator flag\n"; + << "), " << "ignoring due to moderator flag"; } } @@ -1029,7 +1029,7 @@ template bool server::authenticate( // Log the failure LOG_SERVER << log_address(socket) << "\t" - << "Login attempt with incorrect password for nickname '" << username << "'.\n"; + << "Login attempt with incorrect password for nickname '" << username << "'."; return false; } @@ -1218,8 +1218,7 @@ void server::handle_query(player_iterator iter, simple_wml::node& query) response << process_command(command, player.name()); } else if(player.is_moderator()) { if(command == "signout") { - LOG_SERVER << "Admin signed out: IP: " << iter->client_ip() << "\tnick: " << player.name() - << std::endl; + LOG_SERVER << "Admin signed out: IP: " << iter->client_ip() << "\tnick: " << player.name(); player.set_moderator(false); // This string is parsed by the client! response << "You are no longer recognized as an administrator."; @@ -1228,7 +1227,7 @@ void server::handle_query(player_iterator iter, simple_wml::node& query) } } else { LOG_SERVER << "Admin Command: type: " << command << "\tIP: " << iter->client_ip() - << "\tnick: " << player.name() << std::endl; + << "\tnick: " << player.name(); response << process_command(command, player.name()); LOG_SERVER << response.str(); } @@ -1246,8 +1245,7 @@ void server::handle_query(player_iterator iter, simple_wml::node& query) } if(passwd == admin_passwd_) { - LOG_SERVER << "New Admin recognized: IP: " << iter->client_ip() << "\tnick: " << player.name() - << std::endl; + LOG_SERVER << "New Admin recognized: IP: " << iter->client_ip() << "\tnick: " << player.name(); player.set_moderator(true); // This string is parsed by the client! response << "You are now recognized as an administrator."; @@ -1257,7 +1255,7 @@ void server::handle_query(player_iterator iter, simple_wml::node& query) } } else { WRN_SERVER << "FAILED Admin attempt with password: '" << passwd << "'\tIP: " << iter->client_ip() - << "\tnick: " << player.name() << std::endl; + << "\tnick: " << player.name(); response << "Error: wrong password"; } } else { @@ -1311,7 +1309,7 @@ void server::handle_message(player_iterator user, simple_wml::node& message) if(msg.size() >= 3 && simple_wml::string_span(msg.begin(), 4) == "/me ") { LOG_SERVER << user->client_ip() << "\t<" << user->name() - << simple_wml::string_span(msg.begin() + 3, msg.size() - 3) << ">\n"; + << simple_wml::string_span(msg.begin() + 3, msg.size() - 3) << ">"; } else { LOG_SERVER << user->client_ip() << "\t<" << user->name() << "> " << msg; } @@ -1338,7 +1336,7 @@ void server::handle_create_game(player_iterator player, simple_wml::node& create const std::string initial_bans = create_game["ignored"].to_string(); DBG_SERVER << player->client_ip() << "\t" << player->info().name() - << "\tcreates a new game: \"" << game_name << "\".\n"; + << "\tcreates a new game: \"" << game_name << "\"."; // Create the new game, remove the player from the lobby // and set the player as the host/owner. @@ -1413,14 +1411,14 @@ void server::handle_join_game(player_iterator player, simple_wml::node& join) static simple_wml::document leave_game_doc("[leave_game]\n[/leave_game]\n", simple_wml::INIT_COMPRESSED); if(!g) { WRN_SERVER << player->client_ip() << "\t" << player->info().name() - << "\tattempted to join unknown game:\t" << game_id << ".\n"; + << "\tattempted to join unknown game:\t" << game_id << "."; send_to_player(player, leave_game_doc); send_server_message(player, "Attempt to join unknown game.", "error"); send_to_player(player, games_and_users_list_); return; } else if(!g->level_init()) { WRN_SERVER << player->client_ip() << "\t" << player->info().name() - << "\tattempted to join uninitialized game:\t\"" << g->name() << "\" (" << game_id << ").\n"; + << "\tattempted to join uninitialized game:\t\"" << g->name() << "\" (" << game_id << ")."; send_to_player(player, leave_game_doc); send_server_message(player, "Attempt to join an uninitialized game.", "error"); send_to_player(player, games_and_users_list_); @@ -1430,14 +1428,14 @@ void server::handle_join_game(player_iterator player, simple_wml::node& join) } else if(g->player_is_banned(player, player->info().name())) { DBG_SERVER << player->client_ip() << "\tReject banned player: " << player->info().name() - << "\tfrom game:\t\"" << g->name() << "\" (" << game_id << ").\n"; + << "\tfrom game:\t\"" << g->name() << "\" (" << game_id << ")."; send_to_player(player, leave_game_doc); send_server_message(player, "You are banned from this game.", "error"); send_to_player(player, games_and_users_list_); return; } else if(!g->password_matches(password)) { WRN_SERVER << player->client_ip() << "\t" << player->info().name() - << "\tattempted to join game:\t\"" << g->name() << "\" (" << game_id << ") with bad password\n"; + << "\tattempted to join game:\t\"" << g->name() << "\" (" << game_id << ") with bad password"; send_to_player(player, leave_game_doc); send_server_message(player, "Incorrect password.", "error"); send_to_player(player, games_and_users_list_); @@ -1448,7 +1446,7 @@ void server::handle_join_game(player_iterator player, simple_wml::node& join) if(!joined) { WRN_SERVER << player->client_ip() << "\t" << player->info().name() << "\tattempted to observe game:\t\"" << g->name() << "\" (" << game_id - << ") which doesn't allow observers.\n"; + << ") which doesn't allow observers."; send_to_player(player, leave_game_doc); send_server_message(player, @@ -1498,7 +1496,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data // g.level() should then receive the full data for the game. if(!g.level_init()) { LOG_SERVER << p->client_ip() << "\t" << player.name() << "\tcreated game:\t\"" << g.name() << "\" (" - << g.id() << ", " << g.db_id() << ").\n"; + << g.id() << ", " << g.db_id() << ")."; // Update our config object which describes the open games, // and save a pointer to the description in the new game. simple_wml::node* const gamelist = games_and_users_list_.child("gamelist"); @@ -1511,7 +1509,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data m->copy_into(desc); } else { WRN_SERVER << p->client_ip() << "\t" << player.name() << "\tsent scenario data in game:\t\"" - << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") without a 'multiplayer' child.\n"; + << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") without a 'multiplayer' child."; // Set the description so it can be removed in delete_game(). g.set_description(&desc); delete_game(g.id()); @@ -1526,7 +1524,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data desc.set_attr_dup("id", std::to_string(g.id()).c_str()); } else { WRN_SERVER << p->client_ip() << "\t" << player.name() << "\tsent scenario data in game:\t\"" - << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") although it's already initialized.\n"; + << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") although it's already initialized."; return; } @@ -1587,7 +1585,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data // Everything below should only be processed if the game is already initialized. } else if(!g.level_init()) { WRN_SERVER << p->client_ip() << "\tReceived unknown data from: " << player.name() - << " while the scenario wasn't yet initialized.\n" + << " while the scenario wasn't yet initialized." << data.output(); return; // If the host is sending the next scenario data. @@ -1618,7 +1616,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data if(g.description() == nullptr) { ERR_SERVER << p->client_ip() << "\tERROR: \"" << g.name() << "\" (" << g.id() - << ", " << g.db_id() << ") is initialized but has no description_.\n"; + << ", " << g.db_id() << ") is initialized but has no description_."; return; } @@ -1629,7 +1627,7 @@ void server::handle_player_in_game(player_iterator p, simple_wml::document& data m->copy_into(desc); } else { WRN_SERVER << p->client_ip() << "\t" << player.name() << "\tsent scenario data in game:\t\"" - << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") without a 'multiplayer' child.\n"; + << g.name() << "\" (" << g.id() << ", " << g.db_id() << ") without a 'multiplayer' child."; delete_game(g.id()); @@ -2061,7 +2059,7 @@ std::string server::process_command(std::string query, std::string issuer_name) handler(issuer_name, query, parameters, &out); } catch(const std::bad_function_call& ex) { ERR_SERVER << "While handling a command '" << command - << "', caught a std::bad_function_call exception.\n"; + << "', caught a std::bad_function_call exception."; ERR_SERVER << ex.what(); out << "An internal server error occurred (std::bad_function_call) while executing '" << command << "'\n"; @@ -2277,8 +2275,7 @@ void server::adminmsg_handler( const std::string& sender = issuer_name; const std::string& message = parameters; LOG_SERVER << "Admin message: <" << sender - << (message.find("/me ") == 0 ? std::string(message.begin() + 3, message.end()) + ">" : "> " + message) - << "\n"; + << (message.find("/me ") == 0 ? std::string(message.begin() + 3, message.end()) + ">" : "> " + message); simple_wml::document data; simple_wml::node& msg = data.root().add_child("whisper"); @@ -2369,8 +2366,7 @@ void server::msg_handler(const std::string& /*issuer_name*/, LOG_SERVER << "" - : "> " + parameters) - << "\n"; + : "> " + parameters); *out << "message '" << parameters << "' relayed to players"; } @@ -2391,8 +2387,7 @@ void server::lobbymsg_handler(const std::string& /*issuer_name*/, LOG_SERVER << "" - : "> " + parameters) - << "\n"; + : "> " + parameters); *out << "message '" << parameters << "' relayed to players"; } @@ -2893,8 +2888,7 @@ void server::dul_handler(const std::string& /*issuer_name*/, } } catch(const utf8::invalid_utf8_exception& e) { - ERR_SERVER << "While handling dul (deny unregistered logins), caught an invalid utf8 exception: " << e.what() - << std::endl; + ERR_SERVER << "While handling dul (deny unregistered logins), caught an invalid utf8 exception: " << e.what(); } } diff --git a/src/sound.cpp b/src/sound.cpp index 5addb649c93..996b7018a76 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -484,7 +484,7 @@ bool init_sound() << " " << timer_channel << " - timer\n" << " " << source_channel_start << ".." << source_channel_last << " - sound sources\n" << " " << UI_sound_channel_start << ".." << UI_sound_channel_last << " - UI\n" - << " " << UI_sound_channel_last + 1 << ".." << n_of_channels - 1 << " - sound effects\n"; + << " " << UI_sound_channel_last + 1 << ".." << n_of_channels - 1 << " - sound effects"; play_music(); } diff --git a/src/synced_commands.cpp b/src/synced_commands.cpp index 8c51ab855f3..0e48dc79ecc 100644 --- a/src/synced_commands.cpp +++ b/src/synced_commands.cpp @@ -127,7 +127,7 @@ SYNCED_COMMAND_HANDLER_FUNCTION(recruit, child, use_undo, show, error_handler) LOG_REPLAY << "recruit: team=" << current_team_num << " '" << type_id << "' at (" << loc << ") cost=" << u_type->cost() << " from gold=" << beginning_gold << ' ' - << "-> " << current_team.gold() << "\n"; + << "-> " << current_team.gold(); return true; } diff --git a/src/synced_context.cpp b/src/synced_context.cpp index 93c0920821f..7742477a90b 100644 --- a/src/synced_context.cpp +++ b/src/synced_context.cpp @@ -250,7 +250,7 @@ config synced_context::ask_server_choice(const server_choice& sch) { if(!is_synced()) { ERR_REPLAY << "Trying to ask the server for a '" << sch.name() - << "' choice in a unsynced context, doing the choice locally. This can cause OOS.\n"; + << "' choice in a unsynced context, doing the choice locally. This can cause OOS."; return sch.local_choice(); } diff --git a/src/synced_user_choice.cpp b/src/synced_user_choice.cpp index c720e2ee781..a0200123672 100644 --- a/src/synced_user_choice.cpp +++ b/src/synced_user_choice.cpp @@ -191,7 +191,7 @@ config mp_sync::get_user_choice(const std::string &name, const mp_sync::user_cho << " name=" << name << " is_synced=" << is_synced << " is_mp_game=" << is_mp_game - << " is_side_null_controlled=" << is_side_null_controlled << "\n"; + << " is_side_null_controlled=" << is_side_null_controlled; if (is_side_null_controlled) { diff --git a/src/team.cpp b/src/team.cpp index 97cc62aff0c..9afa8262d26 100644 --- a/src/team.cpp +++ b/src/team.cpp @@ -362,7 +362,7 @@ void team::build(const config& cfg, const gamemap& map, int gold) auto_shroud_updates_ = cfg["auto_shroud"].to_bool(auto_shroud_updates_); LOG_NG << "team::team(...): team_name: " << info_.team_name << ", shroud: " << uses_shroud() - << ", fog: " << uses_fog() << ".\n"; + << ", fog: " << uses_fog() << "."; // Load the WML-cleared fog. const config& fog_override = cfg.child("fog_override"); @@ -389,8 +389,7 @@ void team::build(const config& cfg, const gamemap& map, int gold) if(map.is_village(loc)) { villages_.insert(loc); } else { - WRN_NG << "[side] " << current_player() << " [village] points to a non-village location " << loc - << std::endl; + WRN_NG << "[side] " << current_player() << " [village] points to a non-village location " << loc; } } @@ -532,12 +531,10 @@ bool team::calculate_is_enemy(std::size_t index) const for(const std::string& t : our_teams) { if(std::find(their_teams.begin(), their_teams.end(), t) != their_teams.end()) { - LOG_NGE << "team " << info_.side << " found same team name [" << t << "] in team " << index + 1 - << std::endl; + LOG_NGE << "team " << info_.side << " found same team name [" << t << "] in team " << index + 1; return false; } else { - LOG_NGE << "team " << info_.side << " not found same team name [" << t << "] in team " << index + 1 - << std::endl; + LOG_NGE << "team " << info_.side << " not found same team name [" << t << "] in team " << index + 1; } } @@ -808,10 +805,10 @@ void shroud_map::place(int x, int y) if(x >= static_cast(data_.size())) { DBG_NG << "Couldn't place shroud on invalid x coordinate: (" << x << ", " << y - << ") - max x: " << data_.size() - 1 << "\n"; + << ") - max x: " << data_.size() - 1; } else if(y >= static_cast(data_[x].size())) { DBG_NG << "Couldn't place shroud on invalid y coordinate: (" << x << ", " << y - << ") - max y: " << data_[x].size() - 1 << "\n"; + << ") - max y: " << data_[x].size() - 1; } else { data_[x][y] = false; } diff --git a/src/teambuilder.cpp b/src/teambuilder.cpp index 425bb79d631..ecc6c04542a 100644 --- a/src/teambuilder.cpp +++ b/src/teambuilder.cpp @@ -157,15 +157,14 @@ void team_builder::handle_unit(const config& u, const char* origin) << "id=[" << u["id"] << "] " << "placement=[" << u["placement"] << "] " << "x=[" << u["x"] << "] " - << "y=[" << u["y"] << "]" - << std::endl; + << "y=[" << u["y"] << "]"; if(u["type"].empty()) { WRN_NG_TC << "when building level, skipping a unit (id=[" << u["id"] << "]) from " << origin << " with no type information,\n" << "for side:\n" - << side_cfg_.debug() << std::endl; + << side_cfg_.debug(); return; } diff --git a/src/terrain/builder.cpp b/src/terrain/builder.cpp index 9fc3fb26575..914d3a07961 100644 --- a/src/terrain/builder.cpp +++ b/src/terrain/builder.cpp @@ -704,8 +704,7 @@ void terrain_builder::add_images_from_config(rule_imagelist& images, const confi center_x = std::stoi(center[0]); center_y = std::stoi(center[1]); } catch(const std::invalid_argument&) { - ERR_NG << "Invalid 'center' value in terrain image builder: " << center[0] << ", " << center[1] - << "\n"; + ERR_NG << "Invalid 'center' value in terrain image builder: " << center[0] << ", " << center[1]; } } } @@ -822,8 +821,7 @@ void terrain_builder::parse_mapstring( } else if(terrain.base == t_translation::TB_STAR) { add_constraints(br.constraints, map_location(x, y), t_translation::STAR, global_images); } else { - ERR_NG << "Invalid terrain (" << t_translation::write_terrain_code(terrain) << ") in builder map" - << std::endl; + ERR_NG << "Invalid terrain (" << t_translation::write_terrain_code(terrain) << ") in builder map"; assert(false); return; } diff --git a/src/terrain/filter.cpp b/src/terrain/filter.cpp index 1d878aa9813..43957daf813 100644 --- a/src/terrain/filter.cpp +++ b/src/terrain/filter.cpp @@ -391,7 +391,7 @@ bool terrain_filter::match_impl(const map_location& loc, const unit* ref_unit) c std::size_t radius = cfg_["radius"].to_size_t(0); if(radius > max_loop_) { ERR_NG << "terrain_filter: radius greater than " << max_loop_ - << ", restricting\n"; + << ", restricting"; radius = max_loop_; } if ( radius == 0 ) @@ -435,7 +435,7 @@ bool terrain_filter::match_impl(const map_location& loc, const unit* ref_unit) c std::set::const_iterator temp = i; if(++temp != hexes.end()) { ERR_NG << "terrain_filter: loop count greater than " << max_loop_ - << ", aborting\n"; + << ", aborting"; break; } } @@ -586,7 +586,7 @@ void terrain_filter::get_locs_impl(std::set& locs, const unit* ref cache_.adjacent_matches->push_back(adj_set); if(i >= max_loop_ && i+1 < adj_cfgs.size()) { ERR_NG << "terrain_filter: loop count greater than " << max_loop_ - << ", aborting\n"; + << ", aborting"; break; } } @@ -651,7 +651,7 @@ void terrain_filter::get_locs_impl(std::set& locs, const unit* ref std::size_t radius = cfg_["radius"].to_size_t(0); if(radius > max_loop_) { ERR_NG << "terrain_filter: radius greater than " << max_loop_ - << ", restricting\n"; + << ", restricting"; radius = max_loop_; } if(radius > 0) { diff --git a/src/terrain/type_data.cpp b/src/terrain/type_data.cpp index 9b20019dd5f..4c0a1fc7280 100644 --- a/src/terrain/type_data.cpp +++ b/src/terrain/type_data.cpp @@ -42,7 +42,7 @@ void terrain_type_data::lazy_initialization() const { terrain_type terrain(terrain_data); DBG_G << "create_terrain_maps: " << terrain.number() << " " - << terrain.id() << " " << terrain.name() << " : " << terrain.editor_group() << "\n"; + << terrain.id() << " " << terrain.name() << " : " << terrain.editor_group(); std::pair::iterator, bool> res; res = tcodeToTerrain_.emplace(terrain.number(), terrain); @@ -50,7 +50,7 @@ void terrain_type_data::lazy_initialization() const terrain_type& curr = res.first->second; if(terrain == curr) { LOG_G << "Merging terrain " << terrain.number() - << ": " << terrain.id() << " (" << terrain.name() << ")\n"; + << ": " << terrain.id() << " (" << terrain.name() << ")"; std::vector eg1 = utils::split(curr.editor_group()); std::vector eg2 = utils::split(terrain.editor_group()); std::set egs; @@ -69,7 +69,7 @@ void terrain_type_data::lazy_initialization() const LOG_G << "Merged terrain " << terrain.number() << ": " << terrain.id() << " (" << terrain.name() << ") " << "with duplicate editor groups [" << terrain.editor_group() << "] " - << "and [" << curr.editor_group() << "]\n"; + << "and [" << curr.editor_group() << "]"; } curr.set_editor_group(joined); } else { @@ -77,7 +77,7 @@ void terrain_type_data::lazy_initialization() const << "Failed to add terrain " << terrain.id() << " (" << terrain.name() << ") " << "[" << terrain.editor_group() << "]" << "\n" << "which conflicts with " << curr.id() << " (" << curr.name() << ") " - << "[" << curr.editor_group() << "]" << "\n\n"; + << "[" << curr.editor_group() << "]" << "\n"; } } else { terrainList_.push_back(terrain.number()); diff --git a/src/theme.cpp b/src/theme.cpp index 40930f202c9..7c952f3b09f 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -1010,7 +1010,7 @@ const config& theme::get_theme_config(const std::string& id) if (!id.empty()) { // (treat empty id as request for default theme) ERR_DP << "Theme '" << id << "' not found." - << " Falling back to default theme." << std::endl; + << " Falling back to default theme."; } iter = known_themes.find("Default"); diff --git a/src/tooltips.cpp b/src/tooltips.cpp index 67b7bc27271..fe434f6c38f 100644 --- a/src/tooltips.cpp +++ b/src/tooltips.cpp @@ -28,8 +28,6 @@ static lg::log_domain log_font("font"); #define DBG_FT LOG_STREAM(debug, log_font) -using std::endl; - namespace { static const int font_size = font::SIZE_SMALL; @@ -174,7 +172,7 @@ void clear_tooltips(const SDL_Rect& r) for(auto i = tips.begin(); i != tips.end(); ) { if(i->second.origin.overlaps(r)) { DBG_FT << "clearing tip " << i->first << " at " - << i->second.origin << " overlapping " << r << endl; + << i->second.origin << " overlapping " << r; if (i->first == active_tooltip) { i->second.label.undraw(); diff --git a/src/units/frame.cpp b/src/units/frame.cpp index 245b236dc45..07cc1bbdb7c 100644 --- a/src/units/frame.cpp +++ b/src/units/frame.cpp @@ -92,7 +92,7 @@ frame_builder::frame_builder(const config& cfg,const std::string& frame_string) } catch(const std::invalid_argument& e) { // Might be thrown either due to an incorrect number of elements or std::stoul failure. ERR_NG << "Invalid RBG text color in unit animation: " << text_color_key.str() - << "\n" << e.what() << "\n;"; + << "\n" << e.what(); } } @@ -117,7 +117,7 @@ frame_builder::frame_builder(const config& cfg,const std::string& frame_string) } catch(const std::invalid_argument& e) { // Might be thrown either due to an incorrect number of elements or std::stoul failure. ERR_NG << "Invalid RBG blend color in unit animation: " << blend_color_key.str() - << "\n" << e.what() << "\n;"; + << "\n" << e.what(); } } } diff --git a/src/units/map.cpp b/src/units/map.cpp index 8548e48e1c3..29916c40ee6 100644 --- a/src/units/map.cpp +++ b/src/units/map.cpp @@ -169,11 +169,11 @@ unit_map::umap_retval_pair_t unit_map::insert(unit_ptr p) << " (" << loc << ") over " << q->name() << " - " << q->id() << " - " << q->underlying_id() << " (" << q->get_location() - << ").\n"; + << ")."; p->mark_clone(false); ERR_NG << "The new unit was assigned underlying_id=" << p->underlying_id() - << " to prevent duplicate id conflicts.\n"; + << " to prevent duplicate id conflicts."; uinsert = umap_.emplace(p->underlying_id(), upod); @@ -185,7 +185,7 @@ unit_map::umap_retval_pair_t unit_map::insert(unit_ptr p) "and how it happened, please answer the following questions " "\n 1. Were you playing multi-player?" "\n 2. Did you start/restart/reload the game/scenario?" - "\nThank you for your help in fixing this bug.\n"; + "\nThank you for your help in fixing this bug."; } p->mark_clone(false); @@ -404,7 +404,7 @@ bool unit_map::self_check() const if(uit->second.unit && uit->second.unit->underlying_id() != uit->first) { good = false; ERR_NG << "unit_map umap uid(" << uit->first << ") != underlying_id()[" << uit->second.unit->underlying_id() - << "]" << std::endl; + << "]"; } } diff --git a/src/units/race.cpp b/src/units/race.cpp index e6925c4274c..54bc0018244 100644 --- a/src/units/race.cpp +++ b/src/units/race.cpp @@ -100,7 +100,7 @@ unit_race::unit_race(const config& cfg) : << "[race] id='" << id_ << "' is missing a singular name field (either 'name' or both 'male_name' and 'female_name').\n"; ERR_WML << "[race] id'" << id_ - << "' is missing a singular name field (either 'name' or both 'male_name' and 'female_name').\n"; + << "' is missing a singular name field (either 'name' or both 'male_name' and 'female_name')."; } name_generator_factory generator_factory = name_generator_factory(cfg, {"male", "female"}); diff --git a/src/units/types.cpp b/src/units/types.cpp index 129880cae1f..68bde0c525c 100644 --- a/src/units/types.cpp +++ b/src/units/types.cpp @@ -1047,7 +1047,7 @@ void unit_type::fill_variations() std::tie(ut, success) = variations_.emplace(var_cfg["variation_id"].str(), std::move(*var)); if(!success) { ERR_CF << "Skipping duplicate unit variation ID: '" << var_cfg["variation_id"] - << "' of unit_type '" << get_cfg()["id"] << "'\n"; + << "' of unit_type '" << get_cfg()["id"] << "'"; } } diff --git a/src/units/unit.cpp b/src/units/unit.cpp index 9574cdd1578..1b85f5cd527 100644 --- a/src/units/unit.cpp +++ b/src/units/unit.cpp @@ -1162,7 +1162,7 @@ const std::vector unit::advances_to_translated() const result.push_back(adv_type->type_name()); } else { WRN_UT << "unknown unit in advances_to list of type " - << type().log_id() << ": " << adv_type_id << std::endl; + << type().log_id() << ": " << adv_type_id; } } diff --git a/src/variable.cpp b/src/variable.cpp index 35985578a47..391238183bd 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -578,10 +578,10 @@ void scoped_recall_unit::activate() tmp_cfg["x"] = "recall"; tmp_cfg["y"] = "recall"; LOG_NG << "auto-storing $" << name() << " for player: " << player_ - << " at recall index: " << recall_index_ << '\n'; + << " at recall index: " << recall_index_; } else { ERR_NG << "failed to auto-store $" << name() << " for player: " << player_ - << " at recall index: " << recall_index_ << '\n'; + << " at recall index: " << recall_index_; } } else { ERR_NG << "failed to auto-store $" << name() << " for player: " << player_; diff --git a/src/video.cpp b/src/video.cpp index b708445e3ea..dbc2b57a163 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -179,7 +179,7 @@ void CVideo::update_framebuffer_fake() fake_size.x, fake_size.y )); LOG_DP << "updated render target to " << fake_size.x - << "x" << fake_size.y << std::endl; + << "x" << fake_size.y; } pixel_scale_ = 1; @@ -244,7 +244,7 @@ void CVideo::update_framebuffer() if (!preferences::auto_pixel_scale() && scale < preferences::pixel_scale()) { LOG_DP << "reducing pixel scale from desired " << preferences::pixel_scale() << " to maximum allowable " - << scale << std::endl; + << scale; } LOG_DP << "pixel scale: " << scale; LOG_DP << "overriding logical size"; @@ -301,14 +301,14 @@ void CVideo::update_framebuffer() offset_y_ = (osize.y - (scale * lsize.y)) / 2; if (offset_x_ || offset_y_) { LOG_DP << "render target viewport offset: " - << offset_x_ << ", " << offset_y_ << std::endl; + << offset_x_ << ", " << offset_y_; } } void CVideo::init_fake_window() { LOG_DP << "creating fake window " << fake_size.x - << "x" << fake_size.y << std::endl; + << "x" << fake_size.y; uint32_t window_flags = 0; window_flags |= SDL_WINDOW_HIDDEN; @@ -467,7 +467,7 @@ void CVideo::force_render_target(const texture& t) if (SDL_SetRenderTarget(get_renderer(), t)) { ERR_DP << "failed to set render target to " << static_cast(t.get()) << ' ' - << t.draw_size() << " / " << t.get_raw_size() << std::endl; + << t.draw_size() << " / " << t.get_raw_size(); ERR_DP << "last SDL error: " << SDL_GetError(); throw error("failed to set render target"); } @@ -490,7 +490,7 @@ void CVideo::force_render_target(const texture& t) } else { DBG_DP << "rendering to custom target " << static_cast(t.get()) << ' ' - << t.draw_size() << " / " << t.get_raw_size() << std::endl; + << t.draw_size() << " / " << t.get_raw_size(); window->set_logical_size(t.w(), t.h()); } } @@ -552,8 +552,7 @@ void CVideo::render_screen() ERR_DP << "trying to render screen, but current render texture is " << static_cast(SDL_GetRenderTarget(*window)) << " | " << static_cast(current_render_target_.get()) - << ". It should be " << static_cast(render_texture_.get()) - << std::endl; + << ". It should be " << static_cast(render_texture_.get()); throw error("tried to render screen from wrong render target"); } @@ -587,7 +586,7 @@ surface CVideo::read_pixels(SDL_Rect* r) ERR_DP << "render target " << static_cast(target.get()) << ' ' << target.draw_size() << " / " << target.get_raw_size() << " doesn't match window render target " - << static_cast(t) << std::endl; + << static_cast(t); throw error("unexpected render target while reading pixels"); } @@ -607,9 +606,8 @@ surface CVideo::read_pixels(SDL_Rect* r) if (r) { r_clipped.clip(*r); if (r_clipped != *r) { - DBG_DP << "modifying pixel read area\n" - << " from " << *r << "\n" - << " to " << r_clipped << std::endl; + DBG_DP << "modifying pixel read area from " << *r + << " to " << r_clipped; *r = r_clipped; } } @@ -902,7 +900,7 @@ void CVideo::update_buffers() // We could also double-check the resolution here. /*if (preferences::resolution() != current_resolution()) { LOG_DP << "updating resolution from " << current_resolution() - << " to " << preferences::resolution() << std::endl; + << " to " << preferences::resolution(); set_window_mode(TO_RES, preferences::resolution()); }*/ diff --git a/src/wesnothd_connection.cpp b/src/wesnothd_connection.cpp index e12b392cf74..0ca9929546a 100644 --- a/src/wesnothd_connection.cpp +++ b/src/wesnothd_connection.cpp @@ -184,7 +184,7 @@ template auto verbose_verify(Verifier&& verifier) X509_NAME_oneline(X509_get_subject_name(cert), subject_name, 256); bool verified = verifier(preverified, ctx); DBG_NW << "Verifying TLS certificate: " << subject_name << ": " << - (verified ? "verified" : "failed") << std::endl; + (verified ? "verified" : "failed"); BIO* bio = BIO_new(BIO_s_mem()); char buffer[1024]; X509_print(bio, cert); diff --git a/src/whiteboard/attack.cpp b/src/whiteboard/attack.cpp index bde66265638..4304e8ed420 100644 --- a/src/whiteboard/attack.cpp +++ b/src/whiteboard/attack.cpp @@ -154,7 +154,7 @@ void attack::apply_temp_modifier(unit_map& unit_map) assert(get_unit()); unit& unit = *get_unit(); DBG_WB << unit.name() << " [" << unit.id() - << "] has " << unit.attacks_left() << " attacks, decreasing by one" << "\n"; + << "] has " << unit.attacks_left() << " attacks, decreasing by one"; assert(unit.attacks_left() > 0); unit.set_attacks(unit.attacks_left() - 1); @@ -162,7 +162,7 @@ void attack::apply_temp_modifier(unit_map& unit_map) temp_movement_subtracted_ = unit.movement_left() >= attack_movement_cost_ ? attack_movement_cost_ : 0 ; DBG_WB << "Attack: Changing movement points for unit " << unit.name() << " [" << unit.id() << "] from " << unit.movement_left() << " to " - << unit.movement_left() - temp_movement_subtracted_ << ".\n"; + << unit.movement_left() - temp_movement_subtracted_ << "."; unit.set_movement(unit.movement_left() - temp_movement_subtracted_, true); //Update status of fake unit (not undone by remove_temp_modifiers) @@ -178,11 +178,11 @@ void attack::remove_temp_modifier(unit_map& unit_map) assert(get_unit()); unit& unit = *get_unit(); DBG_WB << unit.name() << " [" << unit.id() - << "] has " << unit.attacks_left() << " attacks, increasing by one" << "\n"; + << "] has " << unit.attacks_left() << " attacks, increasing by one"; unit.set_attacks(unit.attacks_left() + 1); DBG_WB << "Attack: Changing movement points for unit " << unit.name() << " [" << unit.id() << "] from " << unit.movement_left() << " to " - << unit.movement_left() + temp_movement_subtracted_ << ".\n"; + << unit.movement_left() + temp_movement_subtracted_ << "."; unit.set_movement(unit.movement_left() + temp_movement_subtracted_, true); temp_movement_subtracted_ = 0; move::remove_temp_modifier(unit_map); diff --git a/src/whiteboard/move.cpp b/src/whiteboard/move.cpp index 7c0ec961861..6697bfb187e 100644 --- a/src/whiteboard/move.cpp +++ b/src/whiteboard/move.cpp @@ -360,10 +360,10 @@ void move::apply_temp_modifier(unit_map& unit_map) //Modify movement points DBG_WB <<"Move: Changing movement points for unit " << unit->name() << " [" << unit->id() << "] from " << unit->movement_left() << " to " - << calculate_moves_left(*unit) << ".\n"; + << calculate_moves_left(*unit) << "."; // Move the unit DBG_WB << "Move: Temporarily moving unit " << unit->name() << " [" << unit->id() - << "] from (" << get_source_hex() << ") to (" << get_dest_hex() <<")\n"; + << "] from (" << get_source_hex() << ") to (" << get_dest_hex() <<")"; mover_.reset(new temporary_unit_mover(unit_map, get_source_hex(), get_dest_hex(), calculate_moves_left(*unit))); //Update status of fake unit (not undone by remove_temp_modifiers) @@ -387,7 +387,7 @@ void move::remove_temp_modifier(unit_map&) } DBG_WB << "Move: Movement points for unit " << unit->name() << " [" << unit->id() << "] should get changed from " << unit->movement_left() << " to " - << calculate_moves_left(*unit) << ".\n"; + << calculate_moves_left(*unit) << "."; } // Restore the unit to its original position and movement. diff --git a/src/whiteboard/recall.cpp b/src/whiteboard/recall.cpp index 8ee8e3efe75..d2e117afbde 100644 --- a/src/whiteboard/recall.cpp +++ b/src/whiteboard/recall.cpp @@ -148,7 +148,7 @@ void recall::apply_temp_modifier(unit_map& unit_map) DBG_WB << "Inserting future recall " << temp_unit_->name() << " [" << temp_unit_->id() - << "] at position " << temp_unit_->get_location() << ".\n"; + << "] at position " << temp_unit_->get_location() << "."; //temporarily remove unit from recall list unit_ptr it = resources::gameboard->teams().at(team_index()).recall_list().extract_if_matches_id(temp_unit_->id(), &original_recall_pos_); diff --git a/src/whiteboard/recruit.cpp b/src/whiteboard/recruit.cpp index e596f919041..a45d654634b 100644 --- a/src/whiteboard/recruit.cpp +++ b/src/whiteboard/recruit.cpp @@ -137,7 +137,7 @@ void recruit::apply_temp_modifier(unit_map& unit_map) temp_unit_->set_location(recruit_hex_); DBG_WB << "Inserting future recruit [" << temp_unit_->id() - << "] at position " << temp_unit_->get_location() << ".\n"; + << "] at position " << temp_unit_->get_location() << "."; // Add cost to money spent on recruits. resources::gameboard->teams().at(team_index()).get_side_actions()->change_gold_spent_by(cost_); diff --git a/src/whiteboard/side_actions.cpp b/src/whiteboard/side_actions.cpp index f359a88905d..76132b18f93 100644 --- a/src/whiteboard/side_actions.cpp +++ b/src/whiteboard/side_actions.cpp @@ -419,7 +419,7 @@ side_actions::iterator side_actions::insert_action(iterator position, action_ptr } iterator valid_position = synced_insert(position, action); LOG_WB << "Inserted into turn #" << get_turn(valid_position) << " at position #" - << actions_.position_in_turn(valid_position) << " : " << action <<"\n"; + << actions_.position_in_turn(valid_position) << " : " << action; resources::whiteboard->validate_viewer_actions(); return valid_position; } @@ -528,7 +528,8 @@ side_actions::iterator side_actions::bump_earlier(side_actions::iterator positio int last_position = turn_size(turn_number) - 1; LOG_WB << "In turn #" << turn_number << ", bumping action #" << action_number << "/" << last_position - << " to position #" << action_number - 1 << "/" << last_position << ".\n"; + << " to position #" << action_number - 1 << "/" << last_position + << "."; if (send_to_net) { resources::whiteboard->queue_net_cmd(team_index_, make_net_cmd_bump_later(position - 1)); diff --git a/src/whiteboard/suppose_dead.cpp b/src/whiteboard/suppose_dead.cpp index 609edaffa7e..7dc716c5333 100644 --- a/src/whiteboard/suppose_dead.cpp +++ b/src/whiteboard/suppose_dead.cpp @@ -118,7 +118,7 @@ void suppose_dead::apply_temp_modifier(unit_map& unit_map) // Remove the unit const unit_const_ptr removed_unit = unit_map.extract(loc_); DBG_WB << "Suppose dead: Temporarily removing unit " << removed_unit->name() << " [" << removed_unit->id() - << "] from (" << loc_ << ")\n"; + << "] from (" << loc_ << ")"; // Just check to make sure we removed the unit we expected to remove assert(get_unit().get() == removed_unit.get()); diff --git a/src/wml_exception.cpp b/src/wml_exception.cpp index 3b69809baf5..1e32eb5772a 100644 --- a/src/wml_exception.cpp +++ b/src/wml_exception.cpp @@ -84,7 +84,7 @@ std::string missing_mandatory_wml_key( } else { WRN_NG << __func__ << " parameter 'section' should contain brackets." - << " Added them.\n"; + << " Added them."; symbols["section"] = "[" + section + "]"; } }