cleanup previous two find and replace results
Just wanted to remove the empty strings that got created: find . -type f -exec sed -i 's/<< "" <</<</g' '{}' \; find . -type f -exec sed -i 's/<<"" <</<</g' '{}' \; I also unstaged tools/schema/tags.cpp, since I don't think I changed that.
This commit is contained in:
parent
03a956d05c
commit
f09d405629
46 changed files with 84 additions and 84 deletions
|
@ -984,7 +984,7 @@ bool addons_manager_ui(display& disp, const std::string& remote_address)
|
|||
ERR_FS << "io_exception thrown while installing an addon; \"" << e.what() << "\"" << std::endl;
|
||||
gui2::show_error_message(disp.video(), _("A problem occurred when trying to create the files necessary to install this add-on."));
|
||||
} catch(const invalid_pbl_exception& e) {
|
||||
ERR_CFG << "could not read .pbl file " << e.path << ": " << e.message << "" << std::endl;
|
||||
ERR_CFG << "could not read .pbl file " << e.path << ": " << e.message << std::endl;
|
||||
|
||||
utils::string_map symbols;
|
||||
symbols["path"] = e.path;
|
||||
|
|
|
@ -501,7 +501,7 @@ variant formula_ai::execute_variant(const variant& var, ai_context &ai_, bool co
|
|||
} else {
|
||||
//this information is unneded when evaluating formulas form commandline
|
||||
if (!commandline) {
|
||||
ERR_AI << "UNRECOGNIZED MOVE: " << action.to_debug_string() << "" << std::endl;
|
||||
ERR_AI << "UNRECOGNIZED MOVE: " << action.to_debug_string() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ candidate_action_ptr candidate_action_manager::load_candidate_action_from_config
|
|||
} else if( type == "attack") {
|
||||
new_ca = candidate_action_ptr(new attack_candidate_action(name, type, rc_action, function_table ));
|
||||
} else {
|
||||
ERR_AI << "Unknown candidate action type: " << type << "" << std::endl;
|
||||
ERR_AI << "Unknown candidate action type: " << type << std::endl;
|
||||
}
|
||||
} catch(formula_error& e) {
|
||||
ai->handle_exception(e, "Error while registering candidate action '" + name + "'");
|
||||
|
@ -102,7 +102,7 @@ int base_candidate_action::execute_formula(const const_formula_ptr& formula,
|
|||
res = 0;
|
||||
} catch(type_error& e) {
|
||||
res = 0;
|
||||
ERR_AI << "formula type error while evaluating candidate action: " << e.message << "" << std::endl;
|
||||
ERR_AI << "formula type error while evaluating candidate action: " << e.message << std::endl;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -1310,7 +1310,7 @@ private:
|
|||
const map_location dst = convert_variant<location_callable>(args()[2]->evaluate(variables,add_debug_info(fdb,2,"attack:dst")))->loc();
|
||||
const int weapon = args().size() == 4 ? args()[3]->evaluate(variables,add_debug_info(fdb,3,"attack:weapon")).as_int() : -1;
|
||||
if(resources::units->count(move_from) == 0 || resources::units->count(dst) == 0) {
|
||||
ERR_AI << "AI ERROR: Formula produced illegal attack: " << move_from << " -> " << src << " -> " << dst << "" << std::endl;
|
||||
ERR_AI << "AI ERROR: Formula produced illegal attack: " << move_from << " -> " << src << " -> " << dst << std::endl;
|
||||
return variant();
|
||||
}
|
||||
return variant(new attack_callable(move_from, src, dst, weapon));
|
||||
|
|
|
@ -79,7 +79,7 @@ bool stage_unit_formulas::do_play_stage()
|
|||
priority = 0;
|
||||
} catch(type_error& e) {
|
||||
priority = 0;
|
||||
ERR_AI << "formula type error while evaluating unit priority formula " << e.message << "" << std::endl;
|
||||
ERR_AI << "formula type error while evaluating unit priority formula " << e.message << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ const std::vector<std::string> unit_advancements_aspect::get_advancements(const
|
|||
//call function
|
||||
if(lua_pcall(L_, 2, 1, 0) != 0)
|
||||
{
|
||||
ERR_LUA << "LUA Error while evaluating advancements_aspect: " << lua_tostring(L_, -1) << "" << std::endl;
|
||||
ERR_LUA << "LUA Error while evaluating advancements_aspect: " << lua_tostring(L_, -1) << std::endl;
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
if (!lua_isstring(L_, -1))
|
||||
|
|
|
@ -171,7 +171,7 @@ namespace {
|
|||
{
|
||||
config cfg;
|
||||
cfg.add_child("error")["message"] = msg;
|
||||
LOG_CS << "ERROR: "<<msg<<"" << std::endl;
|
||||
LOG_CS << "ERROR: "<<msg<< std::endl;
|
||||
return cfg;
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ namespace {
|
|||
pid_t childpid;
|
||||
|
||||
if((childpid = fork()) == -1) {
|
||||
LOG_CS << "ERROR: fork failed while updating campaign " << addon << "" << std::endl;
|
||||
LOG_CS << "ERROR: fork failed while updating campaign " << addon << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -215,12 +215,12 @@ namespace game_config {
|
|||
}
|
||||
return;
|
||||
} catch(config::error& e) {
|
||||
ERR_CACHE << "cache " << fname << extension << " is corrupt. Loading from files: "<< e.message<<"" << std::endl;
|
||||
ERR_CACHE << "cache " << fname << extension << " is corrupt. Loading from files: "<< e.message<< std::endl;
|
||||
} catch(io_exception&) {
|
||||
ERR_CACHE << "error reading cache " << fname << extension << ". Loading from files" << std::endl;
|
||||
} catch (boost::iostreams::gzip_error& e) {
|
||||
//read_file -> ... -> read_gz can throw this exception.
|
||||
ERR_CACHE << "cache " << fname << extension << " is corrupt. Error code: " << e.error() << "" << std::endl;
|
||||
ERR_CACHE << "cache " << fname << extension << " is corrupt. Error code: " << e.error() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ void editor_action_item_delete::perform_without_undo(map_context& /*mc*/) const
|
|||
{
|
||||
// item_map& items = mc.get_items();
|
||||
// if (!items.erase(loc_)) {
|
||||
// ERR_ED << "Could not delete item on " << loc_.x << "/" << loc_.y << "" << std::endl;
|
||||
// ERR_ED << "Could not delete item on " << loc_.x << "/" << loc_.y << std::endl;
|
||||
// } else {
|
||||
// mc.add_changed_location(loc_);
|
||||
// }
|
||||
|
|
|
@ -71,7 +71,7 @@ void editor_action_unit_delete::perform_without_undo(map_context& mc) const
|
|||
{
|
||||
unit_map& units = mc.get_units();
|
||||
if (!units.erase(loc_)) {
|
||||
ERR_ED << "Could not delete unit on " << loc_.x << "/" << loc_.y << "" << std::endl;
|
||||
ERR_ED << "Could not delete unit on " << loc_.x << "/" << loc_.y << std::endl;
|
||||
} else {
|
||||
mc.add_changed_location(loc_);
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ EXIT_STATUS start(const config& game_conf, CVideo& video, const std::string& fil
|
|||
e = editor.main_loop();
|
||||
}
|
||||
} catch (editor_exception& e) {
|
||||
ERR_ED << "Editor exception in editor::start: " << e.what() << "" << std::endl;
|
||||
ERR_ED << "Editor exception in editor::start: " << e.what() << std::endl;
|
||||
throw;
|
||||
}
|
||||
if (editor_action::get_instance_count() != 0) {
|
||||
|
|
|
@ -935,7 +935,7 @@ void context_manager::reload_map()
|
|||
void context_manager::switch_context(const int index)
|
||||
{
|
||||
if (index < 0 || static_cast<size_t>(index) >= map_contexts_.size()) {
|
||||
WRN_ED << "Invalid index in switch map context: " << index << "" << std::endl;
|
||||
WRN_ED << "Invalid index in switch map context: " << index << std::endl;
|
||||
return;
|
||||
}
|
||||
map_context_refresher mcr(*this, *map_contexts_[index]);
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace editor {
|
|||
|
||||
editor_map_load_exception wrap_exc(const char* type, const std::string& e_msg, const std::string& filename)
|
||||
{
|
||||
WRN_ED << type << " error in load map " << filename << ": " << e_msg << "" << std::endl;
|
||||
WRN_ED << type << " error in load map " << filename << ": " << e_msg << std::endl;
|
||||
utils::string_map symbols;
|
||||
symbols["type"] = type;
|
||||
const char* error_msg = "There was an error ($type) while loading the file:";
|
||||
|
@ -89,30 +89,30 @@ void editor_map::sanity_check()
|
|||
{
|
||||
int errors = 0;
|
||||
if (total_width() != static_cast<int>(tiles_.size())) {
|
||||
ERR_ED << "total_width is " << total_width() << " but tiles_.size() is " << tiles_.size() << "" << std::endl;
|
||||
ERR_ED << "total_width is " << total_width() << " but tiles_.size() is " << tiles_.size() << std::endl;
|
||||
++errors;
|
||||
}
|
||||
if (total_height() != static_cast<int>(tiles_[0].size())) {
|
||||
ERR_ED << "total_height is " << total_height() << " but tiles_[0].size() is " << tiles_.size() << "" << std::endl;
|
||||
ERR_ED << "total_height is " << total_height() << " but tiles_[0].size() is " << tiles_.size() << std::endl;
|
||||
++errors;
|
||||
}
|
||||
if (w() + 2 * border_size() != total_width()) {
|
||||
ERR_ED << "h is " << h_ << " and border_size is " << border_size() << " but total_width is " << total_width() << "" << std::endl;
|
||||
ERR_ED << "h is " << h_ << " and border_size is " << border_size() << " but total_width is " << total_width() << std::endl;
|
||||
++errors;
|
||||
}
|
||||
if (h() + 2 * border_size() != total_height()) {
|
||||
ERR_ED << "w is " << w_ << " and border_size is " << border_size() << " but total_height is " << total_height() << "" << std::endl;
|
||||
ERR_ED << "w is " << w_ << " and border_size is " << border_size() << " but total_height is " << total_height() << std::endl;
|
||||
++errors;
|
||||
}
|
||||
for (size_t i = 1; i < tiles_.size(); ++i) {
|
||||
if (tiles_[i].size() != tiles_[0].size()) {
|
||||
ERR_ED << "tiles_[ " << i << "] has size() " << tiles_[i].size() << " but tiles[0] has size() " << tiles_[0].size() << "" << std::endl;
|
||||
ERR_ED << "tiles_[ " << i << "] has size() " << tiles_[i].size() << " but tiles[0] has size() " << tiles_[0].size() << std::endl;
|
||||
++errors;
|
||||
}
|
||||
}
|
||||
BOOST_FOREACH(const map_location& loc, selection_) {
|
||||
if (!on_board_with_border(loc)) {
|
||||
ERR_ED << "Off-map tile in selection: " << loc << "" << std::endl;
|
||||
ERR_ED << "Off-map tile in selection: " << loc << std::endl;
|
||||
}
|
||||
}
|
||||
if (errors) {
|
||||
|
|
|
@ -85,7 +85,7 @@ brush::brush(const config& cfg)
|
|||
add_relative_location(x, y);
|
||||
}
|
||||
if (relative_tiles_.empty()) {
|
||||
WRN_ED << "Empty brush definition, name=" << name_ << "" << std::endl;
|
||||
WRN_ED << "Empty brush definition, name=" << name_ << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ static TTF_Font* open_font(const std::string& fname, int size)
|
|||
|
||||
TTF_Font* font = TTF_OpenFont(name.c_str(),size);
|
||||
if(font == NULL) {
|
||||
ERR_FT << "Failed opening font: TTF_OpenFont: " << TTF_GetError() << "" << std::endl;
|
||||
ERR_FT << "Failed opening font: TTF_OpenFont: " << TTF_GetError() << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -262,7 +262,7 @@ namespace game_config
|
|||
|
||||
std::string color_string = v["red_green_scale"].str();
|
||||
if(!string2rgb(color_string, red_green_scale)) {
|
||||
ERR_NG << "can't parse color string red_green_scale, ignoring: " << color_string << "" << std::endl;
|
||||
ERR_NG << "can't parse color string red_green_scale, ignoring: " << color_string << std::endl;
|
||||
}
|
||||
if (red_green_scale.empty()) {
|
||||
red_green_scale.push_back(0x00FFFF00);
|
||||
|
@ -270,7 +270,7 @@ namespace game_config
|
|||
|
||||
color_string = v["red_green_scale_text"].str();
|
||||
if(!string2rgb(color_string, red_green_scale_text)) {
|
||||
ERR_NG << "can't parse color string red_green_scale_text, ignoring: " << color_string << "" << std::endl;
|
||||
ERR_NG << "can't parse color string red_green_scale_text, ignoring: " << color_string << std::endl;
|
||||
}
|
||||
if (red_green_scale_text.empty()) {
|
||||
red_green_scale_text.push_back(0x00FFFF00);
|
||||
|
@ -278,7 +278,7 @@ namespace game_config
|
|||
|
||||
color_string = v["blue_white_scale"].str();
|
||||
if(!string2rgb(color_string, blue_white_scale)) {
|
||||
ERR_NG << "can't parse color string blue_white_scale, ignoring: " << color_string << "" << std::endl;
|
||||
ERR_NG << "can't parse color string blue_white_scale, ignoring: " << color_string << std::endl;
|
||||
}
|
||||
if (blue_white_scale.empty()) {
|
||||
blue_white_scale.push_back(0x00FFFFFF);
|
||||
|
@ -286,7 +286,7 @@ namespace game_config
|
|||
|
||||
color_string = v["blue_white_scale_text"].str();
|
||||
if(!string2rgb(color_string, blue_white_scale_text)) {
|
||||
ERR_NG << "can't parse color string blue_white_scale_text, ignoring: " << color_string << "" << std::endl;
|
||||
ERR_NG << "can't parse color string blue_white_scale_text, ignoring: " << color_string << std::endl;
|
||||
}
|
||||
if (blue_white_scale_text.empty()) {
|
||||
blue_white_scale_text.push_back(0x00FFFFFF);
|
||||
|
@ -352,7 +352,7 @@ namespace game_config
|
|||
{
|
||||
std::vector<Uint32> temp;
|
||||
if(!string2rgb(rgb.second, temp)) {
|
||||
ERR_NG << "Invalid color palette: " << rgb.second << "" << std::endl;
|
||||
ERR_NG << "Invalid color palette: " << rgb.second << std::endl;
|
||||
}
|
||||
team_rgb_colors.insert(std::make_pair(rgb.first, temp));
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ namespace game_config
|
|||
std::vector<Uint32> temp;
|
||||
if(!string2rgb(name, temp)) {
|
||||
static std::vector<Uint32> stv;
|
||||
ERR_NG << "Invalid color palette: " << name << "" << std::endl;
|
||||
ERR_NG << "Invalid color palette: " << name << std::endl;
|
||||
return stv;
|
||||
}
|
||||
team_rgb_colors.insert(std::make_pair(name,temp));
|
||||
|
|
|
@ -968,7 +968,7 @@ bool game_controller::play_multiplayer()
|
|||
gui2::show_error_message(disp().video(), _("Error while playing the game: ") + e.message);
|
||||
} catch(network::error& e) {
|
||||
if(e.message != "") {
|
||||
ERR_NET << "caught network::error: " << e.message << "" << std::endl;
|
||||
ERR_NET << "caught network::error: " << e.message << std::endl;
|
||||
gui2::show_transient_message(disp().video()
|
||||
, ""
|
||||
, gettext(e.message.c_str()));
|
||||
|
@ -977,7 +977,7 @@ bool game_controller::play_multiplayer()
|
|||
}
|
||||
} catch(config::error& e) {
|
||||
if(e.message != "") {
|
||||
ERR_CONFIG << "caught config::error: " << e.message << "" << std::endl;
|
||||
ERR_CONFIG << "caught config::error: " << e.message << std::endl;
|
||||
gui2::show_transient_message(disp().video(), "", e.message);
|
||||
} else {
|
||||
ERR_CONFIG << "caught config::error" << std::endl;
|
||||
|
|
|
@ -1970,7 +1970,7 @@ WML_HANDLER_FUNCTION(set_variable, /*event_info*/, cfg)
|
|||
config::attribute_value divide = cfg["divide"];
|
||||
if (!divide.empty()) {
|
||||
if (divide.to_double() == 0) {
|
||||
ERR_NG << "division by zero on variable " << name << "" << std::endl;
|
||||
ERR_NG << "division by zero on variable " << name << std::endl;
|
||||
return;
|
||||
}
|
||||
var = var.to_double() / divide.to_double();
|
||||
|
@ -1979,7 +1979,7 @@ WML_HANDLER_FUNCTION(set_variable, /*event_info*/, cfg)
|
|||
config::attribute_value modulo = cfg["modulo"];
|
||||
if (!modulo.empty()) {
|
||||
if (modulo.to_double() == 0) {
|
||||
ERR_NG << "division by zero on variable " << name << "" << std::endl;
|
||||
ERR_NG << "division by zero on variable " << name << std::endl;
|
||||
return;
|
||||
}
|
||||
var = std::fmod(var.to_double(), modulo.to_double());
|
||||
|
|
|
@ -444,7 +444,7 @@ void handle_event_command(const std::string &cmd,
|
|||
|
||||
if (!resources::lua_kernel->run_wml_action(cmd, cfg, event_info))
|
||||
{
|
||||
ERR_NG << "Couldn't find function for wml tag: "<< cmd <<"" << std::endl;
|
||||
ERR_NG << "Couldn't find function for wml tag: "<< cmd << std::endl;
|
||||
}
|
||||
|
||||
DBG_NG << "done handling command...\n";
|
||||
|
|
|
@ -238,7 +238,7 @@ game_info::game_info(const config& game, const config& game_config)
|
|||
}
|
||||
catch(incorrect_map_format_error& e)
|
||||
{
|
||||
ERR_CF << "illegal map: " << e.message << "" << std::endl;
|
||||
ERR_CF << "illegal map: " << e.message << std::endl;
|
||||
verified = false;
|
||||
}
|
||||
catch(twml_exception& e)
|
||||
|
|
|
@ -2204,7 +2204,7 @@ void chat_handler::change_logging(const std::string& data) {
|
|||
symbols["level"] = level;
|
||||
const std::string& msg =
|
||||
vgettext("Unknown debug level: '$level'.", symbols);
|
||||
ERR_NG << msg << "" << std::endl;
|
||||
ERR_NG << msg << std::endl;
|
||||
add_chat_message(time(NULL), _("error"), 0, msg);
|
||||
return;
|
||||
}
|
||||
|
@ -2213,7 +2213,7 @@ void chat_handler::change_logging(const std::string& data) {
|
|||
symbols["domain"] = domain;
|
||||
const std::string& msg =
|
||||
vgettext("Unknown debug domain: '$domain'.", symbols);
|
||||
ERR_NG << msg << "" << std::endl;
|
||||
ERR_NG << msg << std::endl;
|
||||
add_chat_message(time(NULL), _("error"), 0, msg);
|
||||
return;
|
||||
} else {
|
||||
|
|
|
@ -111,7 +111,7 @@ config initial_level_config(game_display& disp, const mp_game_settings& params,
|
|||
throw config::error(vgettext("Cannot find era $era", i18n_symbols));
|
||||
}
|
||||
// FIXME: @todo We should tell user about missing era but still load game
|
||||
WRN_CF << "Missing era in MP load game " << era << "" << std::endl;
|
||||
WRN_CF << "Missing era in MP load game " << era << std::endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -705,7 +705,7 @@ std::pair<bool, bool> connect_engine::process_network_data(const config& data,
|
|||
|
||||
LOG_NW << "sent player data\n";
|
||||
} else {
|
||||
ERR_CF << "tried to take illegal side: " << side_taken << "" << std::endl;
|
||||
ERR_CF << "tried to take illegal side: " << side_taken << std::endl;
|
||||
|
||||
config response;
|
||||
response["failed"] = true;
|
||||
|
|
|
@ -509,7 +509,7 @@ void ui::process_network_data(const config& data, const network::connection /*so
|
|||
|
||||
void ui::process_network_error(network::error& error)
|
||||
{
|
||||
ERR_NW << "Caught networking error: " << error.message << "" << std::endl;
|
||||
ERR_NW << "Caught networking error: " << error.message << std::endl;
|
||||
|
||||
// Default behavior is to re-throw the error. May be overridden.
|
||||
throw error;
|
||||
|
|
|
@ -551,7 +551,7 @@ connection accept_connection_pending(std::vector<TCPsocket>& pending_sockets,
|
|||
|
||||
const int res = SDLNet_TCP_AddSocket(socket_set,psock);
|
||||
if(res == -1) {
|
||||
ERR_NW << "SDLNet_GetError(): " << SDLNet_GetError() << "" << std::endl;
|
||||
ERR_NW << "SDLNet_GetError(): " << SDLNet_GetError() << std::endl;
|
||||
SDLNet_TCP_Close(psock);
|
||||
|
||||
throw network::error(_("Could not add socket to socket set"));
|
||||
|
@ -619,7 +619,7 @@ connection accept_connection()
|
|||
pending_sockets.push_back(sock);
|
||||
} else {
|
||||
ERR_NW << "Pending socket set is full! Disconnecting " << sock << " connection" << std::endl;
|
||||
ERR_NW << "SDLNet_GetError(): " << SDLNet_GetError() << "" << std::endl;
|
||||
ERR_NW << "SDLNet_GetError(): " << SDLNet_GetError() << std::endl;
|
||||
|
||||
SDLNet_TCP_Close(sock);
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ void connection::cancel()
|
|||
boost::system::error_code ec;
|
||||
socket_.cancel(ec);
|
||||
if(ec) {
|
||||
WRN_NW << "Failed to cancel network operations: " << ec.message() << "" << std::endl;
|
||||
WRN_NW << "Failed to cancel network operations: " << ec.message() << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -538,7 +538,7 @@ static SOCKET_STATE send_file(buffer* buf)
|
|||
SOCKET_STATE result = send_buffer(buf->sock, buf->raw_buffer, 4);
|
||||
|
||||
if (!file_stream->good()) {
|
||||
ERR_NW << "send_file: Couldn't open file " << buf->config_error << "" << std::endl;
|
||||
ERR_NW << "send_file: Couldn't open file " << buf->config_error << std::endl;
|
||||
}
|
||||
if (result != SOCKET_READY)
|
||||
{
|
||||
|
|
|
@ -388,7 +388,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
|
|||
}
|
||||
else
|
||||
{
|
||||
ERR_NW << "found unknown command:\n" << cfg.debug() << "" << std::endl;
|
||||
ERR_NW << "found unknown command:\n" << cfg.debug() << std::endl;
|
||||
}
|
||||
|
||||
return PROCESS_CONTINUE;
|
||||
|
|
|
@ -43,7 +43,7 @@ void playturn_network_adapter::read_from_network()
|
|||
|
||||
if(back.attribute_range().first != back.attribute_range().second )
|
||||
{
|
||||
ERR_NW << "found unexpected attribute:" <<back.debug() << "" << std::endl;
|
||||
ERR_NW << "found unexpected attribute:" <<back.debug() << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -533,7 +533,7 @@ preprocessor_file::preprocessor_file(preprocessor_streambuf &t, std::string cons
|
|||
else {
|
||||
std::istream * file_stream = istream_file(name);
|
||||
if (!file_stream->good()) {
|
||||
ERR_CF << "Could not open file " << name << "" << std::endl;
|
||||
ERR_CF << "Could not open file " << name << std::endl;
|
||||
delete file_stream;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -310,7 +310,7 @@ std::vector< std::string > square_parenthetical_split(std::string const &val,
|
|||
}
|
||||
|
||||
if(!part.empty()){
|
||||
ERR_GENERAL << "Mismatched parenthesis:\n"<<val<<"" << std::endl;;
|
||||
ERR_GENERAL << "Mismatched parenthesis:\n"<<val<< std::endl;;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -433,7 +433,7 @@ std::vector< std::string > parenthetical_split(std::string const &val,
|
|||
res.push_back(new_val);
|
||||
|
||||
if(!part.empty()){
|
||||
ERR_GENERAL << "Mismatched parenthesis:\n"<<val<<"" << std::endl;;
|
||||
ERR_GENERAL << "Mismatched parenthesis:\n"<<val<< std::endl;;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
|
|
@ -519,7 +519,7 @@ static lg::log_domain log_server("server");
|
|||
try {
|
||||
ban = bans_.find(banned::create_dummy(ip));
|
||||
} catch (banned::error& e) {
|
||||
ERR_SERVER << e.message << "" << std::endl;
|
||||
ERR_SERVER << e.message << std::endl;
|
||||
os << e.message;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -802,7 +802,7 @@ void server::run() {
|
|||
metrics_.no_requests();
|
||||
|
||||
} catch(simple_wml::error& e) {
|
||||
WRN_CONFIG << "Warning: error in received data: " << e.message << "" << std::endl;
|
||||
WRN_CONFIG << "Warning: error in received data: " << e.message << std::endl;
|
||||
} catch(network::error& e) {
|
||||
if (e.message == "shut down") {
|
||||
LOG_SERVER << "Try to disconnect all users...\n";
|
||||
|
@ -815,7 +815,7 @@ void server::run() {
|
|||
break;
|
||||
}
|
||||
if (!e.socket) {
|
||||
ERR_SERVER << "network error: " << e.message << "" << std::endl;
|
||||
ERR_SERVER << "network error: " << e.message << std::endl;
|
||||
continue;
|
||||
}
|
||||
DBG_SERVER << "socket closed: " << e.message << "\n";
|
||||
|
@ -902,7 +902,7 @@ void server::run() {
|
|||
// all user_handler exceptions are caught correctly
|
||||
// this can removed.
|
||||
} catch (user_handler::error& e) {
|
||||
ERR_SERVER << "Uncaught user_handler exception: " << e.message << "" << std::endl;
|
||||
ERR_SERVER << "Uncaught user_handler exception: " << e.message << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1269,7 +1269,7 @@ void server::process_query(const network::connection sock,
|
|||
simple_wml::node& query) {
|
||||
const wesnothd::player_map::iterator pl = players_.find(sock);
|
||||
if (pl == players_.end()) {
|
||||
DBG_SERVER << "ERROR: process_query(): Could not find player with socket: " << sock << "" << std::endl;
|
||||
DBG_SERVER << "ERROR: process_query(): Could not find player with socket: " << sock << std::endl;
|
||||
return;
|
||||
}
|
||||
const std::string command(query["type"].to_string());
|
||||
|
@ -1349,7 +1349,7 @@ void server::start_new_server() {
|
|||
// restart_command="./wesnothd-debug -d -c ~/.wesnoth1.5/server.cfg"
|
||||
// remember to make new one as a daemon or it will block old one
|
||||
if (std::system(restart_command.c_str())) {
|
||||
ERR_SERVER << "Failed to start new server with command: " << restart_command << "" << std::endl;
|
||||
ERR_SERVER << "Failed to start new server with command: " << restart_command << std::endl;
|
||||
} else {
|
||||
LOG_SERVER << "New server started with command: " << restart_command << "\n";
|
||||
}
|
||||
|
@ -2016,7 +2016,7 @@ void server::dul_handler(const std::string& /*issuer_name*/, const std::string&
|
|||
void server::process_nickserv(const network::connection sock, simple_wml::node& data) {
|
||||
const wesnothd::player_map::iterator pl = players_.find(sock);
|
||||
if (pl == players_.end()) {
|
||||
DBG_SERVER << "ERROR: Could not find player with socket: " << sock << "" << std::endl;
|
||||
DBG_SERVER << "ERROR: Could not find player with socket: " << sock << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2871,7 +2871,7 @@ int main(int argc, char** argv) {
|
|||
} else if(val == "--request_sample_frequency" && arg+1 != argc) {
|
||||
request_sample_frequency = atoi(argv[++arg]);
|
||||
} else {
|
||||
ERR_SERVER << "unknown option: " << val << "" << std::endl;
|
||||
ERR_SERVER << "unknown option: " << val << std::endl;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -277,7 +277,7 @@ node::node(document& doc, node* parent, const char** str, int depth) :
|
|||
default: {
|
||||
const char* end = strchr(s, '=');
|
||||
if(end == NULL) {
|
||||
ERR_SWML << "attribute: " << s << "" << std::endl;
|
||||
ERR_SWML << "attribute: " << s << std::endl;
|
||||
throw error("did not find '=' after attribute");
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ bool init_sound() {
|
|||
if(!mix_ok) {
|
||||
if(Mix_OpenAudio(preferences::sample_rate(), MIX_DEFAULT_FORMAT, 2, preferences::sound_buffer_size()) == -1) {
|
||||
mix_ok = false;
|
||||
ERR_AUDIO << "Could not initialize audio: " << Mix_GetError() << "" << std::endl;
|
||||
ERR_AUDIO << "Could not initialize audio: " << Mix_GetError() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -356,7 +356,7 @@ void close_sound() {
|
|||
|
||||
int numtimesopened = Mix_QuerySpec(&frequency, &format, &channels);
|
||||
if(numtimesopened == 0) {
|
||||
ERR_AUDIO << "Error closing audio device: " << Mix_GetError() << "" << std::endl;
|
||||
ERR_AUDIO << "Error closing audio device: " << Mix_GetError() << std::endl;
|
||||
}
|
||||
while (numtimesopened) {
|
||||
Mix_CloseAudio();
|
||||
|
@ -378,7 +378,7 @@ void reset_sound() {
|
|||
if (music || sound || bell || UI_sound) {
|
||||
sound::close_sound();
|
||||
if (!sound::init_sound()) {
|
||||
ERR_AUDIO << "Error initializing audio device: " << Mix_GetError() << "" << std::endl;
|
||||
ERR_AUDIO << "Error initializing audio device: " << Mix_GetError() << std::endl;
|
||||
}
|
||||
if (!music)
|
||||
sound::stop_music();
|
||||
|
@ -781,7 +781,7 @@ void play_sound_internal(const std::string& files, channel_group group, unsigned
|
|||
}
|
||||
|
||||
if(res < 0) {
|
||||
ERR_AUDIO << "error playing sound effect: " << Mix_GetError() << "" << std::endl;
|
||||
ERR_AUDIO << "error playing sound effect: " << Mix_GetError() << std::endl;
|
||||
//still keep it in the sound cache, in case we want to try again later
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ set_scontext_synced::~set_scontext_synced()
|
|||
{
|
||||
//if we really get -999 we have a very serious OOS.
|
||||
ERR_REPLAY << "We called random " << new_rng_->get_random_calls() << " times, but the original game called random " << co["random_calls"].to_int(-99) << " times." << std::endl;
|
||||
ERR_REPLAY << co.debug() << "" << std::endl;
|
||||
ERR_REPLAY << co.debug() << std::endl;
|
||||
}
|
||||
|
||||
random_new::generator = old_rng_;
|
||||
|
|
|
@ -377,7 +377,7 @@ void team::build(const config &cfg, const gamemap& map, int gold)
|
|||
if (map.is_village(loc)) {
|
||||
villages_.insert(loc);
|
||||
} else {
|
||||
WRN_NG << "[side] " << name() << " [village] points to a non-village location " << loc << "" << std::endl;
|
||||
WRN_NG << "[side] " << name() << " [village] points to a non-village location " << loc << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -348,7 +348,7 @@ void create_terrain_maps(const config::const_child_itors &cfgs,
|
|||
<< "and [" << curr.editor_group() << "]\n";
|
||||
}
|
||||
} else {
|
||||
ERR_G << "Duplicate terrain code definition found for " << terrain.number() << "" << std::endl;
|
||||
ERR_G << "Duplicate terrain code definition found for " << terrain.number() << std::endl;
|
||||
ERR_G << "Failed to add terrain "
|
||||
<< terrain.id() << " (" << terrain.name() << ") "
|
||||
<< "[" << terrain.editor_group() << "]" << "\n";
|
||||
|
|
|
@ -332,7 +332,7 @@ t_map read_game_map(const std::string& str, std::map<int, coordinate>& starting_
|
|||
width = x + 1;
|
||||
} else {
|
||||
if((x + 1) != width ) {
|
||||
ERR_G << "Map not a rectangle error occurred at line offset " << y << " position offset " << x << "" << std::endl;
|
||||
ERR_G << "Map not a rectangle error occurred at line offset " << y << " position offset " << x << std::endl;
|
||||
throw error("Map not a rectangle.");
|
||||
}
|
||||
if (y > max_map_size()) {
|
||||
|
|
|
@ -115,7 +115,7 @@ condition::WAIT_TIMEOUT_RESULT condition::wait_timeout(const mutex& m, unsigned
|
|||
case 0: return WAIT_OK;
|
||||
case SDL_MUTEX_TIMEDOUT: return WAIT_TIMED_OUT;
|
||||
default:
|
||||
ERR_G << "SDL_CondWaitTimeout: " << SDL_GetError() << "" << std::endl;
|
||||
ERR_G << "SDL_CondWaitTimeout: " << SDL_GetError() << std::endl;
|
||||
return WAIT_ERROR;
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ condition::WAIT_TIMEOUT_RESULT condition::wait_timeout(const mutex& m, unsigned
|
|||
bool condition::notify_one()
|
||||
{
|
||||
if(SDL_CondSignal(cond_) < 0) {
|
||||
ERR_G << "SDL_CondSignal: " << SDL_GetError() << "" << std::endl;
|
||||
ERR_G << "SDL_CondSignal: " << SDL_GetError() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ bool condition::notify_one()
|
|||
bool condition::notify_all()
|
||||
{
|
||||
if(SDL_CondBroadcast(cond_) < 0) {
|
||||
ERR_G << "SDL_CondBroadcast: " << SDL_GetError() << "" << std::endl;
|
||||
ERR_G << "SDL_CondBroadcast: " << SDL_GetError() << std::endl;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -80,7 +80,7 @@ void t_string_base::walker::update()
|
|||
string_.find(TEXTDOMAIN_SEPARATOR, begin_ + 1);
|
||||
|
||||
if(textdomain_end == std::string::npos || textdomain_end >= string_.size() - 1) {
|
||||
ERR_CF << "Error: invalid string: " << string_ << "" << std::endl;
|
||||
ERR_CF << "Error: invalid string: " << string_ << std::endl;
|
||||
begin_ = string_.size();
|
||||
return;
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ void t_string_base::walker::update()
|
|||
}
|
||||
case ID_TRANSLATABLE_PART:
|
||||
if(begin_ + 3 >= string_.size()) {
|
||||
ERR_CF << "Error: invalid string: " << string_ << "" << std::endl;
|
||||
ERR_CF << "Error: invalid string: " << string_ << std::endl;
|
||||
begin_ = string_.size();
|
||||
return;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ void t_string_base::walker::update()
|
|||
|
||||
id = string_[begin_ + 1] + string_[begin_ + 2] * 256;
|
||||
if(id >= id_to_textdomain.size()) {
|
||||
ERR_CF << "Error: invalid string: " << string_ << "" << std::endl;
|
||||
ERR_CF << "Error: invalid string: " << string_ << std::endl;
|
||||
begin_ = string_.size();
|
||||
return;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ void t_string_base::walker::update()
|
|||
end_ = string_.size();
|
||||
|
||||
if(end_ <= begin_ + 1) {
|
||||
ERR_CF << "Error: invalid string: " << string_ << "" << std::endl;
|
||||
ERR_CF << "Error: invalid string: " << string_ << std::endl;
|
||||
begin_ = string_.size();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -2950,7 +2950,7 @@ unit& unit::clone(bool is_temporary)
|
|||
if(pos != std::string::npos && pos+1 < id_.size()
|
||||
&& id_.find_first_not_of("0123456789", pos+1) == std::string::npos) {
|
||||
// this appears to be a duplicate of a generic unit, so give it a new id
|
||||
WRN_UT << "assigning new id to clone of generic unit " << id_ << "" << std::endl;
|
||||
WRN_UT << "assigning new id to clone of generic unit " << id_ << std::endl;
|
||||
id_.clear();
|
||||
set_underlying_id();
|
||||
}
|
||||
|
|
|
@ -999,7 +999,7 @@ effect::effect(const unit_ability_list& list, int def, bool backstab) :
|
|||
}
|
||||
if (const config::attribute_value *v = cfg.get("divide")) {
|
||||
if (*v == 0) {
|
||||
ERR_NG << "division by zero with divide= in ability/weapon special " << effect_id << "" << std::endl;
|
||||
ERR_NG << "division by zero with divide= in ability/weapon special " << effect_id << std::endl;
|
||||
}
|
||||
else {
|
||||
int divide = int(v->to_double() * 100);
|
||||
|
|
|
@ -341,14 +341,14 @@ bool unit_map::self_check() const {
|
|||
for(; uit != umap_.end(); ++uit){
|
||||
if(uit->second.ref_count < 0){
|
||||
good=false;
|
||||
ERR_NG << "unit_map pod ref_count <0 is " << uit->second.ref_count<<"" << std::endl;
|
||||
ERR_NG << "unit_map pod ref_count <0 is " << uit->second.ref_count<< std::endl;
|
||||
}
|
||||
if(uit->second.unit != NULL){
|
||||
uit->second.unit->id(); //crash if bad pointer
|
||||
}
|
||||
if(uit->first <= 0){
|
||||
good=false;
|
||||
ERR_NG << "unit_map umap uid <=0 is " << uit->first <<"" << std::endl;
|
||||
ERR_NG << "unit_map umap uid <=0 is " << uit->first << std::endl;
|
||||
}
|
||||
if(uit->second.unit == NULL && uit->second.ref_count == 0 ){
|
||||
good=false;
|
||||
|
@ -363,11 +363,11 @@ bool unit_map::self_check() const {
|
|||
for(; locit != lmap_.end(); ++locit){
|
||||
if(locit->second == umap_.end() ){
|
||||
good=false;
|
||||
ERR_NG << "unit_map lmap element == umap_.end() "<<"" << std::endl;
|
||||
ERR_NG << "unit_map lmap element == umap_.end() "<< std::endl;
|
||||
}
|
||||
if(locit->first != locit->second->second.unit->get_location()){
|
||||
good=false;
|
||||
ERR_NG << "unit_map lmap location != unit->get_location() " <<"" << std::endl;
|
||||
ERR_NG << "unit_map lmap location != unit->get_location() " << std::endl;
|
||||
}
|
||||
}
|
||||
//assert(good);
|
||||
|
|
|
@ -923,7 +923,7 @@ void unit_type::add_advancement(const unit_type &to_unit,int xp)
|
|||
for(int gender=0; gender<=1; ++gender) {
|
||||
if(gender_types_[gender] == NULL) continue;
|
||||
if(to_unit.gender_types_[gender] == NULL) {
|
||||
WRN_CF << to_unit.log_id() << " does not support gender " << gender << "" << std::endl;
|
||||
WRN_CF << to_unit.log_id() << " does not support gender " << gender << std::endl;
|
||||
continue;
|
||||
}
|
||||
LOG_CONFIG << "gendered advancement " << gender << ": ";
|
||||
|
@ -1182,8 +1182,8 @@ namespace { // Helpers for set_config()
|
|||
return cfg;
|
||||
|
||||
// Bad WML!
|
||||
ERR_CF << "unit type not found: " << key << "" << std::endl;
|
||||
ERR_CF << all_types << "" << std::endl;
|
||||
ERR_CF << "unit type not found: " << key << std::endl;
|
||||
ERR_CF << all_types << std::endl;
|
||||
throw config::error("unit type not found: " + key);
|
||||
}
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ void CVideo::initSDL()
|
|||
const int res = SDL_InitSubSystem(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
|
||||
|
||||
if(res < 0) {
|
||||
ERR_DP << "Could not initialize SDL_video: " << SDL_GetError() << "" << std::endl;
|
||||
ERR_DP << "Could not initialize SDL_video: " << SDL_GetError() << std::endl;
|
||||
throw CVideo::error();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue