dri2: declare variables where needed in DRI2GetDrawable()

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2026-02-05 17:22:36 +01:00
committed by Enrico Weigelt
parent 0c2289ce0c
commit 4bda7ecaa0

View File

@@ -201,15 +201,12 @@ DRI2GetScreenPrime(ScreenPtr primary, int prime_id)
static DRI2DrawablePtr
DRI2GetDrawable(DrawablePtr pDraw)
{
WindowPtr pWin;
PixmapPtr pPixmap;
switch (pDraw->type) {
case DRAWABLE_WINDOW:
pWin = (WindowPtr) pDraw;
WindowPtr pWin = (WindowPtr) pDraw;
return dixLookupPrivate(&pWin->devPrivates, &dri2WindowPrivateKeyRec);
case DRAWABLE_PIXMAP:
pPixmap = (PixmapPtr) pDraw;
PixmapPtr pPixmap = (PixmapPtr) pDraw;
return dixLookupPrivate(&pPixmap->devPrivates, &dri2PixmapPrivateKeyRec);
default:
return NULL;