diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-29 01:04:37 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2009-04-29 01:04:37 -0400 |
commit | 57aff88c7d0761e590806d07bee1c9410680c89f (patch) | |
tree | 48f05f58a72183556af3b0a7f3f286959d7e096a /hw | |
parent | 1abe0ee3da5e1268c7315f841d31337ea6524cf0 (diff) |
Fix most remaining deprecated resource lookups.
Callsites updated to use dixLookupResourceBy{Type,Class}.
TODO: Audit access modes to make sure they reflect the usage.
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/src/kcmap.c | 3 | ||||
-rw-r--r-- | hw/vfb/InitOutput.c | 6 | ||||
-rw-r--r-- | hw/xfree86/common/xf86cmap.c | 4 | ||||
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86dga2.c | 18 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 5 | ||||
-rw-r--r-- | hw/xfree86/vgahw/vgaCmap.c | 4 | ||||
-rw-r--r-- | hw/xnest/Color.c | 22 | ||||
-rw-r--r-- | hw/xnest/Window.c | 9 |
8 files changed, 42 insertions, 29 deletions
diff --git a/hw/kdrive/src/kcmap.c b/hw/kdrive/src/kcmap.c index 4941ad17f..2c33e798a 100644 --- a/hw/kdrive/src/kcmap.c +++ b/hw/kdrive/src/kcmap.c @@ -217,7 +217,8 @@ KdUninstallColormap (ColormapPtr pCmap) return; /* install default if on same fb */ - defMap = (ColormapPtr) LookupIDByType(defMapID, RT_COLORMAP); + dixLookupResourceByType((pointer *)&defMap, defMapID, RT_COLORMAP, + serverClient, DixInstallAccess); if (defMap && KdColormapFb (defMap) == fb) (*pCmap->pScreen->InstallColormap)(defMap); else diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index af3e8f1d4..8ab8bae64 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -508,8 +508,10 @@ vfbUninstallColormap(ColormapPtr pmap) { if (pmap->mid != pmap->pScreen->defColormap) { - curpmap = (ColormapPtr) LookupIDByType(pmap->pScreen->defColormap, - RT_COLORMAP); + dixLookupResourceByType((pointer *)&curpmap, + pmap->pScreen->defColormap, + RT_COLORMAP, serverClient, + DixInstallAccess); (*pmap->pScreen->InstallColormap)(curpmap); } } diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index a627b5315..7e73bb85c 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -211,8 +211,8 @@ Bool xf86HandleColormaps( ComputeGamma(pScreenPriv); /* get the default map */ - - pDefMap = (ColormapPtr) LookupIDByType(pScreen->defColormap, RT_COLORMAP); + dixLookupResourceByType((pointer *)&pDefMap, pScreen->defColormap, + RT_COLORMAP, serverClient, DixInstallAccess); if(!CMapAllocateColormapPrivate(pDefMap)) { CMapUnwrapScreen(pScreen); diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c index 868fb0624..46aa8b882 100644 --- a/hw/xfree86/dixmods/extmod/xf86dga2.c +++ b/hw/xfree86/dixmods/extmod/xf86dga2.c @@ -420,6 +420,7 @@ static int ProcXDGAInstallColormap(ClientPtr client) { ColormapPtr cmap; + int rc; REQUEST(xXDGAInstallColormapReq); if (stuff->screen > screenInfo.numScreens) @@ -430,13 +431,13 @@ ProcXDGAInstallColormap(ClientPtr client) REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - cmap = (ColormapPtr)LookupIDByType(stuff->cmap, RT_COLORMAP); - if (cmap) { + rc = dixLookupResourceByType((pointer *)&cmap, stuff->cmap, RT_COLORMAP, + client, DixInstallAccess); + if (rc == Success) { DGAInstallCmap(cmap); return (client->noClientException); } else { - client->errorValue = stuff->cmap; - return (BadColor); + return (rc == BadValue) ? BadColor : rc; } return (client->noClientException); @@ -858,6 +859,7 @@ static int ProcXF86DGAInstallColormap(ClientPtr client) { ColormapPtr pcmp; + int rc; REQUEST(xXF86DGAInstallColormapReq); if (stuff->screen > screenInfo.numScreens) @@ -871,13 +873,13 @@ ProcXF86DGAInstallColormap(ClientPtr client) if (!DGAActive(stuff->screen)) return (DGAErrorBase + XF86DGADirectNotActivated); - pcmp = (ColormapPtr )LookupIDByType(stuff->id, RT_COLORMAP); - if (pcmp) { + rc = dixLookupResourceByType((pointer *)&pcmp, stuff->id, RT_COLORMAP, + client, DixInstallAccess); + if (rc == Success) { DGAInstallCmap(pcmp); return (client->noClientException); } else { - client->errorValue = stuff->id; - return (BadColor); + return (rc == BadValue) ? BadColor : rc; } } diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index c01686de3..3af9878d5 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1363,11 +1363,12 @@ Bool DRIDrawablePrivDelete(pointer pResource, XID id) { WindowPtr pWin; + int rc; id = (XID)pResource; - pWin = LookupIDByType(id, RT_WINDOW); + rc = dixLookupWindow(&pWin, id, serverClient, DixGetAttrAccess); - if (pWin) { + if (rc == Success) { DRIDrawablePrivPtr pDRIDrwPriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin); if (!pDRIDrwPriv) diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c index 44043c6c7..095e480a3 100644 --- a/hw/xfree86/vgahw/vgaCmap.c +++ b/hw/xfree86/vgahw/vgaCmap.c @@ -277,8 +277,8 @@ vgaUninstallColormap(pmap) if ( pmap != miInstalledMaps[pmap->pScreen->myNum] ) return; - defColormap = (ColormapPtr) LookupIDByType( pmap->pScreen->defColormap, - RT_COLORMAP); + dixLookupResourceByType((pointer *)&defColormap, pmap->pScreen->defColormap, + RT_COLORMAP, serverClient, DixInstallAccess); if (defColormap == miInstalledMaps[pmap->pScreen->myNum]) return; diff --git a/hw/xnest/Color.c b/hw/xnest/Color.c index 5ba0bdbad..dc749478f 100644 --- a/hw/xnest/Color.c +++ b/hw/xnest/Color.c @@ -242,16 +242,16 @@ xnestSetInstalledColormapWindows(ScreenPtr pScreen) WindowPtr pWin; Visual *visual; ColormapPtr pCmap; - + pWin = xnestWindowPtr(icws.windows[0]); visual = xnestVisualFromID(pScreen, wVisual(pWin)); if (visual == xnestDefaultVisual(pScreen)) - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), - RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, wColormap(pWin), + RT_COLORMAP, serverClient, DixUseAccess); else - pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, - RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, pScreen->defColormap, + RT_COLORMAP, serverClient, DixUseAccess); XSetWindowColormap(xnestDisplay, xnestDefaultWindows[pScreen->myNum], @@ -302,7 +302,8 @@ xnestDirectInstallColormaps(ScreenPtr pScreen) for (i = 0; i < n; i++) { ColormapPtr pCmap; - pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, pCmapIDs[i], RT_COLORMAP, + serverClient, DixInstallAccess); if (pCmap) XInstallColormap(xnestDisplay, xnestColormap(pCmap)); } @@ -321,7 +322,8 @@ xnestDirectUninstallColormaps(ScreenPtr pScreen) for (i = 0; i < n; i++) { ColormapPtr pCmap; - pCmap = (ColormapPtr)LookupIDByType(pCmapIDs[i], RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, pCmapIDs[i], RT_COLORMAP, + serverClient, DixUninstallAccess); if (pCmap) XUninstallColormap(xnestDisplay, xnestColormap(pCmap)); } @@ -365,8 +367,10 @@ xnestUninstallColormap(ColormapPtr pCmap) { if (pCmap->mid != pCmap->pScreen->defColormap) { - pCurCmap = (ColormapPtr)LookupIDByType(pCmap->pScreen->defColormap, - RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCurCmap, + pCmap->pScreen->defColormap, + RT_COLORMAP, + serverClient, DixInstallAccess); (*pCmap->pScreen->InstallColormap)(pCurCmap); } } diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index ae3487f4a..48c870fac 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -93,7 +93,8 @@ xnestCreateWindow(WindowPtr pWin) visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); mask |= CWColormap; if (pWin->optional->colormap) { - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, wColormap(pWin), + RT_COLORMAP, serverClient, DixUseAccess); attributes.colormap = xnestColormap(pCmap); } else @@ -104,7 +105,8 @@ xnestCreateWindow(WindowPtr pWin) } else { /* root windows have their own colormaps at creation time */ visual = xnestVisualFromID(pWin->drawable.pScreen, wVisual(pWin)); - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, wColormap(pWin), + RT_COLORMAP, serverClient, DixUseAccess); mask |= CWColormap; attributes.colormap = xnestColormap(pCmap); } @@ -338,7 +340,8 @@ xnestChangeWindowAttributes(WindowPtr pWin, unsigned long mask) if (mask & CWColormap) { ColormapPtr pCmap; - pCmap = (ColormapPtr)LookupIDByType(wColormap(pWin), RT_COLORMAP); + dixLookupResourceByType((pointer *)&pCmap, wColormap(pWin), RT_COLORMAP, + serverClient, DixUseAccess); attributes.colormap = xnestColormap(pCmap); |