From e5b5b302d3a1170cefce44e3f12219eedfbd96ea Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 9 Sep 2024 16:14:33 +0200 Subject: [PATCH] os: replace LogVWrite() by LogVMessageVerb() It's just a wrapper around LogVMessageVerb() and no external module using it, so can easily be optimized-away. Signed-off-by: Enrico Weigelt, metux IT consult Part-of: --- hw/xfree86/common/xf86Helper.c | 4 ++-- hw/xwin/winerror.c | 2 +- include/os.h | 3 --- os/log.c | 8 +------- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 1e7a375c8..105a93b2b 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1123,7 +1123,7 @@ xf86ErrorFVerb(int verb, const char *format, ...) va_start(ap, format); if (xf86Verbose >= verb || xf86LogVerbose >= verb) - LogVWrite(verb, format, ap); + LogVMessageVerb(X_NONE, verb, format, ap); va_end(ap); } @@ -1135,7 +1135,7 @@ xf86ErrorF(const char *format, ...) va_start(ap, format); if (xf86Verbose >= 1 || xf86LogVerbose >= 1) - LogVWrite(1, format, ap); + LogVMessageVerb(X_NONE, 1, format, ap); va_end(ap); } diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c index b9cffd8d7..bdf03f053 100644 --- a/hw/xwin/winerror.c +++ b/hw/xwin/winerror.c @@ -50,7 +50,7 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args) pthread_mutex_lock(&s_pmPrinting); /* Print the error message to a log file, could be stderr */ - LogVWrite(0, pszFormat, va_args); + LogVMessageVerb(X_NONE, 0, pszFormat, va_args); /* Unlock the printing mutex */ pthread_mutex_unlock(&s_pmPrinting); diff --git a/include/os.h b/include/os.h index 4892affd6..fa41d6698 100644 --- a/include/os.h +++ b/include/os.h @@ -355,9 +355,6 @@ LogClose(enum ExitCode error); extern _X_EXPORT Bool LogSetParameter(LogParameter param, int value); extern _X_EXPORT void -LogVWrite(int verb, const char *f, va_list args) -_X_ATTRIBUTE_PRINTF(2, 0); -extern _X_EXPORT void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) _X_ATTRIBUTE_PRINTF(3, 0); extern _X_EXPORT void diff --git a/os/log.c b/os/log.c index 9dbe83c8d..92334e897 100644 --- a/os/log.c +++ b/os/log.c @@ -629,12 +629,6 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) (void) ret; } -void -LogVWrite(int verb, const char *f, va_list args) -{ - return LogVMessageVerb(X_NONE, verb, f, args); -} - /* Returns the Message Type string to prepend to a logging message, or NULL * if the message will be dropped due to insufficient verbosity. */ static const char * @@ -1003,7 +997,7 @@ VErrorF(const char *f, va_list args) if (OsVendorVErrorFProc) OsVendorVErrorFProc(f, args); else - LogVWrite(-1, f, args); + LogVMessageVerb(X_NONE, -1, f, args); } void