[PATCH xserver 5/5] glx: Remove some redundant request size checks

Adam Jackson ajax at redhat.com
Wed Aug 30 18:58:28 UTC 2017


vnd is doing these for us now.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glx/glxcmds.c     | 41 -----------------------------------------
 glx/glxcmdsswap.c | 54 ------------------------------------------------------
 glx/xfont.c       |  2 --
 3 files changed, 97 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index 544fd284dc..58aabbe79c 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -357,14 +357,11 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId,
 int
 __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
     __GLXconfig *config;
     __GLXscreen *pGlxScreen;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXCreateContextReq);
-
     if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
         return err;
     if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
@@ -377,14 +374,11 @@ __glXDisp_CreateContext(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_CreateNewContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
     __GLXconfig *config;
     __GLXscreen *pGlxScreen;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
-
     if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
         return err;
     if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err))
@@ -426,13 +420,10 @@ __glXDisp_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_DestroyContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
     __GLXcontext *glxc;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
-
     if (!validGlxContext(cl->client, req->context, DixDestroyAccess,
                          &glxc, &err))
         return err;
@@ -669,8 +660,6 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
     __GLXcontext *glxc;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXIsDirectReq);
-
     if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
         return err;
 
@@ -734,14 +723,11 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
     GLXContextTag tag;
     __GLXcontext *glxc = NULL;
     int error;
 
-    REQUEST_SIZE_MATCH(xGLXWaitGLReq);
-
     tag = req->contextTag;
     if (tag) {
         glxc = __glXLookupContextByTag(cl, tag);
@@ -763,14 +749,11 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
     GLXContextTag tag;
     __GLXcontext *glxc = NULL;
     int error;
 
-    REQUEST_SIZE_MATCH(xGLXWaitXReq);
-
     tag = req->contextTag;
     if (tag) {
         glxc = __glXLookupContextByTag(cl, tag);
@@ -799,8 +782,6 @@ __glXDisp_CopyContext(__GLXclientState * cl, GLbyte * pc)
     __GLXcontext *src, *dst;
     int error;
 
-    REQUEST_SIZE_MATCH(xGLXCopyContextReq);
-
     source = req->source;
     dest = req->dest;
     tag = req->contextTag;
@@ -888,8 +869,6 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
-
     if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
         return err;
 
@@ -1109,10 +1088,8 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
 int
 __glXDisp_GetFBConfigs(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
 
-    REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
     return DoGetFBConfigs(cl, req->screen);
 }
 
@@ -1248,14 +1225,11 @@ determineTextureTarget(ClientPtr client, XID glxDrawableID,
 int
 __glXDisp_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
     __GLXconfig *config;
     __GLXscreen *pGlxScreen;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
-
     if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
         return err;
     if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err))
@@ -1344,11 +1318,8 @@ DoDestroyDrawable(__GLXclientState * cl, XID glxdrawable, int type)
 int
 __glXDisp_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
-
     return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP);
 }
 
@@ -1469,11 +1440,8 @@ __glXDisp_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
-
     return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER);
 }
 
@@ -1623,8 +1591,6 @@ __glXDisp_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
     __GLXdrawable *pGlxDraw;
     int error;
 
-    REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
-
     tag = req->contextTag;
     drawId = req->drawable;
     if (tag) {
@@ -1723,11 +1689,8 @@ __glXDisp_QueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDisp_QueryContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
 
-    REQUEST_SIZE_MATCH(xGLXQueryContextReq);
-
     return DoQueryContext(cl, req->context);
 }
 
@@ -2363,8 +2326,6 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
     char *buf;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
-
     if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
         return err;
 
@@ -2418,8 +2379,6 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
     __GLXscreen *pGlxScreen;
     int err;
 
-    REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
-
     if (!validGlxScreen(client, req->screen, &pGlxScreen, &err))
         return err;
 
diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
index 4874be2635..7d6674470a 100644
--- a/glx/glxcmdsswap.c
+++ b/glx/glxcmdsswap.c
@@ -56,13 +56,10 @@
 int
 __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXCreateContextReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->context);
     __GLX_SWAP_INT(&req->visual);
@@ -75,13 +72,10 @@ __glXDispSwap_CreateContext(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_CreateNewContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXCreateNewContextReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->context);
     __GLX_SWAP_INT(&req->fbconfig);
@@ -115,13 +109,10 @@ __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_DestroyContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyContextReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->context);
 
@@ -149,13 +140,10 @@ __glXDispSwap_MakeCurrentReadSGI(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXIsDirectReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->context);
 
@@ -165,13 +153,10 @@ __glXDispSwap_IsDirect(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXQueryVersionReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->majorVersion);
     __GLX_SWAP_INT(&req->minorVersion);
@@ -182,13 +167,10 @@ __glXDispSwap_QueryVersion(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXWaitGLReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->contextTag);
 
@@ -198,13 +180,10 @@ __glXDispSwap_WaitGL(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXWaitXReq *req = (xGLXWaitXReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXWaitXReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->contextTag);
 
@@ -214,13 +193,10 @@ __glXDispSwap_WaitX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXCopyContextReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->source);
     __GLX_SWAP_INT(&req->dest);
@@ -232,13 +208,10 @@ __glXDispSwap_CopyContext(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq);
-
     __GLX_SWAP_INT(&req->screen);
     return __glXDisp_GetVisualConfigs(cl, pc);
 }
@@ -246,13 +219,10 @@ __glXDispSwap_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_GetFBConfigs(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq);
-
     __GLX_SWAP_INT(&req->screen);
     return __glXDisp_GetFBConfigs(cl, pc);
 }
@@ -274,13 +244,10 @@ __glXDispSwap_GetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_CreateGLXPixmap(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->screen);
     __GLX_SWAP_INT(&req->visual);
@@ -342,13 +309,10 @@ __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_DestroyGLXPixmap(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->glxpixmap);
 
@@ -374,13 +338,10 @@ __glXDispSwap_DestroyPixmap(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_QueryContext(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXQueryContextReq);
-
     __GLX_SWAP_INT(&req->context);
 
     return __glXDisp_QueryContext(cl, pc);
@@ -436,13 +397,10 @@ __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_DestroyPbuffer(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq);
-
     __GLX_SWAP_INT(&req->pbuffer);
 
     return __glXDisp_DestroyPbuffer(cl, pc);
@@ -566,13 +524,10 @@ __glXDispSwap_DestroyWindow(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXSwapBuffersReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->contextTag);
     __GLX_SWAP_INT(&req->drawable);
@@ -583,13 +538,10 @@ __glXDispSwap_SwapBuffers(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXUseXFontReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->contextTag);
     __GLX_SWAP_INT(&req->font);
@@ -603,13 +555,10 @@ __glXDispSwap_UseXFont(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->screen);
 
@@ -619,13 +568,10 @@ __glXDispSwap_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
 int
 __glXDispSwap_QueryServerString(__GLXclientState * cl, GLbyte * pc)
 {
-    ClientPtr client = cl->client;
     xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc;
 
     __GLX_DECLARE_SWAP_VARIABLES;
 
-    REQUEST_SIZE_MATCH(xGLXQueryServerStringReq);
-
     __GLX_SWAP_SHORT(&req->length);
     __GLX_SWAP_INT(&req->screen);
     __GLX_SWAP_INT(&req->name);
diff --git a/glx/xfont.c b/glx/xfont.c
index 83a455d73c..bd2fdae52c 100644
--- a/glx/xfont.c
+++ b/glx/xfont.c
@@ -152,8 +152,6 @@ __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc)
     __GLXcontext *cx;
     int error;
 
-    REQUEST_SIZE_MATCH(xGLXUseXFontReq);
-
     req = (xGLXUseXFontReq *) pc;
     cx = __glXForceCurrent(cl, req->contextTag, &error);
     if (!cx) {
-- 
2.13.5



More information about the xorg-devel mailing list