summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/lang-fake.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/lang-fake.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/lang-fake.cc')
-rw-r--r--crawl-ref/source/lang-fake.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/crawl-ref/source/lang-fake.cc b/crawl-ref/source/lang-fake.cc
index 6ded6829ec..f2112fc741 100644
--- a/crawl-ref/source/lang-fake.cc
+++ b/crawl-ref/source/lang-fake.cc
@@ -200,9 +200,9 @@ static const char* cyrillic[][4] =
{0}
};
-static void _replace_cap_variants(std::string &str,
- std::string a,
- std::string b,
+static void _replace_cap_variants(string &str,
+ string a,
+ string b,
const char* not_after = 0,
const char* not_before = 0)
{
@@ -234,7 +234,7 @@ static void _replace_cap_variants(std::string &str,
for (int captype = 0; captype < 3; captype++)
{
- std::string A;
+ string A;
switch (captype)
{
case 0: A = lowercase(a); break;
@@ -244,7 +244,7 @@ static void _replace_cap_variants(std::string &str,
}
size_t pos = 0;
- while ((pos = str.find(A, pos)) != std::string::npos)
+ while ((pos = str.find(A, pos)) != string::npos)
{
if (not_after && pos > 0
&& (yes_after == !strchr(not_after, str[pos - 1])))
@@ -261,7 +261,7 @@ static void _replace_cap_variants(std::string &str,
continue;
}
- std::string B;
+ string B;
switch (captype)
{
case 0: B = lowercase(b); break;
@@ -277,7 +277,7 @@ static void _replace_cap_variants(std::string &str,
}
}
-static void _german(std::string &txt)
+static void _german(string &txt)
{
/*
The European Commission has just announced an agreement whereby English will
@@ -372,9 +372,9 @@ static const char* german[][4] =
{0}
};
-static void _wide(std::string &txt)
+static void _wide(string &txt)
{
- std::string out;
+ string out;
for (size_t i = 0; i < txt.length(); i++)
{
@@ -394,7 +394,7 @@ static void _wide(std::string &txt)
txt = out;
}
-void filter_lang(std::string &str)
+void filter_lang(string &str)
{
const char* (*repl)[4];
@@ -422,7 +422,7 @@ void filter_lang(std::string &str)
_replace_cap_variants(str, (*repl)[0], (*repl)[1], (*repl)[2], (*repl)[3]);
}
-std::string filtered_lang(std::string str)
+string filtered_lang(string str)
{
filter_lang(str);
return str;