mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
treewide: use helper dixGetScreenPtr() for retrieving ScreenPtr's
Instead of directly accessing the global screenInfo.screens[] array, let everybody go through a little inline helper. This one also checks for array bounds - if the screen doesn't exist, return NULL. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
d2fcf85214
commit
0fbb681fce
@@ -601,8 +601,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
ScreenPtr pScreen = (stuff->n == 0) ? screenInfo.screens[i] :
|
||||
pDrawables[i]->pScreen;
|
||||
ScreenPtr pScreen = (stuff->n == 0) ? dixGetScreenPtr(i) : pDrawables[i]->pScreen;
|
||||
pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen);
|
||||
|
||||
rc = dixCallScreenAccessCallback(client, pScreen, DixGetAttrAccess);
|
||||
@@ -1033,7 +1032,7 @@ DbeExtensionInit(void)
|
||||
*/
|
||||
|
||||
for (int j = 0; j < walkScreenIdx; j++) {
|
||||
ScreenPtr pScreen = screenInfo.screens[j];
|
||||
ScreenPtr pScreen = dixGetScreenPtr(j);
|
||||
free(dixLookupPrivate(&pScreen->devPrivates, &dbeScreenPrivKeyRec));
|
||||
dixSetPrivate(&pScreen->devPrivates, &dbeScreenPrivKeyRec, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user