aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/Makefile.am2
-rw-r--r--xorg-server/glx/glxcmds.c137
-rw-r--r--xorg-server/glx/glxcmdsswap.c18
-rw-r--r--xorg-server/glx/glxdri2.c7
-rw-r--r--xorg-server/glx/glxdricommon.c2
-rw-r--r--xorg-server/glx/glxext.c12
-rw-r--r--xorg-server/glx/glxserver.h3
-rw-r--r--xorg-server/glx/indirect_util.c8
-rw-r--r--xorg-server/glx/single2.c20
-rw-r--r--xorg-server/glx/single2swap.c18
-rw-r--r--xorg-server/glx/unpack.h12
11 files changed, 131 insertions, 108 deletions
diff --git a/xorg-server/glx/Makefile.am b/xorg-server/glx/Makefile.am
index ced78b76a..591c4ac66 100644
--- a/xorg-server/glx/Makefile.am
+++ b/xorg-server/glx/Makefile.am
@@ -7,10 +7,8 @@ noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY)
AM_CFLAGS = \
@DIX_CFLAGS@ \
@GL_CFLAGS@ \
- @DRI_CFLAGS@ \
@XLIB_CFLAGS@ \
@LIBDRM_CFLAGS@ \
- @DRIPROTO_CFLAGS@ \
@GLX_DEFINES@ \
@GLX_ARCH_DEFINES@
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c
index d05421971..c1f4e22f8 100644
--- a/xorg-server/glx/glxcmds.c
+++ b/xorg-server/glx/glxcmds.c
@@ -651,23 +651,23 @@ DoMakeCurrent(__GLXclientState * cl,
StopUsingContext(prevglxc);
+ reply = (xGLXMakeCurrentReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .contextTag = 0
+ };
+
if (glxc) {
StartUsingContext(cl, glxc);
reply.contextTag = glxc->id;
}
- else {
- reply.contextTag = 0;
- }
-
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
if (client->swapped) {
__glXSwapMakeCurrentReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXMakeCurrentReply, &reply);
}
return Success;
}
@@ -722,16 +722,18 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc)
if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err))
return err;
- reply.isDirect = glxc->isDirect;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXIsDirectReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .isDirect = glxc->isDirect
+ };
if (client->swapped) {
__glXSwapIsDirectReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXIsDirectReply, &reply);
}
return Success;
@@ -757,17 +759,19 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc)
** client if it wants to work with older clients; however, in this
** implementation the server just returns its version number.
*/
- reply.majorVersion = glxMajorVersion;
- reply.minorVersion = glxMinorVersion;
- reply.length = 0;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXQueryVersionReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = glxMajorVersion,
+ .minorVersion = glxMinorVersion
+ };
if (client->swapped) {
__glXSwapQueryVersionReply(client, &reply);
}
else {
- WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
}
return Success;
}
@@ -935,12 +939,14 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err))
return err;
- reply.numVisuals = pGlxScreen->numVisuals;
- reply.numProps = GLX_VIS_CONFIG_TOTAL;
- reply.length =
- (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXGetVisualConfigsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = (pGlxScreen->numVisuals *
+ __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2,
+ .numVisuals = pGlxScreen->numVisuals,
+ .numProps = GLX_VIS_CONFIG_TOTAL
+ };
if (client->swapped) {
__GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -949,7 +955,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
__GLX_SWAP_INT(&reply.numProps);
}
- WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
for (i = 0; i < pGlxScreen->numVisuals; i++) {
modes = pGlxScreen->visuals[i];
@@ -1006,7 +1012,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
if (client->swapped) {
__GLX_SWAP_INT_ARRAY(buf, p);
}
- WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *) buf);
+ WriteToClient(client, __GLX_SIZE_CARD32 * p, buf);
}
return Success;
}
@@ -1039,11 +1045,13 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err))
return err;
- reply.numFBConfigs = pGlxScreen->numFBConfigs;
- reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS;
- reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs);
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
+ reply = (xGLXGetFBConfigsReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = __GLX_FBCONFIG_ATTRIBS_LENGTH * pGlxScreen->numFBConfigs,
+ .numFBConfigs = pGlxScreen->numFBConfigs,
+ .numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS
+ };
if (client->swapped) {
__GLX_SWAP_SHORT(&reply.sequenceNumber);
@@ -1052,7 +1060,7 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen)
__GLX_SWAP_INT(&reply.numAttribs);
}
- WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply);
for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) {
p = 0;
@@ -1663,10 +1671,12 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
return err;
nProps = 3;
- 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((size_t) nReplyBytes);
@@ -1685,8 +1695,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId)
__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);
@@ -1870,10 +1880,12 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
return error;
numAttribs = 3;
- reply.length = numAttribs << 1;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.numAttribs = numAttribs;
+ reply = (xGLXGetDrawableAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = numAttribs << 1,
+ .numAttribs = numAttribs
+ };
attributes[0] = GLX_TEXTURE_TARGET_EXT;
attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT :
@@ -1887,10 +1899,8 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
__glXSwapGetDrawableAttributesReply(client, &reply, attributes);
}
else {
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply,
- (char *) &reply);
- WriteToClient(client, reply.length * sizeof(CARD32),
- (char *) attributes);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply);
+ WriteToClient(client, reply.length * sizeof(CARD32), attributes);
}
return Success;
@@ -2311,13 +2321,15 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
n = strlen(pGlxScreen->GLXextensions) + 1;
length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
+ reply = (xGLXQueryExtensionsStringReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = length,
+ .n = n
+ };
/* Allocate buffer to make sure it's a multiple of 4 bytes big. */
- buf = (char *) malloc(length << 2);
+ buf = calloc(length, 4);
if (buf == NULL)
return BadAlloc;
memcpy(buf, pGlxScreen->GLXextensions, n);
@@ -2326,9 +2338,8 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
glxSwapQueryExtensionsStringReply(client, &reply, buf);
}
else {
- WriteToClient(client, sz_xGLXQueryExtensionsStringReply,
- (char *) &reply);
- WriteToClient(client, (int) (length << 2), (char *) buf);
+ WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply);
+ WriteToClient(client, (int) (length << 2), buf);
}
free(buf);
@@ -2373,12 +2384,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
n = strlen(ptr) + 1;
length = __GLX_PAD(n) >> 2;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.length = length;
- reply.n = n;
-
- buf = (char *) malloc(length << 2);
+ reply = (xGLXQueryServerStringReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = length,
+ .n = n
+ };
+
+ buf = calloc(length, 4);
if (buf == NULL) {
return BadAlloc;
}
@@ -2388,7 +2401,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc)
glxSwapQueryServerStringReply(client, &reply, buf);
}
else {
- WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXQueryServerStringReply, &reply);
WriteToClient(client, (int) (length << 2), buf);
}
diff --git a/xorg-server/glx/glxcmdsswap.c b/xorg-server/glx/glxcmdsswap.c
index e8520d6cb..43f88d335 100644
--- a/xorg-server/glx/glxcmdsswap.c
+++ b/xorg-server/glx/glxcmdsswap.c
@@ -840,7 +840,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply)
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->contextTag);
- WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) reply);
+ WriteToClient(client, sz_xGLXMakeCurrentReply, reply);
}
void
@@ -849,7 +849,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
@@ -860,7 +860,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
@@ -875,7 +875,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);
}
@@ -890,7 +890,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);
@@ -908,9 +908,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
@@ -925,9 +925,9 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client,
__GLX_SWAP_SHORT(&reply->sequenceNumber);
__GLX_SWAP_INT(&reply->length);
__GLX_SWAP_INT(&reply->numAttribs);
- WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply);
+ WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply);
__GLX_SWAP_INT_ARRAY((int *) buf, length);
- WriteToClient(client, length << 2, (char *) buf);
+ WriteToClient(client, length << 2, buf);
}
/************************************************************************/
diff --git a/xorg-server/glx/glxdri2.c b/xorg-server/glx/glxdri2.c
index 1e99179d4..909de706a 100644
--- a/xorg-server/glx/glxdri2.c
+++ b/xorg-server/glx/glxdri2.c
@@ -178,12 +178,13 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
CARD64 msc, CARD32 sbc)
{
__GLXdrawable *drawable = data;
- xGLXBufferSwapComplete2 wire;
+ xGLXBufferSwapComplete2 wire = {
+ .type = __glXEventBase + GLX_BufferSwapComplete
+ };
if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
return;
- wire.type = __glXEventBase + GLX_BufferSwapComplete;
switch (type) {
case DRI2_EXCHANGE_COMPLETE:
wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL;
@@ -929,7 +930,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
return NULL;
if (!xf86LoaderCheckSymbol("DRI2Connect") ||
- !DRI2Connect(pScreen, DRI2DriverDRI,
+ !DRI2Connect(serverClient, pScreen, DRI2DriverDRI,
&screen->fd, &driverName, &deviceName)) {
LogMessage(X_INFO,
"AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum);
diff --git a/xorg-server/glx/glxdricommon.c b/xorg-server/glx/glxdricommon.c
index 44d5a3e7b..c90f38098 100644
--- a/xorg-server/glx/glxdricommon.c
+++ b/xorg-server/glx/glxdricommon.c
@@ -107,8 +107,6 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits),
__ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture),
__ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),};
-#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
-
static void
setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value)
{
diff --git a/xorg-server/glx/glxext.c b/xorg-server/glx/glxext.c
index 8d168d8a3..a1f9d42e9 100644
--- a/xorg-server/glx/glxext.c
+++ b/xorg-server/glx/glxext.c
@@ -39,6 +39,7 @@
#include <registry.h>
#include "privates.h"
#include <os.h>
+#include "extinit.h"
#include "unpack.h"
#include "glxutil.h"
#include "glxext.h"
@@ -322,9 +323,15 @@ GlxExtensionInit(void)
ExtensionEntry *extEntry;
ScreenPtr pScreen;
int i;
- __GLXprovider *p;
+ __GLXprovider *p, **stack;
Bool glx_provided = False;
+ if (serverGeneration == 1) {
+ for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next)
+ ;
+ *stack = &__glXDRISWRastProvider;
+ }
+
__glXContextRes = CreateNewResourceType((DeleteType) ContextGone,
"GLXContext");
__glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone,
@@ -332,6 +339,9 @@ GlxExtensionInit(void)
if (!__glXContextRes || !__glXDrawableRes)
return;
+ if (serverGeneration == 1)
+ GlxPushProvider(&__glXDRISWRastProvider);
+
if (!dixRegisterPrivateKey
(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(__GLXclientState)))
return;
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 24e3d626f..d9b106b82 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -76,8 +76,6 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient);
/************************************************************************/
-void GlxExtensionInit(void);
-
void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates);
void __glXScreenInitVisuals(__GLXscreen * screen);
@@ -99,6 +97,7 @@ struct __GLXprovider {
const char *name;
__GLXprovider *next;
};
+__GLXprovider __glXDRISWRastProvider;
void GlxPushProvider(__GLXprovider * provider);
diff --git a/xorg-server/glx/indirect_util.c b/xorg-server/glx/indirect_util.c
index a54f70aee..a30b1f880 100644
--- a/xorg-server/glx/indirect_util.c
+++ b/xorg-server/glx/indirect_util.c
@@ -138,10 +138,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements,
*/
(void) memcpy(&__glXReply.pad3, data, 8);
- WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply);
+ WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
if (reply_ints != 0) {
- WriteToClient(client, reply_ints * 4, (char *) data);
+ WriteToClient(client, reply_ints * 4, data);
}
}
@@ -184,10 +184,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements,
*/
(void) memcpy(&__glXReply.pad3, data, 8);
- WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply);
+ WriteToClient(client, sz_xGLXSingleReply, &__glXReply);
if (reply_ints != 0) {
- WriteToClient(client, reply_ints * 4, (char *) data);
+ WriteToClient(client, reply_ints * 4, data);
}
}
diff --git a/xorg-server/glx/single2.c b/xorg-server/glx/single2.c
index 42cccc148..9597d29fe 100644
--- a/xorg-server/glx/single2.c
+++ b/xorg-server/glx/single2.c
@@ -193,15 +193,17 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc)
*/
noChangeAllowed:;
client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.retval = retval;
- reply.size = nitems;
- reply.newMode = newMode;
- WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply);
+ reply = (xGLXRenderModeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = nitems,
+ .retval = retval,
+ .size = nitems,
+ .newMode = newMode
+ };
+ WriteToClient(client, sz_xGLXRenderModeReply, &reply);
if (retBytes) {
- WriteToClient(client, retBytes, (char *) retBuffer);
+ WriteToClient(client, retBytes, retBuffer);
}
return Success;
}
@@ -384,7 +386,7 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap)
}
__GLX_SEND_HEADER();
- WriteToClient(client, length, (char *) string);
+ WriteToClient(client, length, string);
free(buf);
return Success;
diff --git a/xorg-server/glx/single2swap.c b/xorg-server/glx/single2swap.c
index e6bb585d9..1ca532836 100644
--- a/xorg-server/glx/single2swap.c
+++ b/xorg-server/glx/single2swap.c
@@ -205,20 +205,22 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc)
*/
noChangeAllowed:;
client = cl->client;
- reply.length = nitems;
- reply.type = X_Reply;
- reply.sequenceNumber = client->sequence;
- reply.retval = retval;
- reply.size = nitems;
- reply.newMode = newMode;
+ reply = (xGLXRenderModeReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = nitems,
+ .retval = retval,
+ .size = nitems,
+ .newMode = newMode
+ };
__GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length);
__GLX_SWAP_INT(&reply.retval);
__GLX_SWAP_INT(&reply.size);
__GLX_SWAP_INT(&reply.newMode);
- WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply);
+ WriteToClient(client, sz_xGLXRenderModeReply, &reply);
if (retBytes) {
- WriteToClient(client, retBytes, (char *) retBuffer);
+ WriteToClient(client, retBytes, retBuffer);
}
return Success;
}
diff --git a/xorg-server/glx/unpack.h b/xorg-server/glx/unpack.h
index 0a088fc33..52fba74e1 100644
--- a/xorg-server/glx/unpack.h
+++ b/xorg-server/glx/unpack.h
@@ -63,7 +63,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);
@@ -116,19 +116,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)