Use C99 designated initializers in dmx Replies

v2: fix in __glXGetVisualConfigs to not re-declare local 'reply' variable

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>

Fixup for Use C99 designated initializeres in dmx Replies

Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Alan Coopersmith 2012-07-09 19:12:43 -07:00 committed by Keith Packard
parent bd6f948c41
commit e4e827ec36
4 changed files with 216 additions and 161 deletions

View File

@ -208,16 +208,17 @@ dmxFetchInputAttributes(unsigned int mask,
static int static int
ProcDMXQueryVersion(ClientPtr client) 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); 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) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -238,10 +239,12 @@ ProcDMXSync(ClientPtr client)
dmxFlushPendingSyncs(); dmxFlushPendingSyncs();
rep.type = X_Reply; rep = (xDMXSyncReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = 0; .length = 0,
.status = 0
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -288,10 +291,12 @@ ProcDMXForceWindowCreation(ClientPtr client)
dmxForceWindowCreation(pWin); dmxForceWindowCreation(pWin);
doreply: doreply:
dmxFlushPendingSyncs(); dmxFlushPendingSyncs();
rep.type = X_Reply; rep = (xDMXForceWindowCreationReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = 0; .length = 0,
.status = 0
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -308,10 +313,12 @@ ProcDMXGetScreenCount(ClientPtr client)
REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
rep.type = X_Reply; rep = (xDMXGetScreenCountReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.screenCount = dmxGetNumScreens(); .length = 0,
.screenCount = dmxGetNumScreens()
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -339,27 +346,29 @@ ProcDMXGetScreenAttributes(ClientPtr client)
if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr)) if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
return BadValue; 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; length = attr.displayName ? strlen(attr.displayName) : 0;
paddedLength = pad_to_int32(length); paddedLength = pad_to_int32(length);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep = (xDMXGetScreenAttributesReply) {
rep.length = .type = X_Reply,
bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - .sequenceNumber = client->sequence,
sizeof(xGenericReply)) .length =
+ paddedLength); bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) -
rep.displayNameLength = length; 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) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
@ -442,11 +451,13 @@ ProcDMXChangeScreensAttributes(ClientPtr client)
return status; return status;
noxinerama: noxinerama:
rep.type = X_Reply; rep = (xDMXChangeScreensAttributesReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
rep.errorScreen = errorScreen; .status = status,
.errorScreen = errorScreen
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -491,11 +502,13 @@ ProcDMXAddScreen(ClientPtr client)
free(name); free(name);
rep.type = X_Reply; rep = (xDMXAddScreenReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
rep.physicalScreen = stuff->physicalScreen; .status = status,
.physicalScreen = stuff->physicalScreen
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -517,10 +530,12 @@ ProcDMXRemoveScreen(ClientPtr client)
status = dmxDetachScreen(stuff->physicalScreen); status = dmxDetachScreen(stuff->physicalScreen);
rep.type = X_Reply; rep = (xDMXRemoveScreenReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
.status = status
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -636,10 +651,12 @@ ProcDMXGetWindowAttributes(ClientPtr client)
return BadWindow; return BadWindow;
} }
rep.type = X_Reply; rep = (xDMXGetWindowAttributesReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = count * 6; .sequenceNumber = client->sequence,
rep.screenCount = count; .length = count * 6,
.screenCount = count
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -688,14 +705,15 @@ ProcDMXGetDesktopAttributes(ClientPtr client)
dmxGetDesktopAttributes(&attr); dmxGetDesktopAttributes(&attr);
rep.width = attr.width; rep = (xDMXGetDesktopAttributesReply) {
rep.height = attr.height; .type = X_Reply,
rep.shiftX = attr.shiftX; .sequenceNumber = client->sequence,
rep.shiftY = attr.shiftY; .length = 0,
.width = attr.width,
rep.type = X_Reply; .height = attr.height,
rep.sequenceNumber = client->sequence; .shiftX = attr.shiftX,
rep.length = 0; .shiftY = attr.shiftY
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
@ -739,10 +757,12 @@ ProcDMXChangeDesktopAttributes(ClientPtr client)
return status; return status;
noxinerama: noxinerama:
rep.type = X_Reply; rep = (xDMXChangeDesktopAttributesReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
.status = status
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -759,10 +779,12 @@ ProcDMXGetInputCount(ClientPtr client)
REQUEST_SIZE_MATCH(xDMXGetInputCountReq); REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
rep.type = X_Reply; rep = (xDMXGetInputCountReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.inputCount = dmxGetInputCount(); .length = 0,
.inputCount = dmxGetInputCount()
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -785,19 +807,24 @@ ProcDMXGetInputAttributes(ClientPtr client)
if (dmxGetInputAttributes(stuff->deviceId, &attr)) if (dmxGetInputAttributes(stuff->deviceId, &attr))
return BadValue; 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; length = attr.name ? strlen(attr.name) : 0;
paddedLength = pad_to_int32(length); paddedLength = pad_to_int32(length);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence; rep = (xDMXGetInputAttributesReply) {
rep.length = bytes_to_int32(paddedLength); .type = X_Reply,
rep.nameLength = length; .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) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -849,11 +876,13 @@ ProcDMXAddInput(ClientPtr client)
if (status) if (status)
return status; return status;
rep.type = X_Reply; rep = (xDMXAddInputReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
rep.physicalId = id; .status = status,
.physicalId = id
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);
@ -878,10 +907,12 @@ ProcDMXRemoveInput(ClientPtr client)
if (status) if (status)
return status; return status;
rep.type = X_Reply; rep = (xDMXRemoveInputReply) {
rep.sequenceNumber = client->sequence; .type = X_Reply,
rep.length = 0; .sequenceNumber = client->sequence,
rep.status = status; .length = 0,
.status = status
};
if (client->swapped) { if (client->swapped) {
swaps(&rep.sequenceNumber); swaps(&rep.sequenceNumber);
swapl(&rep.length); swapl(&rep.length);

View File

@ -454,12 +454,12 @@ __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
xGLXQueryMaxSwapBarriersSGIXReq *req = xGLXQueryMaxSwapBarriersSGIXReq *req =
(xGLXQueryMaxSwapBarriersSGIXReq *) pc; (xGLXQueryMaxSwapBarriersSGIXReq *) pc;
xGLXQueryMaxSwapBarriersSGIXReply reply; xGLXQueryMaxSwapBarriersSGIXReply reply = {
.type = X_Reply,
reply.type = X_Reply; .sequenceNumber = client->sequence,
reply.sequenceNumber = client->sequence; .length = 0,
reply.length = 0; .max = QueryMaxSwapBarriersSGIX(req->screen)
reply.max = QueryMaxSwapBarriersSGIX(req->screen); };
if (client->swapped) { if (client->swapped) {
__glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply); __glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply);
@ -793,7 +793,11 @@ MakeCurrent(__GLXclientState * cl,
ClientPtr client = cl->client; ClientPtr client = cl->client;
DrawablePtr pDraw = NULL; DrawablePtr pDraw = NULL;
DrawablePtr pReadDraw = NULL; DrawablePtr pReadDraw = NULL;
xGLXMakeCurrentReadSGIReply new_reply; xGLXMakeCurrentReadSGIReply new_reply = {
.type = X_Reply,
.sequenceNumber = client->sequence,
.length = 0
};
xGLXMakeCurrentReq *be_req; xGLXMakeCurrentReq *be_req;
xGLXMakeCurrentReply be_reply; xGLXMakeCurrentReply be_reply;
xGLXMakeContextCurrentReq *be_new_req; xGLXMakeContextCurrentReq *be_new_req;
@ -1197,9 +1201,6 @@ MakeCurrent(__GLXclientState * cl,
else { else {
new_reply.contextTag = 0; new_reply.contextTag = 0;
} }
new_reply.length = 0;
new_reply.type = X_Reply;
new_reply.sequenceNumber = client->sequence;
#ifdef PANORAMIX #ifdef PANORAMIX
if (!noPanoramiXExtension) { if (!noPanoramiXExtension) {
@ -1438,10 +1439,12 @@ __glXIsDirect(__GLXclientState * cl, GLbyte * pc)
return __glXBadContext; return __glXBadContext;
} }
reply.isDirect = 0; reply = (xGLXIsDirectReply) {
reply.length = 0; .type = X_Reply,
reply.type = X_Reply; .sequenceNumber = client->sequence,
reply.sequenceNumber = client->sequence; .length = 0,
.isDirect = 0
};
if (client->swapped) { if (client->swapped) {
__glXSwapIsDirectReply(client, &reply); __glXSwapIsDirectReply(client, &reply);
@ -1459,18 +1462,19 @@ __glXQueryVersion(__GLXclientState * cl, GLbyte * pc)
ClientPtr client = cl->client; ClientPtr client = cl->client;
/* xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; */ /* 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 ** Server should take into consideration the version numbers sent by the
** client if it wants to work with older clients; however, in this ** client if it wants to work with older clients; however, in this
** implementation the server just returns its version number. ** implementation the server just returns its version number.
*/ */
reply.majorVersion = __glXVersionMajor; .majorVersion = __glXVersionMajor,
reply.minorVersion = __glXVersionMinor; .minorVersion = __glXVersionMinor
reply.length = 0; };
reply.type = X_Reply;
reply.sequenceNumber = client->sequence;
if (client->swapped) { if (client->swapped) {
__glXSwapQueryVersionReply(client, &reply); __glXSwapQueryVersionReply(client, &reply);
@ -1680,12 +1684,14 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
} }
pGlxScreen = &__glXActiveScreens[screen]; pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numGLXVisuals; reply = (xGLXGetVisualConfigsReply) {
reply.numProps = __GLX_TOTAL_CONFIG; .type = X_Reply,
reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * .sequenceNumber = client->sequence,
__GLX_TOTAL_CONFIG) >> 2; .numVisuals = pGlxScreen->numGLXVisuals,
reply.type = X_Reply; .numProps = __GLX_TOTAL_CONFIG,
reply.sequenceNumber = client->sequence; .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
__GLX_TOTAL_CONFIG) >> 2
};
WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply);
@ -2625,10 +2631,12 @@ __glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc)
#endif #endif
length = len; length = len;
reply.type = X_Reply; reply = (xGLXQueryExtensionsStringReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = len; .sequenceNumber = client->sequence,
reply.n = numbytes; .length = len,
.n = numbytes
};
if (client->swapped) { if (client->swapped) {
glxSwapQueryExtensionsStringReply(client, &reply, be_buf); glxSwapQueryExtensionsStringReply(client, &reply, be_buf);
@ -2706,10 +2714,12 @@ __glXQueryServerString(__GLXclientState * cl, GLbyte * pc)
#endif #endif
length = len; length = len;
reply.type = X_Reply; reply = (xGLXQueryServerStringReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = length; .sequenceNumber = client->sequence,
reply.n = numbytes; .length = length,
.n = numbytes
};
if (client->swapped) { if (client->swapped) {
glxSwapQueryServerStringReply(client, &reply, be_buf); glxSwapQueryServerStringReply(client, &reply, be_buf);
@ -2863,11 +2873,13 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc)
pGlxScreen = &__glXActiveScreens[screen]; pGlxScreen = &__glXActiveScreens[screen];
numFBConfigs = __glXNumFBConfigs; numFBConfigs = __glXNumFBConfigs;
reply.numFBConfigs = numFBConfigs; reply = (xGLXGetFBConfigsReply) {
reply.numAttribs = numAttribs; .type = X_Reply,
reply.length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2; .sequenceNumber = client->sequence,
reply.type = X_Reply; .length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2,
reply.sequenceNumber = client->sequence; .numFBConfigs = numFBConfigs,
.numAttribs = numAttribs
};
if (client->swapped) { if (client->swapped) {
__GLX_DECLARE_SWAP_VARIABLES; __GLX_DECLARE_SWAP_VARIABLES;
@ -3195,10 +3207,12 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc)
nProps = 3; nProps = 3;
reply.length = nProps << 1; reply = (xGLXQueryContextReply) {
reply.type = X_Reply; .type = X_Reply,
reply.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
reply.n = nProps; .length = nProps << 1,
.n = nProps
};
nReplyBytes = reply.length << 2; nReplyBytes = reply.length << 2;
sendBuf = (int *) malloc(nReplyBytes); sendBuf = (int *) malloc(nReplyBytes);
@ -3245,10 +3259,12 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc)
nProps = 4; nProps = 4;
reply.length = nProps << 1; reply = (xGLXQueryContextInfoEXTReply) {
reply.type = X_Reply; .type = X_Reply,
reply.sequenceNumber = client->sequence; .sequenceNumber = client->sequence,
reply.n = nProps; .length = nProps << 1,
.n = nProps
};
nReplyBytes = reply.length << 2; nReplyBytes = reply.length << 2;
sendBuf = (int *) malloc(nReplyBytes); sendBuf = (int *) malloc(nReplyBytes);

View File

@ -293,12 +293,14 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc)
} }
pGlxScreen = &__glXActiveScreens[screen]; pGlxScreen = &__glXActiveScreens[screen];
reply.numVisuals = pGlxScreen->numGLXVisuals; reply = (xGLXGetVisualConfigsReply) {
reply.numProps = __GLX_TOTAL_CONFIG; .type = X_Reply,
reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * .sequenceNumber = client->sequence,
__GLX_TOTAL_CONFIG) >> 2; .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 *
reply.type = X_Reply; __GLX_TOTAL_CONFIG) >> 2,
reply.sequenceNumber = client->sequence; .numVisuals = pGlxScreen->numGLXVisuals,
.numProps = __GLX_TOTAL_CONFIG
};
__GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_SHORT(&reply.sequenceNumber);
__GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.length);

View File

@ -269,13 +269,15 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc)
/* /*
* send the reply to the client * send the reply to the client
*/ */
reply.type = X_Reply; reply = (xGLXSingleReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = be_reply.length; .sequenceNumber = client->sequence,
reply.retval = be_reply.retval; .length = be_reply.length,
reply.size = be_reply.size; .retval = be_reply.retval,
reply.pad3 = be_reply.pad3; .size = be_reply.size,
reply.pad4 = be_reply.pad4; .pad3 = be_reply.pad3,
.pad4 = be_reply.pad4
};
if (client->swapped) { if (client->swapped) {
SendSwappedReply(client, &reply, be_buf, be_buf_size); SendSwappedReply(client, &reply, be_buf, be_buf_size);
@ -371,13 +373,15 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc)
/* /*
* send the reply to the client * send the reply to the client
*/ */
reply.type = X_Reply; reply = (xGLXSingleReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = be_reply.length; .sequenceNumber = client->sequence,
reply.retval = be_reply.retval; .length = be_reply.length,
reply.size = be_reply.size; .retval = be_reply.retval,
reply.pad3 = be_reply.pad3; .size = be_reply.size,
reply.pad4 = be_reply.pad4; .pad3 = be_reply.pad3,
.pad4 = be_reply.pad4
};
if (client->swapped) { if (client->swapped) {
SendSwappedReply(client, &reply, be_buf, be_buf_size); SendSwappedReply(client, &reply, be_buf, be_buf_size);
@ -1004,9 +1008,11 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc)
} /* of if buf_size > 0 */ } /* of if buf_size > 0 */
reply.type = X_Reply; reply = (xGLXReadPixelsReply) {
reply.sequenceNumber = client->sequence; .type = X_Reply,
reply.length = buf_size >> 2; .sequenceNumber = client->sequence,
.length = buf_size >> 2
};
if (client->swapped) { if (client->swapped) {
__GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_SHORT(&reply.sequenceNumber);