From ec21450522e3c2124f3510eef5cfd88420483248 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Thu, 26 Jun 2014 18:18:01 -0700 Subject: Low hanging fruit --- src/mmo/core.cpp | 3 ++- src/mmo/extract_test.cpp | 3 +++ src/mmo/human_time_diff_test.cpp | 3 +++ src/mmo/utils.cpp | 2 +- src/mmo/utils.hpp | 8 +------- 5 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mmo') 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) -- cgit v1.2.3-60-g2f50