os: drop unneeded DDXOSVERRORF conditional

This conditional practically only controls whether we have an pointer,
where DDX can plug in it's own VErrorF() handler (currently only xwin
doing that). The cost of having it even when DDX doesn't use it, is
really negligible: it's just one pointer and an extra non-null check
on it per VErrorF() call - a very cold path. Strangely, xwin has extra

Getting rid of this unnecessary complexity that really hasn't any
practical gain.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1329>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-02-22 15:06:53 +01:00 committed by Marge Bot
parent 40c5d39c55
commit c3255fbc1c
7 changed files with 0 additions and 17 deletions

View File

@ -623,10 +623,8 @@ OsVendorInit(void)
winFixupPaths(); winFixupPaths();
#ifdef DDXOSVERRORF
if (!OsVendorVErrorFProc) if (!OsVendorVErrorFProc)
OsVendorVErrorFProc = OsVendorVErrorF; OsVendorVErrorFProc = OsVendorVErrorF;
#endif
if (!g_fLogInited) { if (!g_fLogInited) {
/* keep this order. If LogInit fails it calls Abort which then calls /* keep this order. If LogInit fails it calls Abort which then calls

View File

@ -740,11 +740,9 @@ void
* winerror.c * winerror.c
*/ */
#ifdef DDXOSVERRORF
void void
OsVendorVErrorF(const char *pszFormat, va_list va_args) OsVendorVErrorF(const char *pszFormat, va_list va_args)
_X_ATTRIBUTE_PRINTF(1, 0); _X_ATTRIBUTE_PRINTF(1, 0);
#endif
void void
winMessageBoxF(const char *pszError, UINT uType, ...) winMessageBoxF(const char *pszError, UINT uType, ...)

View File

@ -35,7 +35,6 @@
#include <../xfree86/common/xorgVersion.h> #include <../xfree86/common/xorgVersion.h>
#include "win.h" #include "win.h"
#ifdef DDXOSVERRORF
void void
OsVendorVErrorF(const char *pszFormat, va_list va_args) OsVendorVErrorF(const char *pszFormat, va_list va_args)
{ {
@ -52,7 +51,6 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args)
/* Unlock the printing mutex */ /* Unlock the printing mutex */
pthread_mutex_unlock(&s_pmPrinting); pthread_mutex_unlock(&s_pmPrinting);
} }
#endif
/* /*
* os/log.c:FatalError () calls our vendor ErrorF, so the message * os/log.c:FatalError () calls our vendor ErrorF, so the message

View File

@ -221,13 +221,11 @@ ddxProcessArgument(int argc, char *argv[], int i)
/* Initialize once */ /* Initialize once */
if (!s_fBeenHere) { if (!s_fBeenHere) {
#ifdef DDXOSVERRORF
/* /*
* This initialises our hook into VErrorF () for catching log messages * This initialises our hook into VErrorF () for catching log messages
* that are generated before OsInit () is called. * that are generated before OsInit () is called.
*/ */
OsVendorVErrorFProc = OsVendorVErrorF; OsVendorVErrorFProc = OsVendorVErrorF;
#endif
s_fBeenHere = TRUE; s_fBeenHere = TRUE;

View File

@ -251,7 +251,6 @@ conf_data.set('HAVE_LIBUNWIND', get_option('libunwind'))
conf_data.set('HAVE_APM', (build_apm or build_acpi) ? '1' : false) conf_data.set('HAVE_APM', (build_apm or build_acpi) ? '1' : false)
conf_data.set('HAVE_ACPI', build_acpi ? '1' : false) conf_data.set('HAVE_ACPI', build_acpi ? '1' : false)
conf_data.set('DDXOSVERRORF', build_xwin ? '1' : false)
conf_data.set('DDXBEFORERESET', build_xwin ? '1' : false) conf_data.set('DDXBEFORERESET', build_xwin ? '1' : false)
enable_debugging = get_option('buildtype') == 'debug' enable_debugging = get_option('buildtype') == 'debug'
conf_data.set('DEBUG', enable_debugging ? '1' : false) conf_data.set('DEBUG', enable_debugging ? '1' : false)

View File

@ -90,11 +90,9 @@ typedef struct _NewClientRec *NewClientPtr;
extern void ddxBeforeReset(void); extern void ddxBeforeReset(void);
#endif #endif
#ifdef DDXOSVERRORF
extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *,
va_list args) va_list args)
_X_ATTRIBUTE_PRINTF(1, 0); _X_ATTRIBUTE_PRINTF(1, 0);
#endif
extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready); extern _X_EXPORT Bool WaitForSomething(Bool clients_are_ready);

View File

@ -104,9 +104,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#pragma clang diagnostic ignored "-Wformat-nonliteral" #pragma clang diagnostic ignored "-Wformat-nonliteral"
#endif #endif
#ifdef DDXOSVERRORF
void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL; void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL;
#endif
/* Default logging parameters. */ /* Default logging parameters. */
#ifndef DEFAULT_LOG_VERBOSITY #ifndef DEFAULT_LOG_VERBOSITY
@ -1036,14 +1034,10 @@ FatalError(const char *f, ...)
void void
VErrorF(const char *f, va_list args) VErrorF(const char *f, va_list args)
{ {
#ifdef DDXOSVERRORF
if (OsVendorVErrorFProc) if (OsVendorVErrorFProc)
OsVendorVErrorFProc(f, args); OsVendorVErrorFProc(f, args);
else else
LogVWrite(-1, f, args); LogVWrite(-1, f, args);
#else
LogVWrite(-1, f, args);
#endif
} }
void void