DPMS: Fix cast abuse
This commit is contained in:
parent
4da347adb1
commit
a99b0ab918
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
|
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
|
||||||
*
|
*
|
||||||
|
@ -71,7 +70,7 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
|
||||||
xcalloc(sizeof(DPMSRec), 1)))
|
xcalloc(sizeof(DPMSRec), 1)))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pDPMS = (DPMSPtr)dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||||
pScrn->DPMSSet = set;
|
pScrn->DPMSSet = set;
|
||||||
pDPMS->Flags = flags;
|
pDPMS->Flags = flags;
|
||||||
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
|
DPMSOpt = xf86FindOption(pScrn->options, "dpms");
|
||||||
|
@ -112,7 +111,7 @@ DPMSClose(int i, ScreenPtr pScreen)
|
||||||
if (DPMSKey == NULL)
|
if (DPMSKey == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
pDPMS = (DPMSPtr)dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey);
|
||||||
|
|
||||||
/* This shouldn't happen */
|
/* This shouldn't happen */
|
||||||
if (!pDPMS)
|
if (!pDPMS)
|
||||||
|
@ -130,7 +129,7 @@ DPMSClose(int i, ScreenPtr pScreen)
|
||||||
xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
|
xf86Screens[i]->DPMSSet(xf86Screens[i],DPMSModeOn,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
xfree((pointer)pDPMS);
|
xfree(pDPMS);
|
||||||
dixSetPrivate(&pScreen->devPrivates, DPMSKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, DPMSKey, NULL);
|
||||||
if (--DPMSCount == 0)
|
if (--DPMSCount == 0)
|
||||||
DPMSKey = NULL;
|
DPMSKey = NULL;
|
||||||
|
@ -164,8 +163,7 @@ DPMSSet(ClientPtr client, int level)
|
||||||
/* For each screen, set the DPMS level */
|
/* For each screen, set the DPMS level */
|
||||||
for (i = 0; i < xf86NumScreens; i++) {
|
for (i = 0; i < xf86NumScreens; i++) {
|
||||||
pScrn = xf86Screens[i];
|
pScrn = xf86Screens[i];
|
||||||
pDPMS = (DPMSPtr)dixLookupPrivate(&screenInfo.screens[i]->devPrivates,
|
pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey);
|
||||||
DPMSKey);
|
|
||||||
if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
|
if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) {
|
||||||
xf86EnableAccess(pScrn);
|
xf86EnableAccess(pScrn);
|
||||||
pScrn->DPMSSet(pScrn, level, 0);
|
pScrn->DPMSSet(pScrn, level, 0);
|
||||||
|
@ -193,8 +191,7 @@ DPMSSupported(void)
|
||||||
/* For each screen, check if DPMS is supported */
|
/* For each screen, check if DPMS is supported */
|
||||||
for (i = 0; i < xf86NumScreens; i++) {
|
for (i = 0; i < xf86NumScreens; i++) {
|
||||||
pScrn = xf86Screens[i];
|
pScrn = xf86Screens[i];
|
||||||
pDPMS = (DPMSPtr)dixLookupPrivate(&screenInfo.screens[i]->devPrivates,
|
pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey);
|
||||||
DPMSKey);
|
|
||||||
if (pDPMS && pScrn->DPMSSet)
|
if (pDPMS && pScrn->DPMSSet)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue