summaryrefslogtreecommitdiff
path: root/src/mmo/utils.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-04-14 11:02:47 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-04-14 11:32:36 -0700
commit56e149a51562b9d2620bc9037a81735c29ea95af (patch)
tree3a4bd218f69c5cbfec0dd8dcada34413c0ddc715 /src/mmo/utils.cpp
parent1a1bfc8fd8a3613bf7d3c320dcaff29a9402f50c (diff)
downloadtmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.gz
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.bz2
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.tar.xz
tmwa-56e149a51562b9d2620bc9037a81735c29ea95af.zip
Ditch gcc 4.6 support
Diffstat (limited to 'src/mmo/utils.cpp')
-rw-r--r--src/mmo/utils.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mmo/utils.cpp b/src/mmo/utils.cpp
index a1316d1..5765eaf 100644
--- a/src/mmo/utils.cpp
+++ b/src/mmo/utils.cpp
@@ -57,9 +57,9 @@ bool e_mail_check(XString email)
return 0;
if (hostname.front() == '.' || hostname.back() == '.')
return 0;
- if (hostname.contains_seq(".."))
+ if (hostname.contains_seq(".."_s))
return 0;
- if (email.contains_any(" ;"))
+ if (email.contains_any(" ;"_s))
return 0;
return email.is_print();
}
@@ -70,18 +70,18 @@ bool e_mail_check(XString email)
//-------------------------------------------------
int config_switch(ZString str)
{
- if (str == "true" || str == "on" || str == "yes"
- || str == "oui" || str == "ja"
- || str == "si")
+ if (str == "true"_s || str == "on"_s || str == "yes"_s
+ || str == "oui"_s || str == "ja"_s
+ || str == "si"_s)
return 1;
- if (str == "false" || str == "off" || str == "no"
- || str == "non" || str == "nein")
+ if (str == "false"_s || str == "off"_s || str == "no"_s
+ || str == "non"_s || str == "nein"_s)
return 0;
int rv;
if (extract(str, &rv))
return rv;
- FPRINTF(stderr, "Fatal: bad option value %s", str);
+ FPRINTF(stderr, "Fatal: bad option value %s"_fmt, str);
abort();
}
@@ -93,7 +93,7 @@ void stamp_time(timestamp_seconds_buffer& out, const TimeT *t)
struct tm when = t ? *t : TimeT::now();
char buf[20];
strftime(buf, 20, "%Y-%m-%d %H:%M:%S", &when);
- out = stringish<timestamp_seconds_buffer>(const_(buf));
+ out = stringish<timestamp_seconds_buffer>(VString<19>(strings::really_construct_from_a_pointer, buf));
}
void stamp_time(timestamp_milliseconds_buffer& out)
{
@@ -103,7 +103,7 @@ void stamp_time(timestamp_milliseconds_buffer& out)
char buf[24];
strftime(buf, 20, "%Y-%m-%d %H:%M:%S", &when);
sprintf(buf + 19, ".%03d", static_cast<int>(tv.tv_usec / 1000));
- out = stringish<timestamp_milliseconds_buffer>(const_(buf));
+ out = stringish<timestamp_milliseconds_buffer>(VString<23>(strings::really_construct_from_a_pointer, buf));
}
void log_with_timestamp(io::WriteFile& out, XString line)