diff options
author | Daniel Elstner <daniel.kitta@gmail.com> | 2015-09-13 21:32:27 +0200 |
---|---|---|
committer | Daniel Elstner <daniel.kitta@gmail.com> | 2015-09-13 21:32:27 +0200 |
commit | fd4918101e0878be9d399a344511253f5867a646 (patch) | |
tree | 4979db79a74b07692cedd34589ba01771958b6fb /log.c | |
parent | 9fb7e7fe2c7edafdeedf1976d1723ffe557c8a7c (diff) | |
download | libsigrokdecode-fd4918101e0878be9d399a344511253f5867a646.tar.gz libsigrokdecode-fd4918101e0878be9d399a344511253f5867a646.zip |
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().
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 65 |
1 files changed, 0 insertions, 65 deletions
@@ -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; -} - /** @} */ |