diff options
author | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 22:50:06 +0200 |
---|---|---|
committer | Raphael Langella <raphael.langella@gmail.com> | 2012-08-26 23:06:30 +0200 |
commit | 770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch) | |
tree | e030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/dbg-asrt.cc | |
parent | a6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff) | |
download | crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.tar.gz crawl-ref-770bcbd1844b97b671d0e47ea8313cdf2c74c5ea.zip |
Use std namespace.
I had to rename distance() (in coord.h) to distance2() because it conflicts
with the STL function to compare 2 iterators. Not a bad change given how it
returns the square of the distance anyway.
I also had to rename the message global variable (in message.cc) to buffer.
I tried to fix and improve the coding style has much as I could, but I
probably missed a few given how huge and tedious it is.
I also didn't touch crawl-gdb.py, and the stuff in prebuilt, rltiles/tool
and util/levcomp.*, because I have no clue about those.
Diffstat (limited to 'crawl-ref/source/dbg-asrt.cc')
-rw-r--r-- | crawl-ref/source/dbg-asrt.cc | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/crawl-ref/source/dbg-asrt.cc b/crawl-ref/source/dbg-asrt.cc index fc8e3a7afd..a25ebd86a8 100644 --- a/crawl-ref/source/dbg-asrt.cc +++ b/crawl-ref/source/dbg-asrt.cc @@ -78,11 +78,11 @@ #endif -static std::string _assert_msg; +static string _assert_msg; static void _dump_compilation_info(FILE* file) { - std::string comp_info = compilation_info(); + string comp_info = compilation_info(); if (!comp_info.empty()) { fprintf(file, "Compilation info:\n"); @@ -99,7 +99,7 @@ static void _dump_level_info(FILE* file) fprintf(file, "branch = %d, depth = %d\n\n", (int)you.where_are_you, you.depth); - std::string place = level_id::current().describe(); + string place = level_id::current().describe(); fprintf(file, "Level id: %s\n", place.c_str()); @@ -208,7 +208,7 @@ static void _dump_player(FILE *file) you.skills[sk], you.skill_points[sk], you.skill_points[sk] - needed_min, - std::max(needed_max - needed_min, 0)); + max(needed_max - needed_min, 0)); } fprintf(file, "\n"); @@ -295,7 +295,7 @@ static void _dump_player(FILE *file) else if (!item.defined()) continue; - const std::string name = item.name(DESC_PLAIN, false, true); + const string name = item.name(DESC_PLAIN, false, true); if (item.link != i) { @@ -333,7 +333,7 @@ static void _dump_player(FILE *file) } const bool unknown = !item_type_known(you.inv[eq]); const bool melded = you.melded[i]; - std::string suffix = ""; + string suffix = ""; if (unknown || melded) { suffix = " ("; @@ -373,7 +373,7 @@ static void _dump_player(FILE *file) static void _debug_marker_scan() { - std::vector<map_marker*> markers = env.markers.get_all(); + vector<map_marker*> markers = env.markers.get_all(); for (unsigned int i = 0; i < markers.size(); ++i) { @@ -401,8 +401,7 @@ static void _debug_marker_scan() } bool found = false; - std::vector<map_marker*> at_pos - = env.markers.get_markers_at(marker->pos); + vector<map_marker*> at_pos = env.markers.get_markers_at(marker->pos); for (unsigned int j = 0; j < at_pos.size(); ++j) { @@ -426,7 +425,7 @@ static void _debug_marker_scan() const coord_def end(GXM - MAPGEN_BORDER - 2, GYM - MAPGEN_BORDER - 2); for (rectangle_iterator ri(start, end); ri; ++ri) { - std::vector<map_marker*> at_pos = env.markers.get_markers_at(*ri); + vector<map_marker*> at_pos = env.markers.get_markers_at(*ri); for (unsigned int i = 0; i < at_pos.size(); ++i) { @@ -457,7 +456,7 @@ static void _debug_marker_scan() static void _debug_dump_markers() { - std::vector<map_marker*> markers = env.markers.get_all(); + vector<map_marker*> markers = env.markers.get_all(); for (unsigned int i = 0; i < markers.size(); ++i) { @@ -474,7 +473,7 @@ static void _debug_dump_markers() static void _debug_dump_lua_markers(FILE *file) { - std::vector<map_marker*> markers = env.markers.get_all(); + vector<map_marker*> markers = env.markers.get_all(); for (unsigned int i = 0; i < markers.size(); ++i) { @@ -485,7 +484,7 @@ static void _debug_dump_lua_markers(FILE *file) map_lua_marker* lua_marker = dynamic_cast<map_lua_marker*>(marker); - std::string result = lua_marker->debug_to_string(); + string result = lua_marker->debug_to_string(); if (!result.empty() && result[result.size() - 1] == '\n') result = result.substr(0, result.size() - 1); @@ -502,7 +501,7 @@ static void _debug_dump_lua_persist(FILE* file) { lua_stack_cleaner cln(dlua); - std::string result; + string result; if (!dlua.callfn("persist_to_string", 0, 1)) { result = make_stringf("error (persist_to_string): %s", @@ -590,9 +589,9 @@ void do_crash_dump() return; } - std::string dir = (!Options.morgue_dir.empty() ? Options.morgue_dir : - !SysEnv.crawl_dir.empty() ? SysEnv.crawl_dir - : ""); + string dir = (!Options.morgue_dir.empty() ? Options.morgue_dir : + !SysEnv.crawl_dir.empty() ? SysEnv.crawl_dir + : ""); if (!dir.empty() && dir[dir.length() - 1] != FILE_SEPARATOR) dir += FILE_SEPARATOR; @@ -663,7 +662,7 @@ void do_crash_dump() { fprintf(file, "\nMessages:\n"); fprintf(file, "<<<<<<<<<<<<<<<<<<<<<<\n"); - std::string messages = get_last_messages(NUM_STORED_MESSAGES); + string messages = get_last_messages(NUM_STORED_MESSAGES); fprintf(file, "%s", messages.c_str()); fprintf(file, ">>>>>>>>>>>>>>>>>>>>>>\n"); } |