diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2012-08-30 17:37:27 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2012-09-03 16:23:10 -0700 |
commit | 31544d2b6973931be7fdec898ea3672bea831de2 (patch) | |
tree | dcf946429b406f39297404be662b0a840094e477 /src/common/nullpo.cpp | |
parent | 41974ae5265fbc23a06f276f9e008d5dad020e0b (diff) | |
download | tmwa-31544d2b6973931be7fdec898ea3672bea831de2.tar.gz tmwa-31544d2b6973931be7fdec898ea3672bea831de2.tar.bz2 tmwa-31544d2b6973931be7fdec898ea3672bea831de2.tar.xz tmwa-31544d2b6973931be7fdec898ea3672bea831de2.zip |
Fix compiler errors of C++ conversion
Diffstat (limited to 'src/common/nullpo.cpp')
-rw-r--r-- | src/common/nullpo.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/common/nullpo.cpp b/src/common/nullpo.cpp index 6dd2736..67c839f 100644 --- a/src/common/nullpo.cpp +++ b/src/common/nullpo.cpp @@ -3,6 +3,8 @@ #include <string.h> #include "nullpo.hpp" +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, const char *fmt, va_list ap); @@ -26,7 +28,7 @@ bool nullpo_chk (const char *file, int line, const char *func, if (target) return 0; - nullpo_info_core (file, line, func, NULL, NULL); + nullpo_info_core (file, line, func); return 1; } @@ -42,14 +44,11 @@ void nullpo_info_f (const char *file, int line, const char *func, } void nullpo_info (const char *file, int line, const char *func) { - nullpo_info_core (file, line, func, NULL, NULL); + nullpo_info_core (file, line, func); } /// Actual output function -static void nullpo_info_core (const char *file, int line, const char *func, - const char *fmt, va_list ap) __attribute__((format(printf, 4, 0))); -static void nullpo_info_core (const char *file, int line, const char *func, - const char *fmt, va_list ap) +static void nullpo_info_core (const char *file, int line, const char *func) { if (!file) file = "??"; @@ -57,6 +56,12 @@ static void nullpo_info_core (const char *file, int line, const char *func, func = "unknown"; 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, + const char *fmt, va_list ap) +{ + nullpo_info_core(file, line, func); if (fmt && *fmt) { vfprintf (stderr, fmt, ap); |