summaryrefslogtreecommitdiff
path: root/src/common/nullpo.cpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2012-12-16 17:47:51 -0800
committerBen Longbons <b.r.longbons@gmail.com>2012-12-24 10:02:00 -0800
commitb52127bcbf817ff8285b36d22198b275327e16bb (patch)
tree7bc596289c011e719168bef846b8cf63bf5d4947 /src/common/nullpo.cpp
parent4bd7eeec09629d3c0f900d42c899fe23c69e07b6 (diff)
downloadtmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.gz
tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.bz2
tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.tar.xz
tmwa-b52127bcbf817ff8285b36d22198b275327e16bb.zip
Cleanup headers and remove all uses of va_list except logging
Diffstat (limited to 'src/common/nullpo.cpp')
-rw-r--r--src/common/nullpo.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/common/nullpo.cpp b/src/common/nullpo.cpp
index ad52009..53ed37d 100644
--- a/src/common/nullpo.cpp
+++ b/src/common/nullpo.cpp
@@ -1,11 +1,14 @@
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
#include "nullpo.hpp"
-static void nullpo_info_core(const char *file, int line, const char *func);
+#include <cstdarg> // exception to "no va_list" rule
+#include <cstdio>
+#include <cstring>
+
+static
+void nullpo_info_core(const char *file, int line, const char *func);
__attribute__((format(printf, 4, 0)))
-static void nullpo_info_core(const char *file, int line, const char *func,
+static
+void nullpo_info_core(const char *file, int line, const char *func,
const char *fmt, va_list ap);
/// Null check and print format
@@ -48,7 +51,8 @@ void nullpo_info(const char *file, int line, const char *func)
}
/// Actual output function
-static void nullpo_info_core(const char *file, int line, const char *func)
+static
+void nullpo_info_core(const char *file, int line, const char *func)
{
if (!file)
file = "??";
@@ -58,7 +62,8 @@ static void nullpo_info_core(const char *file, int line, const char *func)
fprintf(stderr, "%s:%d: in func `%s': NULL pointer\n", file, line, func);
}
-static void nullpo_info_core(const char *file, int line, const char *func,
+static
+void nullpo_info_core(const char *file, int line, const char *func,
const char *fmt, va_list ap)
{
nullpo_info_core(file, line, func);