diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2012-12-16 17:47:51 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2012-12-24 10:02:00 -0800 |
commit | b52127bcbf817ff8285b36d22198b275327e16bb (patch) | |
tree | 7bc596289c011e719168bef846b8cf63bf5d4947 /src/common/nullpo.cpp | |
parent | 4bd7eeec09629d3c0f900d42c899fe23c69e07b6 (diff) | |
download | tmwa-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.cpp | 19 |
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); |