Change CM_WELS_TRACE to take a plain string, not a format and variadic arguments
The format string was always "%s" anyway.
This commit is contained in:
parent
5e22d5366e
commit
20e889fadb
@ -37,15 +37,6 @@
|
||||
|
||||
|
||||
// Internal details.
|
||||
int32_t welsStderrLevelTrace (const char* format, va_list ap);
|
||||
|
||||
template<int level> int32_t welsStderrTrace (
|
||||
const char* format, ...) {
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
welsStderrLevelTrace (format, ap);
|
||||
va_end (ap);
|
||||
return 0;
|
||||
}
|
||||
int32_t welsStderrTrace (const char* string);
|
||||
|
||||
#endif
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include <stdarg.h>
|
||||
#include "typedefs.h"
|
||||
|
||||
typedef int32_t (*CM_WELS_TRACE) (const char* format, ...);
|
||||
typedef int32_t (*CM_WELS_TRACE) (const char* string);
|
||||
|
||||
class welsCodecTrace {
|
||||
public:
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <stdio.h>
|
||||
#include "typedefs.h"
|
||||
|
||||
int32_t welsStderrLevelTrace (const char* format, va_list ap) {
|
||||
vfprintf (stderr, format, ap);
|
||||
int32_t welsStderrTrace (const char* string) {
|
||||
fprintf (stderr, "%s", string);
|
||||
return 0;
|
||||
}
|
||||
|
@ -54,10 +54,10 @@ CM_WELS_TRACE welsCodecTrace::m_fpErrorTrace = NULL;
|
||||
|
||||
welsCodecTrace::welsCodecTrace() {
|
||||
|
||||
m_fpDebugTrace = welsStderrTrace<WELS_LOG_DEBUG>;
|
||||
m_fpInfoTrace = welsStderrTrace<WELS_LOG_INFO>;
|
||||
m_fpWarnTrace = welsStderrTrace<WELS_LOG_WARNING>;
|
||||
m_fpErrorTrace = welsStderrTrace<WELS_LOG_ERROR>;
|
||||
m_fpDebugTrace = welsStderrTrace;
|
||||
m_fpInfoTrace = welsStderrTrace;
|
||||
m_fpWarnTrace = welsStderrTrace;
|
||||
m_fpErrorTrace = welsStderrTrace;
|
||||
}
|
||||
|
||||
welsCodecTrace::~welsCodecTrace() {
|
||||
@ -71,23 +71,23 @@ void welsCodecTrace::TraceString (int32_t iLevel, const char* str) {
|
||||
switch (iLevel) {
|
||||
case WELS_LOG_ERROR:
|
||||
if (m_fpErrorTrace)
|
||||
m_fpErrorTrace ("%s", str);
|
||||
m_fpErrorTrace (str);
|
||||
break;
|
||||
case WELS_LOG_WARNING:
|
||||
if (m_fpWarnTrace)
|
||||
m_fpWarnTrace ("%s", str);
|
||||
m_fpWarnTrace (str);
|
||||
break;
|
||||
case WELS_LOG_INFO:
|
||||
if (m_fpInfoTrace)
|
||||
m_fpInfoTrace ("%s", str);
|
||||
m_fpInfoTrace (str);
|
||||
break;
|
||||
case WELS_LOG_DEBUG:
|
||||
if (m_fpDebugTrace)
|
||||
m_fpDebugTrace ("%s", str);
|
||||
m_fpDebugTrace (str);
|
||||
break;
|
||||
default:
|
||||
if (m_fpDebugTrace)
|
||||
m_fpInfoTrace ("%s", str);
|
||||
m_fpInfoTrace (str);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user