diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-03-27 21:43:33 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-05-07 21:59:19 -0700 |
commit | 531464bd72779a7b7bf45b461ca67301b95e6ba9 (patch) | |
tree | dca3041eb9f4f5b6cbed1f30e3426f7c053ae667 /util | |
parent | c29f25d74835188d04028a847ddefe68548e6350 (diff) | |
download | gjs-531464bd72779a7b7bf45b461ca67301b95e6ba9.tar.gz |
build: Introduce "used only in debug" annotations
In some places we have function arguments that are used only in a
gjs_debug_foo() call which is normally #ifdef'd out unless using verbose
debug logging. In order to avoid "unused parameter" warnings, we
introduce annotations to mark that these arguments are only used during
verbose debug logging.
Diffstat (limited to 'util')
-rw-r--r-- | util/log.h | 60 |
1 files changed, 42 insertions, 18 deletions
@@ -103,45 +103,69 @@ typedef enum { #endif #if GJS_VERBOSE_ENABLE_PROPS -#define gjs_debug_jsprop(topic, ...) \ - do { gjs_debug(topic, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_PROPS +# define gjs_debug_jsprop(topic, ...) \ + do { \ + gjs_debug(topic, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_jsprop(topic, ...) ((void)0) +# define GJS_USED_VERBOSE_PROPS G_GNUC_UNUSED +# define gjs_debug_jsprop(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_MARSHAL -#define gjs_debug_marshal(topic, ...) \ - do { gjs_debug(topic, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_MARSHAL +# define gjs_debug_marshal(topic, ...) \ + do { \ + gjs_debug(topic, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_marshal(topic, ...) ((void)0) +# define GJS_USED_VERBOSE_MARSHAL G_GNUC_UNUSED +# define gjs_debug_marshal(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_LIFECYCLE -#define gjs_debug_lifecycle(topic, ...) \ - do { gjs_debug(topic, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_LIFECYCLE +# define gjs_debug_lifecycle(topic, ...) \ + do { \ + gjs_debug(topic, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_lifecycle(topic, ...) ((void)0) +# define GJS_USED_VERBOSE_LIFECYCLE G_GNUC_UNUSED +# define gjs_debug_lifecycle(topic, ...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GI_USAGE -#define gjs_debug_gi_usage(...) \ - do { gjs_debug(GJS_DEBUG_GI_USAGE, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_GI_USAGE +# define gjs_debug_gi_usage(...) \ + do { \ + gjs_debug(GJS_DEBUG_GI_USAGE, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_gi_usage(...) ((void)0) +# define GJS_USED_VERBOSE_GI_USAGE G_GNUC_UNUSED +# define gjs_debug_gi_usage(...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GCLOSURE -#define gjs_debug_closure(...) \ - do { gjs_debug(GJS_DEBUG_GCLOSURE, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_GCLOSURE +# define gjs_debug_closure(...) \ + do { \ + gjs_debug(GJS_DEBUG_GCLOSURE, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_closure(...) ((void)0) +# define GJS_USED_VERBOSE_GCLOSURE G_GNUC_UNUSED +# define gjs_debug_closure(...) ((void)0) #endif #if GJS_VERBOSE_ENABLE_GSIGNAL -#define gjs_debug_gsignal(...) \ - do { gjs_debug(GJS_DEBUG_GOBJECT, __VA_ARGS__); } while(0) +# define GJS_USED_VERBOSE_GSIGNAL +# define gjs_debug_gsignal(...) \ + do { \ + gjs_debug(GJS_DEBUG_GOBJECT, __VA_ARGS__); \ + } while (0) #else -#define gjs_debug_gsignal(...) ((void)0) +# define GJS_USED_VERBOSE_GSIGNAL G_GNUC_UNUSED +# define gjs_debug_gsignal(...) ((void)0) #endif void gjs_debug(GjsDebugTopic topic, |