[asterisk-dev] 0006889: [patch] Convert ast_verbose into macros

Andrey S. Pankov casper at casper.org.ua
Thu Apr 6 16:15:47 MST 2006


Kevin:

Now the macros are:

#define AST_VERBOSE(level, args, ...) \
        do { \
                if (option_verbose >= level) \
                        ast_verbose(args "\n", ## __VA_ARGS__); \
        } while (0)

#define AST_VERBOSE_IF(level, cond, args, ...) \
        do { \
                if ((option_verbose >= level) && (cond)) \
                        ast_verbose(args "\n", ## __VA_ARGS__); \
        } while (0)

Tilghman:

> converts into 4 different macros, each slightly different, for different

Now there are only two macros. Cases when we don't need to add \n at the end
are not frequent. In my conversion effort the only user of AST_VERBOSE_RAW is
config.c because other parts of the code which do not send \n can't be
converted at all (loader.c, asterisk.c).

Regards,
casper



More information about the asterisk-dev mailing list