From 17aec8555e0b4d18f5b102a0cdf9d2886630a1f7 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 5 Feb 2026 17:36:50 +0100 Subject: [PATCH] dri2: declare variables where needed in DRI2CreateDrawable2() Signed-off-by: Enrico Weigelt, metux IT consult --- Xext/dri2/dri2.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Xext/dri2/dri2.c b/Xext/dri2/dri2.c index 24de2220e6..79853f14f0 100644 --- a/Xext/dri2/dri2.c +++ b/Xext/dri2/dri2.c @@ -347,17 +347,12 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, DRI2InvalidateProcPtr invalidate, void *priv, XID *dri2_id_out) { - DRI2DrawablePtr pPriv; - DRI2ClientPtr dri2_client; - XID dri2_id; - int rc; - if (!dixPrivateKeyRegistered(&dri2ScreenPrivateKeyRec)) return BadValue; - dri2_client = dri2ClientPrivate(client); + DRI2ClientPtr dri2_client = dri2ClientPrivate(client); - pPriv = DRI2GetDrawable(pDraw); + DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); if (pPriv == NULL) pPriv = DRI2AllocateDrawable(pDraw); if (pPriv == NULL) @@ -365,8 +360,8 @@ DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, pPriv->prime_id = dri2_client->prime_id; - dri2_id = FakeClientID(client->index); - rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv); + XID dri2_id = FakeClientID(client->index); + int rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv); if (rc != Success) return rc;