From 28e739e05b2725b7ddfec9e4515c85b221b7a636 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Tue, 1 Jul 2025 12:42:18 +0200 Subject: [PATCH] xfree86: loadmod: locally scope the errtype variable In CheckVersion() the errtype variable is used in two separate scopes, but not globally, so it's cleaner to have it only in the scopes that are actually using it. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/loader/loadmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index be9335dd5..2cdf91fd2 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -417,7 +417,6 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, { int vercode[4]; long ver = data->xf86version; - MessageType errtype; LogMessage(X_INFO, "Module %s: vendor=\"%s\"\n", data->modname ? data->modname : "UNKNOWN!", @@ -458,6 +457,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, vermaj = GET_ABI_MAJOR(ver); vermin = GET_ABI_MINOR(ver); if (abimaj != vermaj) { + MessageType errtype; if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else @@ -469,6 +469,7 @@ CheckVersion(const char *module, XF86ModuleVersionInfo * data, return FALSE; } else if (abimin > vermin) { + MessageType errtype; if (LoaderOptions & LDR_OPT_ABI_MISMATCH_NONFATAL) errtype = X_WARNING; else