aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/dmx
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
committermarha <marha@users.sourceforge.net>2012-07-10 14:56:29 +0200
commitd137057fd13e83ec15ab416c7fe774741da06047 (patch)
treef4b38caa4f3ecb983f00e84f4f4d8d66699ecbc5 /xorg-server/hw/dmx
parentc29d91cfd8df084f16d0d2dfa82c3a86f7719a73 (diff)
downloadvcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.gz
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.tar.bz2
vcxsrv-d137057fd13e83ec15ab416c7fe774741da06047.zip
fontconfig mesa xserver git update 10 Jul 2012
Diffstat (limited to 'xorg-server/hw/dmx')
-rw-r--r--xorg-server/hw/dmx/dmx.c260
-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
8 files changed, 290 insertions, 255 deletions
diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c
index a226c5db1..0f7cb5c64 100644
--- a/xorg-server/hw/dmx/dmx.c
+++ b/xorg-server/hw/dmx/dmx.c
@@ -52,6 +52,7 @@
#include "os.h"
#include "dixstruct.h"
#include "extnsionst.h"
+#include "extinit.h"
#include "opaque.h"
#include "dmxextension.h"
@@ -65,8 +66,6 @@ extern unsigned long XRT_WINDOW;
extern int PanoramiXNumScreens;
#endif
-extern void DMXExtensionInit(void);
-
static unsigned char DMXCode;
static int
@@ -208,16 +207,17 @@ dmxFetchInputAttributes(unsigned int mask,
static int
ProcDMXQueryVersion(ClientPtr client)
{
- xDMXQueryVersionReply rep;
+ xDMXQueryVersionReply rep = {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .majorVersion = SERVER_DMX_MAJOR_VERSION,
+ .minorVersion = SERVER_DMX_MINOR_VERSION,
+ .patchVersion = SERVER_DMX_PATCH_VERSION
+ };
REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
- rep.minorVersion = SERVER_DMX_MINOR_VERSION;
- rep.patchVersion = SERVER_DMX_PATCH_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -225,7 +225,7 @@ ProcDMXQueryVersion(ClientPtr client)
swapl(&rep.minorVersion);
swapl(&rep.patchVersion);
}
- WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXQueryVersionReply), &rep);
return Success;
}
@@ -238,16 +238,18 @@ ProcDMXSync(ClientPtr client)
dmxFlushPendingSyncs();
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
+ rep = (xDMXSyncReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = 0
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXSyncReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXSyncReply), &rep);
return Success;
}
@@ -288,16 +290,18 @@ ProcDMXForceWindowCreation(ClientPtr client)
dmxForceWindowCreation(pWin);
doreply:
dmxFlushPendingSyncs();
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
+ rep = (xDMXForceWindowCreationReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = 0
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXForceWindowCreationReply), &rep);
return Success;
}
@@ -308,16 +312,18 @@ ProcDMXGetScreenCount(ClientPtr client)
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.screenCount = dmxGetNumScreens();
+ rep = (xDMXGetScreenCountReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .screenCount = dmxGetNumScreens()
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.screenCount);
}
- WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetScreenCountReply), &rep);
return Success;
}
@@ -339,27 +345,29 @@ ProcDMXGetScreenAttributes(ClientPtr client)
if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
return BadValue;
- rep.logicalScreen = attr.logicalScreen;
- rep.screenWindowWidth = attr.screenWindowWidth;
- rep.screenWindowHeight = attr.screenWindowHeight;
- rep.screenWindowXoffset = attr.screenWindowXoffset;
- rep.screenWindowYoffset = attr.screenWindowYoffset;
- rep.rootWindowWidth = attr.rootWindowWidth;
- rep.rootWindowHeight = attr.rootWindowHeight;
- rep.rootWindowXoffset = attr.rootWindowXoffset;
- rep.rootWindowYoffset = attr.rootWindowYoffset;
- rep.rootWindowXorigin = attr.rootWindowXorigin;
- rep.rootWindowYorigin = attr.rootWindowYorigin;
-
length = attr.displayName ? strlen(attr.displayName) : 0;
paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length =
- bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
- sizeof(xGenericReply))
- + paddedLength);
- rep.displayNameLength = length;
+
+ rep = (xDMXGetScreenAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length =
+ bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
+ sizeof(xGenericReply))
+ + paddedLength),
+ .displayNameLength = length,
+ .logicalScreen = attr.logicalScreen,
+ .screenWindowWidth = attr.screenWindowWidth,
+ .screenWindowHeight = attr.screenWindowHeight,
+ .screenWindowXoffset = attr.screenWindowXoffset,
+ .screenWindowYoffset = attr.screenWindowYoffset,
+ .rootWindowWidth = attr.rootWindowWidth,
+ .rootWindowHeight = attr.rootWindowHeight,
+ .rootWindowXoffset = attr.rootWindowXoffset,
+ .rootWindowYoffset = attr.rootWindowYoffset,
+ .rootWindowXorigin = attr.rootWindowXorigin,
+ .rootWindowYorigin = attr.rootWindowYorigin
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -377,9 +385,9 @@ ProcDMXGetScreenAttributes(ClientPtr client)
swaps(&rep.rootWindowXorigin);
swaps(&rep.rootWindowYorigin);
}
- WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), &rep);
if (length)
- WriteToClient(client, length, (char *) attr.displayName);
+ WriteToClient(client, length, attr.displayName);
return Success;
}
@@ -442,19 +450,20 @@ ProcDMXChangeScreensAttributes(ClientPtr client)
return status;
noxinerama:
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.errorScreen = errorScreen;
+ rep = (xDMXChangeScreensAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status,
+ .errorScreen = errorScreen
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
swapl(&rep.errorScreen);
}
- WriteToClient(client,
- sizeof(xDMXChangeScreensAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), &rep);
return Success;
}
@@ -492,18 +501,20 @@ ProcDMXAddScreen(ClientPtr client)
free(name);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.physicalScreen = stuff->physicalScreen;
+ rep = (xDMXAddScreenReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status,
+ .physicalScreen = stuff->physicalScreen
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
swapl(&rep.physicalScreen);
}
- WriteToClient(client, sizeof(xDMXAddScreenReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXAddScreenReply), &rep);
return Success;
}
@@ -518,16 +529,18 @@ ProcDMXRemoveScreen(ClientPtr client)
status = dmxDetachScreen(stuff->physicalScreen);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep = (xDMXRemoveScreenReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXRemoveScreenReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXRemoveScreenReply), &rep);
return Success;
}
@@ -637,10 +650,12 @@ ProcDMXGetWindowAttributes(ClientPtr client)
return BadWindow;
}
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = count * 6;
- rep.screenCount = count;
+ rep = (xDMXGetWindowAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = count * 6,
+ .screenCount = count
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -663,12 +678,12 @@ ProcDMXGetWindowAttributes(ClientPtr client)
dmxFlushPendingSyncs();
- WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), &rep);
if (count) {
- WriteToClient(client, count * sizeof(*screens), (char *) screens);
- WriteToClient(client, count * sizeof(*windows), (char *) windows);
- WriteToClient(client, count * sizeof(*pos), (char *) pos);
- WriteToClient(client, count * sizeof(*vis), (char *) vis);
+ WriteToClient(client, count * sizeof(*screens), screens);
+ WriteToClient(client, count * sizeof(*windows), windows);
+ WriteToClient(client, count * sizeof(*pos), pos);
+ WriteToClient(client, count * sizeof(*vis), vis);
}
free(vis);
@@ -689,14 +704,15 @@ ProcDMXGetDesktopAttributes(ClientPtr client)
dmxGetDesktopAttributes(&attr);
- rep.width = attr.width;
- rep.height = attr.height;
- rep.shiftX = attr.shiftX;
- rep.shiftY = attr.shiftY;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
+ rep = (xDMXGetDesktopAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .width = attr.width,
+ .height = attr.height,
+ .shiftX = attr.shiftX,
+ .shiftY = attr.shiftY
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
@@ -706,7 +722,7 @@ ProcDMXGetDesktopAttributes(ClientPtr client)
swaps(&rep.shiftX);
swaps(&rep.shiftY);
}
- WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), &rep);
return Success;
}
@@ -740,17 +756,18 @@ ProcDMXChangeDesktopAttributes(ClientPtr client)
return status;
noxinerama:
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep = (xDMXChangeDesktopAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client,
- sizeof(xDMXChangeDesktopAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), &rep);
return Success;
}
@@ -761,16 +778,18 @@ ProcDMXGetInputCount(ClientPtr client)
REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.inputCount = dmxGetInputCount();
+ rep = (xDMXGetInputCountReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .inputCount = dmxGetInputCount()
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.inputCount);
}
- WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetInputCountReply), &rep);
return Success;
}
@@ -787,19 +806,24 @@ ProcDMXGetInputAttributes(ClientPtr client)
if (dmxGetInputAttributes(stuff->deviceId, &attr))
return BadValue;
- rep.inputType = attr.inputType;
- rep.physicalScreen = attr.physicalScreen;
- rep.physicalId = attr.physicalId;
- rep.isCore = attr.isCore;
- rep.sendsCore = attr.sendsCore;
- rep.detached = attr.detached;
length = attr.name ? strlen(attr.name) : 0;
paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(paddedLength);
- rep.nameLength = length;
+
+ rep = (xDMXGetInputAttributesReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = bytes_to_int32(paddedLength),
+
+ .inputType = attr.inputType,
+ .physicalScreen = attr.physicalScreen,
+ .physicalId = attr.physicalId,
+ .nameLength = length,
+ .isCore = attr.isCore,
+ .sendsCore = attr.sendsCore,
+ .detached = attr.detached
+ };
+
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
@@ -808,9 +832,9 @@ ProcDMXGetInputAttributes(ClientPtr client)
swapl(&rep.physicalId);
swapl(&rep.nameLength);
}
- WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXGetInputAttributesReply), &rep);
if (length)
- WriteToClient(client, length, (char *) attr.name);
+ WriteToClient(client, length, attr.name);
return Success;
}
@@ -851,18 +875,20 @@ ProcDMXAddInput(ClientPtr client)
if (status)
return status;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.physicalId = id;
+ rep = (xDMXAddInputReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status,
+ .physicalId = id
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
swapl(&rep.physicalId);
}
- WriteToClient(client, sizeof(xDMXAddInputReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXAddInputReply), &rep);
return Success;
}
@@ -880,16 +906,18 @@ ProcDMXRemoveInput(ClientPtr client)
if (status)
return status;
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
+ rep = (xDMXRemoveInputReply) {
+ .type = X_Reply,
+ .sequenceNumber = client->sequence,
+ .length = 0,
+ .status = status
+ };
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swapl(&rep.status);
}
- WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *) &rep);
+ WriteToClient(client, sizeof(xDMXRemoveInputReply), &rep);
return Success;
}
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)