aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-03-06 20:21:51 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-03-07 22:41:47 +1000
commitced6d20295a8263757d57c02a07ffcb66688a163 (patch)
treea44527357c1ffccb88bf479686735aef168d15c1 /src/util
parenta603a767877b94b4d3bc4d3de8d762fbc56a583d (diff)
downloadminetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.gz
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.tar.bz2
minetest-ced6d20295a8263757d57c02a07ffcb66688a163.zip
For usages of assert() that are meant to persist in Release builds (when NDEBUG is defined), replace those usages with persistent alternatives
Diffstat (limited to 'src/util')
-rw-r--r--src/util/serialize.cpp2
-rw-r--r--src/util/string.cpp9
2 files changed, 4 insertions, 7 deletions
diff --git a/src/util/serialize.cpp b/src/util/serialize.cpp
index 8a108a0ff..659e816b0 100644
--- a/src/util/serialize.cpp
+++ b/src/util/serialize.cpp
@@ -31,7 +31,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// Creates a string with the length as the first two bytes
std::string serializeString(const std::string &plain)
{
- //assert(plain.size() <= 65535);
if(plain.size() > 65535)
throw SerializationError("String too long for serializeString");
char buf[2];
@@ -45,7 +44,6 @@ std::string serializeString(const std::string &plain)
// Creates a string with the length as the first two bytes from wide string
std::string serializeWideString(const std::wstring &plain)
{
- //assert(plain.size() <= 65535);
if(plain.size() > 65535)
throw SerializationError("String too long for serializeString");
char buf[2];
diff --git a/src/util/string.cpp b/src/util/string.cpp
index 651293bfe..02a0586e7 100644
--- a/src/util/string.cpp
+++ b/src/util/string.cpp
@@ -320,7 +320,7 @@ char *mystrtok_r(char *s, const char *sep, char **lasts)
}
t++;
}
-
+
*lasts = t;
return s;
}
@@ -329,15 +329,15 @@ u64 read_seed(const char *str)
{
char *endptr;
u64 num;
-
+
if (str[0] == '0' && str[1] == 'x')
num = strtoull(str, &endptr, 16);
else
num = strtoull(str, &endptr, 10);
-
+
if (*endptr)
num = murmur_hash_64_ua(str, (int)strlen(str), 0x1337);
-
+
return num;
}
@@ -614,4 +614,3 @@ void str_replace(std::string &str, char from, char to)
{
std::replace(str.begin(), str.end(), from, to);
}
-