From fd4918101e0878be9d399a344511253f5867a646 Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Sun, 13 Sep 2015 21:32:27 +0200 Subject: log: Enable varargs format warnings Decorate srd_log() with the GCC format printf attribute so that the compiler can check the format string and arguments for consistency. Also remove the srd_err(), sr_warn(), etc. functions and replace them with macro wrappers around srd_log(). --- log.c | 65 ----------------------------------------------------------------- 1 file changed, 65 deletions(-) (limited to 'log.c') diff --git a/log.c b/log.c index d9030c2..f2ef818 100644 --- a/log.c +++ b/log.c @@ -181,69 +181,4 @@ SRD_PRIV int srd_log(int loglevel, const char *format, ...) return ret; } -/** @private */ -SRD_PRIV int srd_spew(const char *format, ...) -{ - int ret; - va_list args; - - va_start(args, format); - ret = srd_log_cb(srd_log_cb_data, SRD_LOG_SPEW, format, args); - va_end(args); - - return ret; -} - -/** @private */ -SRD_PRIV int srd_dbg(const char *format, ...) -{ - int ret; - va_list args; - - va_start(args, format); - ret = srd_log_cb(srd_log_cb_data, SRD_LOG_DBG, format, args); - va_end(args); - - return ret; -} - -/** @private */ -SRD_PRIV int srd_info(const char *format, ...) -{ - int ret; - va_list args; - - va_start(args, format); - ret = srd_log_cb(srd_log_cb_data, SRD_LOG_INFO, format, args); - va_end(args); - - return ret; -} - -/** @private */ -SRD_PRIV int srd_warn(const char *format, ...) -{ - int ret; - va_list args; - - va_start(args, format); - ret = srd_log_cb(srd_log_cb_data, SRD_LOG_WARN, format, args); - va_end(args); - - return ret; -} - -/** @private */ -SRD_PRIV int srd_err(const char *format, ...) -{ - int ret; - va_list args; - - va_start(args, format); - ret = srd_log_cb(srd_log_cb_data, SRD_LOG_ERR, format, args); - va_end(args); - - return ret; -} - /** @} */ -- cgit v1.2.3-70-g09d2