From 654b491d58040dccfb29295c86d074df07d7ed13 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Thu, 5 Feb 2026 19:41:31 +0100 Subject: [PATCH] dri2: declare variables where needed in DRI2UpdatePrime() 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 5838218555..2bcf86c530 100644 --- a/Xext/dri2/dri2.c +++ b/Xext/dri2/dri2.c @@ -810,12 +810,8 @@ DRI2InvalidateDrawableAll(DrawablePtr pDraw) DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) { DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); - PixmapPtr spix; PixmapPtr mpix = GetDrawablePixmap(pDraw); - ScreenPtr primary, secondary; - Bool ret; - - primary = mpix->drawable.pScreen; + ScreenPtr primary = mpix->drawable.pScreen; if (pDraw->type == DRAWABLE_WINDOW) { WindowPtr pWin = (WindowPtr)pDraw; @@ -834,8 +830,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) if (!mpix) return NULL; - ret = (*primary->ReplaceScanoutPixmap)(pDraw, mpix, TRUE); - if (ret == FALSE) { + if (!(primary->ReplaceScanoutPixmap(pDraw, mpix, TRUE))) { dixDestroyPixmap(mpix, 0); return NULL; } @@ -850,7 +845,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) } } - secondary = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); + ScreenPtr secondary = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); /* check if the pixmap is still fine */ if (pPriv->prime_secondary_pixmap) { @@ -864,7 +859,7 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) } } - spix = PixmapShareToSecondary(mpix, secondary); + PixmapPtr spix = PixmapShareToSecondary(mpix, secondary); if (!spix) return NULL;