diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 23:53:33 +0200 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2012-09-26 23:53:33 +0200 |
commit | 24618c56527b7180feaf858b3a1c7990f4cd7105 (patch) | |
tree | edc13fe91ef4e54209ccc8f4541cd7cc96524a48 /osc_server.h | |
parent | e8db95ccb2ac16055e0af1177f69127da40f52de (diff) | |
download | osc-graphics-24618c56527b7180feaf858b3a1c7990f4cd7105.tar.gz |
let the compiler check format-strings and params in OSCServer::add/del_method() calls
also allow add_method() with NULL format string
Diffstat (limited to 'osc_server.h')
-rw-r--r-- | osc_server.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/osc_server.h b/osc_server.h index b14dfa8..2380028 100644 --- a/osc_server.h +++ b/osc_server.h @@ -37,7 +37,8 @@ public: private: void add_method_v(MethodHandlerId **hnd, const char *types, lo_method_handler handler, void *data, - const char *fmt, va_list ap); + const char *fmt, va_list ap) + __attribute__((format(printf, 6, 0))); public: typedef void (*MethodHandlerCb)(Layer *obj, lo_arg **argv); @@ -62,6 +63,7 @@ public: add_method(MethodHandlerId **hnd, const char *types, lo_method_handler handler, void *data, const char *fmt, ...) + __attribute__((format(printf, 6, 7))) { va_list ap; va_start(ap, fmt); @@ -72,6 +74,7 @@ public: add_method(const char *types, lo_method_handler handler, void *data, const char *fmt, ...) + __attribute__((format(printf, 5, 6))) { va_list ap; va_start(ap, fmt); @@ -79,7 +82,8 @@ public: va_end(ap); } - void del_method(const char *types, const char *fmt, ...); + void del_method(const char *types, const char *fmt, ...) + __attribute__((format(printf, 3, 4))); inline void del_method(MethodHandlerId *hnd) { |