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/xfree86/dixmods | |
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/xfree86/dixmods')
-rw-r--r-- | hw/xfree86/dixmods/extmod/xf86dga2.c | 18 |
1 files changed, 10 insertions, 8 deletions
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; } } |