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/notes.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/notes.cc')
-rw-r--r-- | crawl-ref/source/notes.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc index 6d1dace109..511949a6b3 100644 --- a/crawl-ref/source/notes.cc +++ b/crawl-ref/source/notes.cc @@ -27,7 +27,7 @@ #define NOTES_VERSION_NUMBER 1002 -std::vector<Note> note_list; +vector<Note> note_list; // return the real number of the power (casting out nonexistent powers), // starting from 0, or -1 if the power doesn't exist @@ -214,12 +214,12 @@ static const char* _number_to_ordinal(int number) return ordinals[number-1]; } -std::string Note::describe(bool when, bool where, bool what) const +string Note::describe(bool when, bool where, bool what) const { - std::ostringstream result; + ostringstream result; if (when) - result << std::setw(6) << turn << " "; + result << setw(6) << turn << " "; if (where) { @@ -399,9 +399,9 @@ Note::Note(NOTE_TYPES t, int f, int s, const char* n, const char* d) : type(t), first(f), second(s) { if (n) - name = std::string(n); + name = string(n); if (d) - desc = std::string(d); + desc = string(d); turn = you.num_turns; packed_place = get_packed_place(); @@ -421,7 +421,7 @@ void Note::check_milestone() const if (br != -1 && br != BRANCH_WIZLAB) { ASSERT(br >= 0 && br < NUM_BRANCHES); - std::string branch = place_name(packed_place, true, false).c_str(); + string branch = place_name(packed_place, true, false).c_str(); if (branch.find("The ") == 0) branch[0] = tolower(branch[0]); @@ -433,11 +433,11 @@ void Note::check_milestone() const else if (dep == _dungeon_branch_depth(br) || dep == 14 || br == BRANCH_ZIGGURAT) { - std::string level = place_name(packed_place, true, true); + string level = place_name(packed_place, true, true); if (level.find("Level ") == 0) level[0] = tolower(level[0]); - std::ostringstream branch_finale; + ostringstream branch_finale; branch_finale << "reached " << level << "."; mark_milestone(br == BRANCH_ZIGGURAT ? "zig" : dep == 14 ? "br.mid" : "br.end", |