summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-util.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-08-26 22:50:06 +0200
committerRaphael Langella <raphael.langella@gmail.com>2012-08-26 23:06:30 +0200
commit770bcbd1844b97b671d0e47ea8313cdf2c74c5ea (patch)
treee030cf61afce9ca69b74bb38eb73734bf10f633e /crawl-ref/source/dbg-util.cc
parenta6c16c7f2066c854a01f25e9e6c3d8e44282a638 (diff)
downloadcrawl-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-util.cc')
-rw-r--r--crawl-ref/source/dbg-util.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/crawl-ref/source/dbg-util.cc b/crawl-ref/source/dbg-util.cc
index 74e2379f8f..625950b064 100644
--- a/crawl-ref/source/dbg-util.cc
+++ b/crawl-ref/source/dbg-util.cc
@@ -55,8 +55,8 @@ void debug_dump_levgen()
CrawlHashTable &props = env.properties;
- std::string method;
- std::string type;
+ string method;
+ string type;
if (Generating_Level)
{
@@ -97,19 +97,19 @@ void debug_dump_levgen()
mpr("");
}
-std::string debug_coord_str(const coord_def &pos)
+string debug_coord_str(const coord_def &pos)
{
return make_stringf("(%d, %d)%s", pos.x, pos.y,
!in_bounds(pos) ? " <OoB>" : "");
}
-std::string debug_mon_str(const monster* mon)
+string debug_mon_str(const monster* mon)
{
const int midx = mon->mindex();
if (invalid_monster_index(midx))
return make_stringf("Invalid monster index %d", midx);
- std::string out = "Monster '" + mon->full_name(DESC_PLAIN, true) + "' ";
+ string out = "Monster '" + mon->full_name(DESC_PLAIN, true) + "' ";
out += make_stringf("%s [midx = %d]", debug_coord_str(mon->pos()).c_str(),
midx);
@@ -170,8 +170,7 @@ void debug_dump_mon(const monster* mon, bool recurse)
if (in_bounds(mon->pos()))
{
- std::string feat =
- raw_feature_description(mon->pos());
+ string feat = raw_feature_description(mon->pos());
fprintf(stderr, "On/in/over feature: %s\n\n", feat.c_str());
}
@@ -363,10 +362,10 @@ skill_type skill_from_name(const char *name)
{
skill_type sk = static_cast<skill_type>(i);
- std::string sk_name = lowercase_string(skill_name(sk));
+ string sk_name = lowercase_string(skill_name(sk));
size_t pos = sk_name.find(name);
- if (pos != std::string::npos)
+ if (pos != string::npos)
{
skill = sk;
// We prefer prefixes over partial matches.
@@ -378,7 +377,7 @@ skill_type skill_from_name(const char *name)
return skill;
}
-std::string debug_art_val_str(const item_def& item)
+string debug_art_val_str(const item_def& item)
{
ASSERT(is_artefact(item));