[PATCH 4/4] Replace SecurityLookupIDByClass() with dixLookupResourceByClass().
Cyril Brulebois
kibi at debian.org
Fri Nov 12 03:19:02 PST 2010
This patch has been prepared with the following Coccinelle semantic patch:
@@
expression a, b, c, d;
identifier r;
type t;
@@
-r = (t) SecurityLookupIDByClass(a, b, c, d);
+int lookup_ret;
+lookup_ret = dixLookupResourceByClass((pointer) &r, b, c, a, d);
+r = (lookup_ret == Success) ? r : NULL;
The only occurrence not matching directly was processed after separating
declaration of pXinDraw and call to SecurityLookupIDByClass().
Signed-off-by: Cyril Brulebois <kibi at debian.org>
---
hw/dmx/glxProxy/glxcmds.c | 49 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index e0d02d0..0286dba 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -1104,14 +1104,20 @@ static int MakeCurrent(__GLXclientState *cl,
to_screen = screenInfo.numScreens - 1;
if (pDraw && new_reply.writeType != GLX_PBUFFER_TYPE) {
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ int lookup_ret;
+ lookup_ret = dixLookupResourceByClass((pointer) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ pXinDraw = (lookup_ret == Success) ? pXinDraw : NULL;
}
if (pReadDraw && pReadDraw != pDraw &&
new_reply.readType != GLX_PBUFFER_TYPE) {
- pXinReadDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pReadDraw->id, XRC_DRAWABLE, DixReadAccess);
+ int lookup_ret;
+ lookup_ret = dixLookupResourceByClass((pointer) &pXinReadDraw,
+ pReadDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ pXinReadDraw = (lookup_ret == Success) ? pXinReadDraw : NULL;
}
else {
pXinReadDraw = pXinDraw;
@@ -1762,11 +1768,15 @@ static int CreateGLXPixmap(__GLXclientState *cl,
from_screen = to_screen = screenNum;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
+ int lookup_ret;
+
from_screen = 0;
to_screen = screenInfo.numScreens - 1;
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ lookup_ret = dixLookupResourceByClass((pointer) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ pXinDraw = (lookup_ret == Success) ? pXinDraw : NULL;
}
#endif
@@ -2011,10 +2021,15 @@ int __glXDoSwapBuffers(__GLXclientState *cl, XID drawId, GLXContextTag tag)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
+ int lookup_ret;
+
from_screen = 0;
to_screen = screenInfo.numScreens - 1;
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+
+ lookup_ret = dixLookupResourceByClass((pointer) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ pXinDraw = (lookup_ret == Success) ? pXinDraw : NULL;
}
#endif
@@ -3373,8 +3388,11 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ int lookup_ret;
+ lookup_ret = dixLookupResourceByClass((pointer) &pXinDraw,
+ pDraw->id, XRC_DRAWABLE,
+ client, DixReadAccess);
+ pXinDraw = (lookup_ret == Success) ? pXinDraw : NULL;
if (!pXinDraw) {
client->errorValue = drawId;
return __glXBadDrawable;
@@ -3537,8 +3555,15 @@ int __glXChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
- PanoramiXRes *pXinDraw = (PanoramiXRes *)
- SecurityLookupIDByClass(client, pDraw->id, XRC_DRAWABLE, DixReadAccess);
+ PanoramiXRes *pXinDraw;
+
+ int lookup_ret;
+ lookup_ret = dixLookupResourceByClass((pointer) & pXinDraw,
+ pDraw->id,
+ XRC_DRAWABLE,
+ client,
+ DixReadAccess);
+ pXinDraw = (lookup_ret == Success) ? pXinDraw : NULL;
if (!pXinDraw) {
client->errorValue = drawId;
return __glXBadDrawable;
--
1.7.2.3
More information about the xorg-devel
mailing list