From d4fc1506add0653b2dddf3baef2f0ba6d3ecfd13 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 11 Aug 2025 15:57:11 +0200 Subject: [PATCH] dix: let CreateDefaultStipple() 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 | 5 +---- dix/gc_priv.h | 2 +- dix/main.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dix/gc.c b/dix/gc.c index 7b0a7355f5..e84f948828 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -858,16 +858,13 @@ CreateGCperDepth(int screenNum) } Bool -CreateDefaultStipple(int screenNum) +CreateDefaultStipple(ScreenPtr pScreen) { - ScreenPtr pScreen; ChangeGCVal tmpval[3]; xRectangle rect; CARD16 w, h; GCPtr pgcScratch; - pScreen = screenInfo.screens[screenNum]; - w = 16; h = 16; (*pScreen->QueryBestSize) (StippleShape, &w, &h, pScreen); diff --git a/dix/gc_priv.h b/dix/gc_priv.h index 8079f5095b..01ae13a19a 100644 --- a/dix/gc_priv.h +++ b/dix/gc_priv.h @@ -26,7 +26,7 @@ void FreeGCperDepth(ScreenPtr pScreen); Bool CreateGCperDepth(int screenNum); -Bool CreateDefaultStipple(int screenNum); +Bool CreateDefaultStipple(ScreenPtr pScreen); int SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash); diff --git a/dix/main.c b/dix/main.c index fd1927be09..d993d76f23 100644 --- a/dix/main.c +++ b/dix/main.c @@ -218,7 +218,7 @@ dix_main(int argc, char *argv[], char *envp[]) FatalError("failed to create screen resources"); if (!CreateGCperDepth(i)) FatalError("failed to create scratch GCs"); - if (!CreateDefaultStipple(i)) + if (!CreateDefaultStipple(pScreen)) FatalError("failed to create default stipple"); if (!CreateRootWindow(pScreen)) FatalError("failed to create root window");