summaryrefslogtreecommitdiff
path: root/src/mmo
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-30 19:30:49 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-30 20:57:13 -0700
commitaa4df026d44bd205f8bfce8a3b8d6a1144332f32 (patch)
tree397692da57b2be8f7c083989ed37fb03308d5b2c /src/mmo
parent7c5c2058e9aea996dc6c76a7e6d9ba4fc2a2bc77 (diff)
downloadtmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.gz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.bz2
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.tar.xz
tmwa-aa4df026d44bd205f8bfce8a3b8d6a1144332f32.zip
Finally get around to decoupling the warning system
Diffstat (limited to 'src/mmo')
-rw-r--r--src/mmo/core.cpp30
-rw-r--r--src/mmo/extract_test.cpp2
-rw-r--r--src/mmo/human_time_diff_test.cpp2
3 files changed, 17 insertions, 17 deletions
diff --git a/src/mmo/core.cpp b/src/mmo/core.cpp
index 444a44c..2264ec6 100644
--- a/src/mmo/core.cpp
+++ b/src/mmo/core.cpp
@@ -62,10 +62,12 @@ sigfunc compat_signal(int signo, sigfunc func)
sact.sa_flags = 0;
if (sigaction(signo, &sact, &oact) < 0)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
+ {
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
return SIG_ERR;
-#pragma GCC diagnostic pop
+ DIAG_POP();
+ }
return oact.sa_handler;
}
@@ -82,10 +84,12 @@ static
void sig_proc(int)
{
for (int i = 1; i < 31; ++i)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
+ {
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
compat_signal(i, SIG_IGN);
-#pragma GCC diagnostic pop
+ DIAG_POP();
+ }
runflag = false;
}
@@ -117,24 +121,24 @@ int main(int argc, char **argv)
// set up exit handlers *after* the initialization has happened.
// This is because term_func is likely to depend on successful init.
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wold-style-cast"
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
compat_signal(SIGPIPE, SIG_IGN);
-#pragma GCC diagnostic pop
+ DIAG_POP();
compat_signal(SIGTERM, sig_proc);
compat_signal(SIGINT, sig_proc);
compat_signal(SIGCHLD, chld_proc);
// 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"
+ DIAG_PUSH();
+ DIAG_I(old_style_cast);
+ DIAG_I(zero_as_null_pointer_constant);
compat_signal(SIGSEGV, SIG_DFL);
compat_signal(SIGBUS, SIG_DFL);
compat_signal(SIGTRAP, SIG_DFL);
compat_signal(SIGILL, SIG_DFL);
compat_signal(SIGFPE, SIG_DFL);
-#pragma GCC diagnostic pop
+ DIAG_POP();
atexit(term_func);
diff --git a/src/mmo/extract_test.cpp b/src/mmo/extract_test.cpp
index 0116f6c..e6dc7b2 100644
--- a/src/mmo/extract_test.cpp
+++ b/src/mmo/extract_test.cpp
@@ -29,8 +29,6 @@
namespace tmwa
{
-#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 590e2b3..c18599d 100644
--- a/src/mmo/human_time_diff_test.cpp
+++ b/src/mmo/human_time_diff_test.cpp
@@ -25,8 +25,6 @@
namespace tmwa
{
-#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant"
-
// a sequence of [-+]?[0-9]+([ay]|m|[jd]|h|mn|s)
TEST(humantimediff, single)