summaryrefslogtreecommitdiff
path: root/src/mmo
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-26 18:18:01 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-26 20:45:30 -0700
commitec21450522e3c2124f3510eef5cfd88420483248 (patch)
tree2d3dbd342dccd34bc3545ae3ab7902042abe6815 /src/mmo
parent296629e067563e82b4a08b2a785d1c2f13b5a285 (diff)
downloadtmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.gz
tmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.bz2
tmwa-ec21450522e3c2124f3510eef5cfd88420483248.tar.xz
tmwa-ec21450522e3c2124f3510eef5cfd88420483248.zip
Low hanging fruit
Diffstat (limited to 'src/mmo')
-rw-r--r--src/mmo/core.cpp3
-rw-r--r--src/mmo/extract_test.cpp3
-rw-r--r--src/mmo/human_time_diff_test.cpp3
-rw-r--r--src/mmo/utils.cpp2
-rw-r--r--src/mmo/utils.hpp8
5 files changed, 10 insertions, 9 deletions
diff --git a/src/mmo/core.cpp b/src/mmo/core.cpp
index 21aa5f7..431c0db 100644
--- a/src/mmo/core.cpp
+++ b/src/mmo/core.cpp
@@ -73,7 +73,7 @@ bool runflag = true;
static
void chld_proc(int)
{
- wait(NULL);
+ wait(nullptr);
}
static
void sig_proc(int)
@@ -122,6 +122,7 @@ int main(int argc, char **argv)
// Signal to create coredumps by system when necessary (crash)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
compat_signal(SIGSEGV, SIG_DFL);
compat_signal(SIGBUS, SIG_DFL);
compat_signal(SIGTRAP, SIG_DFL);
diff --git a/src/mmo/extract_test.cpp b/src/mmo/extract_test.cpp
index 126cb14..18d7771 100644
--- a/src/mmo/extract_test.cpp
+++ b/src/mmo/extract_test.cpp
@@ -26,6 +26,9 @@
#include "../poison.hpp"
+
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+
TEST(extract, record_int)
{
int x, y, z;
diff --git a/src/mmo/human_time_diff_test.cpp b/src/mmo/human_time_diff_test.cpp
index d036537..3ace280 100644
--- a/src/mmo/human_time_diff_test.cpp
+++ b/src/mmo/human_time_diff_test.cpp
@@ -22,6 +22,9 @@
#include "../poison.hpp"
+
+#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
+
// a sequence of [-+]?[0-9]+([ay]|m|[jd]|h|mn|s)
TEST(humantimediff, single)
diff --git a/src/mmo/utils.cpp b/src/mmo/utils.cpp
index 30f60b1..2199c33 100644
--- a/src/mmo/utils.cpp
+++ b/src/mmo/utils.cpp
@@ -96,7 +96,7 @@ void stamp_time(timestamp_seconds_buffer& out, const TimeT *t)
void stamp_time(timestamp_milliseconds_buffer& out)
{
struct timeval tv;
- gettimeofday(&tv, NULL);
+ gettimeofday(&tv, nullptr);
struct tm when = TimeT(tv.tv_sec);
char buf[24];
strftime(buf, 20, "%Y-%m-%d %H:%M:%S", &when);
diff --git a/src/mmo/utils.hpp b/src/mmo/utils.hpp
index ddfbca6..f8e84fe 100644
--- a/src/mmo/utils.hpp
+++ b/src/mmo/utils.hpp
@@ -84,7 +84,7 @@ struct TimeT : Comparable
TimeT now()
{
// poisoned, but this is still in header-land
- return time(NULL);
+ return time(nullptr);
}
bool error() const
@@ -103,12 +103,6 @@ long long convert_for_printf(TimeT t)
return t.value;
}
-inline
-long long& convert_for_scanf(TimeT& t)
-{
- return t.value;
-}
-
// 2038 problem
inline __attribute__((warn_unused_result))
bool native_to_network(Little32 *net, TimeT nat)