aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx/glxProxy
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/dmx/glxProxy')
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmds.c149
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmdsswap.c43
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxext.c11
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxext.h2
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxsingle.c56
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxvendor.c12
-rw-r--r--xorg-server/hw/dmx/glxProxy/unpack.h12
7 files changed, 146 insertions, 139 deletions
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c
index 49c6ef1ed..91011d109 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmds.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c
@@ -454,19 +454,18 @@ __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc;
- xGLXQueryMaxSwapBarriersSGIXReply reply;
-
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = 0;
- reply.max = QueryMaxSwapBarriersSGIX(req->screen);
+ xGLXQueryMaxSwapBarriersSGIXReply reply = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .max = QueryMaxSwapBarriersSGIX(req->screen)
+ };
if (client->swapped) {
__glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply,
- (char *) &reply);
+ WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, &reply);
}
return Success;
@@ -794,7 +793,11 @@ MakeCurrent(__GLXclientState * cl,
ClientPtr client = cl->client;
DrawablePtr pDraw = NULL;
DrawablePtr pReadDraw = NULL;
- xGLXMakeCurrentReadSGIReply new_reply;
+ xGLXMakeCurrentReadSGIReply new_reply = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0
+ };
xGLXMakeCurrentReq *be_req;
xGLXMakeCurrentReply be_reply;
xGLXMakeContextCurrentReq *be_new_req;
@@ -1198,9 +1201,6 @@ MakeCurrent(__GLXclientState * cl,
else {
new_reply.contextTag = 0;
}
- new_reply.length = 0;
- new_reply.type = X_Reply;
- new_reply.sequenceNumber = client->sequence;
#ifdef PANORAMIX
if (!noPanoramiXExtension) {
@@ -1388,8 +1388,7 @@ MakeCurrent(__GLXclientState * cl,
__glXSwapMakeCurrentReply(client, &new_reply);
}
else {
- WriteToClient(client, sz_xGLXMakeContextCurrentReply,
- (char *) &new_reply);
+ WriteToClient(client, sz_xGLXMakeContextCurrentReply, &new_reply);
}
return Success;
@@ -1440,16 +1439,18 @@ __glXIsDirect(__GLXclientState * cl, GLbyte * pc)
return __glXBadContext;
}
- reply.isDirect = 0;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXIsDirectReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .isDirect = 0
+ };
if (client->swapped) {
__glXSwapIsDirectReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXIsDirectReply, &reply);
}
return Success;
@@ -1461,24 +1462,25 @@ __glXQueryVersion(__GLXclientState * cl, GLbyte * pc)
ClientPtr client = cl->client;
/* xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; */
- xGLXQueryVersionReply reply;
+ xGLXQueryVersionReply reply = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
/*
** Server should take into consideration the version numbers sent by the
** client if it wants to work with older clients; however, in this
** implementation the server just returns its version number.
*/
- reply.majorVersion = __glXVersionMajor;
- reply.minorVersion = __glXVersionMinor;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ .majorVersion = __glXVersionMajor,
+ .minorVersion = __glXVersionMinor
+ };
if (client->swapped) {
__glXSwapQueryVersionReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
}
return Success;
}
@@ -1682,14 +1684,16 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
}
pGlxScreen = &__glXActiveScreens[screen];
- reply.numVisuals = pGlxScreen->numGLXVisuals;
- reply.numProps = __GLX_TOTAL_CONFIG;
- reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXGetVisualConfigsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .numVisuals = pGlxScreen->numGLXVisuals,
+ .numProps = __GLX_TOTAL_CONFIG,
+ .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
+ __GLX_TOTAL_CONFIG) >> 2
+ };
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
for (i = 0; i < pGlxScreen->numVisuals; i++) {
pGlxVisual = &pGlxScreen->pGlxVisual[i];
@@ -1743,8 +1747,7 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX;
buf[p++] = pGlxVisual->visualSelectGroup;
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *) buf);
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf);
}
return Success;
}
@@ -2628,18 +2631,19 @@ __glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
#endif
length = len;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = len;
- reply.n = numbytes;
+ reply = (xGLXQueryExtensionsStringReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = len,
+ .n = numbytes
+ };
if (client->swapped) {
glxSwapQueryExtensionsStringReply(client, &reply, be_buf);
}
else {
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply,
- (char *) &reply);
- WriteToClient(client, (int) (length << 2), (char *) be_buf);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
+ WriteToClient(client, (int) (length << 2), be_buf);
}
return Success;
@@ -2710,16 +2714,18 @@ __glXQueryServerString(__GLXclientState * cl, GLbyte * pc)
#endif
length = len;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = numbytes;
+ reply = (xGLXQueryServerStringReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = length,
+ .n = numbytes
+ };
if (client->swapped) {
glxSwapQueryServerStringReply(client, &reply, be_buf);
}
else {
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
WriteToClient(client, (int) (length << 2), be_buf);
}
@@ -2867,11 +2873,13 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
pGlxScreen = &__glXActiveScreens[screen];
numFBConfigs = __glXNumFBConfigs;
- reply.numFBConfigs = numFBConfigs;
- reply.numAttribs = numAttribs;
- reply.length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXGetFBConfigsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2,
+ .numFBConfigs = numFBConfigs,
+ .numAttribs = numAttribs
+ };
if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES;
@@ -2880,7 +2888,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
__GLX_SWAP_INT(&reply.numFBConfigs);
__GLX_SWAP_INT(&reply.numAttribs);
}
- WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply);
for (i = 0; i < numFBConfigs; i++) {
int associatedVisualId = 0;
@@ -3021,7 +3029,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
__GLX_DECLARE_SWAP_ARRAY_VARIABLES;
__GLX_SWAP_INT_ARRAY((int *) buf, 2 * numAttribs);
}
- WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, (char *) buf);
+ WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, buf);
}
return Success;
}
@@ -3199,10 +3207,12 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
nProps = 3;
- reply.length = nProps << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.n = nProps;
+ reply = (xGLXQueryContextReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = nProps << 1,
+ .n = nProps
+ };
nReplyBytes = reply.length << 2;
sendBuf = (int *) malloc(nReplyBytes);
@@ -3218,8 +3228,8 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
__glXSwapQueryContextReply(client, &reply, sendBuf);
}
else {
- WriteToClient(client, sz_xGLXQueryContextReply, (char *) &reply);
- WriteToClient(client, nReplyBytes, (char *) sendBuf);
+ WriteToClient(client, sz_xGLXQueryContextReply, &reply);
+ WriteToClient(client, nReplyBytes, sendBuf);
}
free((char *) sendBuf);
@@ -3249,10 +3259,12 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
nProps = 4;
- reply.length = nProps << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.n = nProps;
+ reply = (xGLXQueryContextInfoEXTReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = nProps << 1,
+ .n = nProps
+ };
nReplyBytes = reply.length << 2;
sendBuf = (int *) malloc(nReplyBytes);
@@ -3270,8 +3282,8 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
__glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf);
}
else {
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply);
- WriteToClient(client, nReplyBytes, (char *) sendBuf);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply);
+ WriteToClient(client, nReplyBytes, sendBuf);
}
free((char *) sendBuf);
@@ -3606,9 +3618,8 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc)
__glXSwapGetDrawableAttributesReply(client, &reply, (int *) attribs);
}
else {
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
- (char *) &reply);
- WriteToClient(client, attribs_size, (char *) attribs);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
+ WriteToClient(client, attribs_size, attribs);
}
free(attribs);
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmdsswap.c b/xorg-server/hw/dmx/glxProxy/glxcmdsswap.c
index ec0e83d09..ac79cda22 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmdsswap.c
@@ -293,18 +293,20 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
}
pGlxScreen = &__glXActiveScreens[screen];
- reply.numVisuals = pGlxScreen->numGLXVisuals;
- reply.numProps = __GLX_TOTAL_CONFIG;
- reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
- __GLX_TOTAL_CONFIG) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXGetVisualConfigsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
+ __GLX_TOTAL_CONFIG) >> 2,
+ .numVisuals = pGlxScreen->numGLXVisuals,
+ .numProps = __GLX_TOTAL_CONFIG
+ };
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.numVisuals);
__GLX_SWAP_INT(&reply.numProps);
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
for (i = 0; i < pGlxScreen->numVisuals; i++) {
pGlxVisual = &pGlxScreen->pGlxVisual[i];
@@ -353,8 +355,7 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
buf[p++] = pGlxVisual->transparentIndex;
__GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG);
- WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG,
- (char *) buf);
+ WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf);
}
return Success;
}
@@ -508,7 +509,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply * reply)
__GLX_SWAP_INT(&reply->writeType);
__GLX_SWAP_INT(&reply->readVid);
__GLX_SWAP_INT(&reply->readType);
- WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *) reply);
+ WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, reply);
}
void
@@ -517,7 +518,7 @@ __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply)
__GLX_DECLARE_SWAP_VARIABLES;
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
- WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply);
+ WriteToClient(client, sz_xGLXIsDirectReply, reply);
}
void
@@ -528,7 +529,7 @@ __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply)
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->majorVersion);
__GLX_SWAP_INT(&reply->minorVersion);
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryVersionReply, reply);
}
void
@@ -543,7 +544,7 @@ glxSwapQueryExtensionsStringReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply);
__GLX_SWAP_INT_ARRAY((int *) buf, length);
WriteToClient(client, length << 2, buf);
}
@@ -558,7 +559,7 @@ glxSwapQueryServerStringReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, reply);
/** no swap is needed for an array of chars **/
/* __GLX_SWAP_INT_ARRAY((int *)buf, length); */
WriteToClient(client, length << 2, buf);
@@ -576,9 +577,9 @@ __glXSwapQueryContextInfoEXTReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply);
__GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, (char *) buf);
+ WriteToClient(client, length << 2, buf);
}
void
@@ -592,9 +593,9 @@ __glXSwapQueryContextReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->n);
- WriteToClient(client, sz_xGLXQueryContextReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryContextReply, reply);
__GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, (char *) buf);
+ WriteToClient(client, length << 2, buf);
}
void
@@ -608,8 +609,8 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client,
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->numAttribs);
__GLX_SWAP_INT_ARRAY(buf, reply->length);
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
- WriteToClient(client, reply->length << 2, (char *) buf);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply);
+ WriteToClient(client, reply->length << 2, buf);
}
void
@@ -621,7 +622,7 @@ __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->max);
- WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *) reply);
+ WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, reply);
}
/************************************************************************/
diff --git a/xorg-server/hw/dmx/glxProxy/glxext.c b/xorg-server/hw/dmx/glxProxy/glxext.c
index b0710ccc6..812222195 100644
--- a/xorg-server/hw/dmx/glxProxy/glxext.c
+++ b/xorg-server/hw/dmx/glxProxy/glxext.c
@@ -44,16 +44,7 @@
#include "glxvisuals.h"
#include "micmap.h"
#include "glxswap.h"
-
-/*
-** Stubs to satisfy miinitext.c references.
-*/
-typedef int __GLXprovider;
-__GLXprovider __glXDRISWRastProvider;
-void
-GlxPushProvider(__GLXprovider * provider)
-{
-}
+#include "extinit.h"
/*
** Forward declarations.
diff --git a/xorg-server/hw/dmx/glxProxy/glxext.h b/xorg-server/hw/dmx/glxProxy/glxext.h
index 881152d1c..47cec15cf 100644
--- a/xorg-server/hw/dmx/glxProxy/glxext.h
+++ b/xorg-server/hw/dmx/glxProxy/glxext.h
@@ -64,8 +64,6 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *);
extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc);
extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc);
-extern void GlxExtensionInit(void);
-
extern Bool __glXCoreType(void);
#endif /* _glxext_h_ */
diff --git a/xorg-server/hw/dmx/glxProxy/glxsingle.c b/xorg-server/hw/dmx/glxProxy/glxsingle.c
index 63786cf79..87842001f 100644
--- a/xorg-server/hw/dmx/glxProxy/glxsingle.c
+++ b/xorg-server/hw/dmx/glxProxy/glxsingle.c
@@ -147,9 +147,9 @@ SendSwappedReply(ClientPtr client,
}
- WriteToClient(client, sizeof(xGLXSingleReply), (char *) reply);
+ WriteToClient(client, sizeof(xGLXSingleReply), reply);
if (buf_size > 0)
- WriteToClient(client, buf_size, (char *) buf);
+ WriteToClient(client, buf_size, buf);
}
@@ -269,21 +269,23 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
/*
* send the reply to the client
*/
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = be_reply.length;
- reply.retval = be_reply.retval;
- reply.size = be_reply.size;
- reply.pad3 = be_reply.pad3;
- reply.pad4 = be_reply.pad4;
+ reply = (xGLXSingleReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = be_reply.length,
+ .retval = be_reply.retval,
+ .size = be_reply.size,
+ .pad3 = be_reply.pad3,
+ .pad4 = be_reply.pad4
+ };
if (client->swapped) {
SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *) be_buf);
+ WriteToClient(client, be_buf_size, be_buf);
}
if (be_buf_size > 0)
@@ -371,21 +373,23 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
/*
* send the reply to the client
*/
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = be_reply.length;
- reply.retval = be_reply.retval;
- reply.size = be_reply.size;
- reply.pad3 = be_reply.pad3;
- reply.pad4 = be_reply.pad4;
+ reply = (xGLXSingleReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = be_reply.length,
+ .retval = be_reply.retval,
+ .size = be_reply.size,
+ .pad3 = be_reply.pad3,
+ .pad4 = be_reply.pad4
+ };
if (client->swapped) {
SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGLXSingleReply), &reply);
if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *) be_buf);
+ WriteToClient(client, be_buf_size, be_buf);
}
if (be_buf_size > 0)
@@ -1004,18 +1008,20 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
} /* of if buf_size > 0 */
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = buf_size >> 2;
+ reply = (xGLXReadPixelsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = buf_size >> 2
+ };
if (client->swapped) {
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
}
- WriteToClient(client, sizeof(xGLXReadPixelsReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGLXReadPixelsReply), &reply);
if (buf_size > 0) {
- WriteToClient(client, buf_size, (char *) buf);
+ WriteToClient(client, buf_size, buf);
free(buf);
}
diff --git a/xorg-server/hw/dmx/glxProxy/glxvendor.c b/xorg-server/hw/dmx/glxProxy/glxvendor.c
index 963c92e87..e5c8da144 100644
--- a/xorg-server/hw/dmx/glxProxy/glxvendor.c
+++ b/xorg-server/hw/dmx/glxProxy/glxvendor.c
@@ -138,9 +138,9 @@ SendSwappedReply(ClientPtr client,
}
- WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) reply);
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), reply);
if (buf_size > 0)
- WriteToClient(client, buf_size, (char *) buf);
+ WriteToClient(client, buf_size, buf);
}
@@ -265,9 +265,9 @@ __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *) be_buf);
+ WriteToClient(client, be_buf_size, be_buf);
}
if (be_buf_size > 0)
@@ -364,9 +364,9 @@ __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
SendSwappedReply(client, &reply, be_buf, be_buf_size);
}
else {
- WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply);
+ WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply);
if (be_buf_size > 0)
- WriteToClient(client, be_buf_size, (char *) be_buf);
+ WriteToClient(client, be_buf_size, be_buf);
}
if (be_buf_size > 0)
diff --git a/xorg-server/hw/dmx/glxProxy/unpack.h b/xorg-server/hw/dmx/glxProxy/unpack.h
index b4b73580c..45c27c6b9 100644
--- a/xorg-server/hw/dmx/glxProxy/unpack.h
+++ b/xorg-server/hw/dmx/glxProxy/unpack.h
@@ -59,7 +59,7 @@ extern xGLXSingleReply __glXReply;
__glXReply.sequenceNumber = client->sequence;
#define __GLX_SEND_HEADER() \
- WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply);
+ WriteToClient (client, sz_xGLXSingleReply, &__glXReply);
#define __GLX_PUT_RETVAL(a) \
__glXReply.retval = (a);
@@ -112,19 +112,19 @@ extern xGLXSingleReply __glXReply;
*(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer
#define __GLX_SEND_BYTE_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer)
+ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer)
#define __GLX_SEND_SHORT_ARRAY(len) \
- WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer)
+ WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer)
#define __GLX_SEND_INT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer)
+ WriteToClient(client, (len)*__GLX_SIZE_INT32, answer)
#define __GLX_SEND_FLOAT_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer)
+ WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer)
#define __GLX_SEND_DOUBLE_ARRAY(len) \
- WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer)
+ WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer)
#define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)
#define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len)