From bf84177a4c8d998ecfdd05a7c0ae4350461e36fa Mon Sep 17 00:00:00 2001 From: MelwareDE Date: Wed, 11 Mar 2009 09:10:04 +0000 Subject: [PATCH] Clean up, prepare additional optimizations --- chan_capi_utils.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/chan_capi_utils.h b/chan_capi_utils.h index 74bf640..b5ec74b 100644 --- a/chan_capi_utils.h +++ b/chan_capi_utils.h @@ -20,14 +20,21 @@ extern char *emptyid; extern void cc_verbose_internal(char *text, ...); +static inline int cc_verbose_check(int o_v, int c_d) { + if ((o_v == 0) || (option_verbose > o_v)) { + if ((!c_d) || ((c_d) && (capidebug))) { + return (1); + } + } + return (0); +} + /* * helper for _verbose with different verbose settings */ #define cc_verbose(o_v,c_d,text, args...) do { \ - if ((o_v == 0) || (option_verbose > o_v)) { \ - if ((!c_d) || ((c_d) && (capidebug))) { \ + if (cc_verbose_check(o_v, c_d) != 0) { \ cc_verbose_internal(text , ## args); \ - } \ } \ }while(0)