From 3af53d474f99fbc5e92efb151f7ef84883f91d90 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 11 Aug 2025 15:51:14 +0200 Subject: [PATCH] dix: let CreateGCperDepth() accept ScreenPtr instead of screen id It's only caller already has the ScreenPtr, so it doesn't make any sense passing in the screen number and let that function retrieve the pointer on its own again. Signed-off-by: Enrico Weigelt, metux IT consult --- dix/gc.c | 4 +--- dix/gc_priv.h | 2 +- dix/main.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index e84f94882..c5dfe5989 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -831,13 +831,11 @@ FreeGCperDepth(ScreenPtr pScreen) } Bool -CreateGCperDepth(int screenNum) +CreateGCperDepth(ScreenPtr pScreen) { - ScreenPtr pScreen; DepthPtr pDepth; GCPtr *ppGC; - pScreen = screenInfo.screens[screenNum]; ppGC = pScreen->GCperDepth; /* do depth 1 separately because it's not included in list */ if (!(ppGC[0] = CreateScratchGC(pScreen, 1))) diff --git a/dix/gc_priv.h b/dix/gc_priv.h index 01ae13a19..d6f51e52e 100644 --- a/dix/gc_priv.h +++ b/dix/gc_priv.h @@ -24,7 +24,7 @@ int FreeGC(void *pGC, XID gid); void FreeGCperDepth(ScreenPtr pScreen); -Bool CreateGCperDepth(int screenNum); +Bool CreateGCperDepth(ScreenPtr pScreen); Bool CreateDefaultStipple(ScreenPtr pScreen); diff --git a/dix/main.c b/dix/main.c index d993d76f2..c8229dd7a 100644 --- a/dix/main.c +++ b/dix/main.c @@ -216,7 +216,7 @@ dix_main(int argc, char *argv[], char *envp[]) FatalError("failed to create screen pixmap properties"); if (!dixScreenRaiseCreateResources(pScreen)) FatalError("failed to create screen resources"); - if (!CreateGCperDepth(i)) + if (!CreateGCperDepth(pScreen)) FatalError("failed to create scratch GCs"); if (!CreateDefaultStipple(pScreen)) FatalError("failed to create default stipple");