Use C99 designated initializers in Xext Replies
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
d792ac125a
commit
6a721e3af5
|
@ -55,11 +55,12 @@ ProcBigReqDispatch(ClientPtr client)
|
||||||
return BadRequest;
|
return BadRequest;
|
||||||
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
REQUEST_SIZE_MATCH(xBigReqEnableReq);
|
||||||
client->big_requests = TRUE;
|
client->big_requests = TRUE;
|
||||||
memset(&rep, 0, sizeof(xBigReqEnableReply));
|
rep = (xBigReqEnableReply) {
|
||||||
rep.type = X_Reply;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
rep.max_request_size = maxBigRequestSize;
|
.max_request_size = maxBigRequestSize
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.max_request_size);
|
swapl(&rep.max_request_size);
|
||||||
|
|
55
Xext/dpms.c
55
Xext/dpms.c
|
@ -45,15 +45,16 @@ static int
|
||||||
ProcDPMSGetVersion(ClientPtr client)
|
ProcDPMSGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSGetVersionReq); */
|
/* REQUEST(xDPMSGetVersionReq); */
|
||||||
xDPMSGetVersionReply rep;
|
xDPMSGetVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = DPMSMajorVersion,
|
||||||
|
.minorVersion = DPMSMinorVersion
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = DPMSMajorVersion;
|
|
||||||
rep.minorVersion = DPMSMinorVersion;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.majorVersion);
|
swaps(&rep.majorVersion);
|
||||||
|
@ -67,15 +68,15 @@ static int
|
||||||
ProcDPMSCapable(ClientPtr client)
|
ProcDPMSCapable(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSCapableReq); */
|
/* REQUEST(xDPMSCapableReq); */
|
||||||
xDPMSCapableReply rep;
|
xDPMSCapableReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.capable = DPMSCapableFlag
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
REQUEST_SIZE_MATCH(xDPMSCapableReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.capable = DPMSCapableFlag;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
}
|
}
|
||||||
|
@ -87,17 +88,17 @@ static int
|
||||||
ProcDPMSGetTimeouts(ClientPtr client)
|
ProcDPMSGetTimeouts(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSGetTimeoutsReq); */
|
/* REQUEST(xDPMSGetTimeoutsReq); */
|
||||||
xDPMSGetTimeoutsReply rep;
|
xDPMSGetTimeoutsReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.standby = DPMSStandbyTime / MILLI_PER_SECOND,
|
||||||
|
.suspend = DPMSSuspendTime / MILLI_PER_SECOND,
|
||||||
|
.off = DPMSOffTime / MILLI_PER_SECOND
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
|
|
||||||
rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
|
|
||||||
rep.off = DPMSOffTime / MILLI_PER_SECOND;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.standby);
|
swaps(&rep.standby);
|
||||||
|
@ -188,16 +189,16 @@ static int
|
||||||
ProcDPMSInfo(ClientPtr client)
|
ProcDPMSInfo(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xDPMSInfoReq); */
|
/* REQUEST(xDPMSInfoReq); */
|
||||||
xDPMSInfoReply rep;
|
xDPMSInfoReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.power_level = DPMSPowerLevel,
|
||||||
|
.state = DPMSEnabled
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
REQUEST_SIZE_MATCH(xDPMSInfoReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.power_level = DPMSPowerLevel;
|
|
||||||
rep.state = DPMSEnabled;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.power_level);
|
swaps(&rep.power_level);
|
||||||
|
|
16
Xext/geext.c
16
Xext/geext.c
|
@ -65,14 +65,16 @@ ProcGEQueryVersion(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
|
||||||
|
|
||||||
rep.repType = X_Reply;
|
rep = (xGEQueryVersionReply) {
|
||||||
rep.RepType = X_GEQueryVersion;
|
.repType = X_Reply,
|
||||||
rep.length = 0;
|
.RepType = X_GEQueryVersion,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
|
||||||
/* return the supported version by the server */
|
/* return the supported version by the server */
|
||||||
rep.majorVersion = SERVER_GE_MAJOR_VERSION;
|
.majorVersion = SERVER_GE_MAJOR_VERSION,
|
||||||
rep.minorVersion = SERVER_GE_MINOR_VERSION;
|
.minorVersion = SERVER_GE_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
/* Remember version the client requested */
|
/* Remember version the client requested */
|
||||||
pGEClient->major_version = stuff->majorVersion;
|
pGEClient->major_version = stuff->majorVersion;
|
||||||
|
|
|
@ -904,14 +904,15 @@ int
|
||||||
ProcPanoramiXQueryVersion(ClientPtr client)
|
ProcPanoramiXQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xPanoramiXQueryVersionReq); */
|
/* REQUEST(xPanoramiXQueryVersionReq); */
|
||||||
xPanoramiXQueryVersionReply rep;
|
xPanoramiXQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_PANORAMIX_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -935,11 +936,13 @@ ProcPanoramiXGetState(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xPanoramiXGetStateReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.state = !noPanoramiXExtension,
|
||||||
rep.state = !noPanoramiXExtension;
|
.sequenceNumber = client->sequence,
|
||||||
rep.window = stuff->window;
|
.length = 0,
|
||||||
|
.window = stuff->window
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -963,11 +966,13 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xPanoramiXGetScreenCountReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.ScreenCount = PanoramiXNumScreens,
|
||||||
rep.ScreenCount = PanoramiXNumScreens;
|
.sequenceNumber = client->sequence,
|
||||||
rep.window = stuff->window;
|
.length = 0,
|
||||||
|
.window = stuff->window
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -993,14 +998,16 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xPanoramiXGetScreenSizeReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
/* screen dimensions */
|
/* screen dimensions */
|
||||||
rep.width = screenInfo.screens[stuff->screen]->width;
|
.width = screenInfo.screens[stuff->screen]->width,
|
||||||
rep.height = screenInfo.screens[stuff->screen]->height;
|
.height = screenInfo.screens[stuff->screen]->height,
|
||||||
rep.window = stuff->window;
|
.window = stuff->window,
|
||||||
rep.screen = stuff->screen;
|
.screen = stuff->screen
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -1021,18 +1028,18 @@ ProcXineramaIsActive(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xXineramaIsActiveReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
#if 1
|
#if 1
|
||||||
{
|
|
||||||
/* The following hack fools clients into thinking that Xinerama
|
/* The following hack fools clients into thinking that Xinerama
|
||||||
* is disabled even though it is not. */
|
* is disabled even though it is not. */
|
||||||
rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack;
|
.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
rep.state = !noPanoramiXExtension;
|
.state = !noPanoramiXExtension;
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -1046,14 +1053,15 @@ int
|
||||||
ProcXineramaQueryScreens(ClientPtr client)
|
ProcXineramaQueryScreens(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xXineramaQueryScreensReq); */
|
/* REQUEST(xXineramaQueryScreensReq); */
|
||||||
xXineramaQueryScreensReply rep;
|
xXineramaQueryScreensReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo),
|
||||||
|
.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
|
|
||||||
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
|
@ -566,14 +566,18 @@ PanoramiXGetGeometry(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xGetGeometryReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.root = screenInfo.screens[0]->root->drawable.id;
|
.length = 0,
|
||||||
rep.depth = pDraw->depth;
|
.root = screenInfo.screens[0]->root->drawable.id,
|
||||||
rep.width = pDraw->width;
|
.depth = pDraw->depth,
|
||||||
rep.height = pDraw->height;
|
.width = pDraw->width,
|
||||||
rep.x = rep.y = rep.borderWidth = 0;
|
.height = pDraw->height,
|
||||||
|
.x = 0,
|
||||||
|
.y = 0,
|
||||||
|
.borderWidth = 0
|
||||||
|
};
|
||||||
|
|
||||||
if (stuff->id == rep.root) {
|
if (stuff->id == rep.root) {
|
||||||
xWindowRoot *root = (xWindowRoot *)
|
xWindowRoot *root = (xWindowRoot *)
|
||||||
|
@ -617,11 +621,13 @@ PanoramiXTranslateCoords(ClientPtr client)
|
||||||
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
|
rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
rep.type = X_Reply;
|
rep = (xTranslateCoordsReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sameScreen = xTrue;
|
.length = 0,
|
||||||
rep.child = None;
|
.sameScreen = xTrue,
|
||||||
|
.child = None
|
||||||
|
};
|
||||||
|
|
||||||
if ((pWin == screenInfo.screens[0]->root) ||
|
if ((pWin == screenInfo.screens[0]->root) ||
|
||||||
(pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) {
|
(pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) {
|
||||||
|
@ -1954,10 +1960,12 @@ PanoramiXGetImage(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.visual = wVisual(((WindowPtr) pDraw));
|
xgi = (xGetImageReply) {
|
||||||
xgi.type = X_Reply;
|
.type = X_Reply,
|
||||||
xgi.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
xgi.depth = pDraw->depth;
|
.visual = wVisual(((WindowPtr) pDraw)),
|
||||||
|
.depth = pDraw->depth
|
||||||
|
};
|
||||||
if (format == ZPixmap) {
|
if (format == ZPixmap) {
|
||||||
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
||||||
length = widthBytesLine * h;
|
length = widthBytesLine * h;
|
||||||
|
|
24
Xext/saver.c
24
Xext/saver.c
|
@ -634,14 +634,16 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
|
||||||
static int
|
static int
|
||||||
ProcScreenSaverQueryVersion(ClientPtr client)
|
ProcScreenSaverQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xScreenSaverQueryVersionReply rep;
|
xScreenSaverQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_SAVER_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_SAVER_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -677,10 +679,12 @@ ProcScreenSaverQueryInfo(ClientPtr client)
|
||||||
UpdateCurrentTime();
|
UpdateCurrentTime();
|
||||||
lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
|
lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xScreenSaverQueryInfoReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.window = pSaver->wid;
|
.length = 0,
|
||||||
|
.window = pSaver->wid
|
||||||
|
};
|
||||||
if (screenIsSaved != SCREEN_SAVER_OFF) {
|
if (screenIsSaved != SCREEN_SAVER_OFF) {
|
||||||
rep.state = ScreenSaverOn;
|
rep.state = ScreenSaverOn;
|
||||||
if (ScreenSaverTime)
|
if (ScreenSaverTime)
|
||||||
|
|
|
@ -338,14 +338,16 @@ static int
|
||||||
ProcSecurityQueryVersion(ClientPtr client)
|
ProcSecurityQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
/* REQUEST(xSecurityQueryVersionReq); */
|
/* REQUEST(xSecurityQueryVersionReq); */
|
||||||
xSecurityQueryVersionReply rep;
|
xSecurityQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_SECURITY_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_SECURITY_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.majorVersion);
|
swaps(&rep.majorVersion);
|
||||||
|
@ -527,11 +529,13 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||||
|
|
||||||
/* tell client the auth id and data */
|
/* tell client the auth id and data */
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xSecurityGenerateAuthorizationReply) {
|
||||||
rep.length = bytes_to_int32(authdata_len);
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.authId = authId;
|
.length = bytes_to_int32(authdata_len),
|
||||||
rep.dataLength = authdata_len;
|
.authId = authId,
|
||||||
|
.dataLength = authdata_len
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
50
Xext/shape.c
50
Xext/shape.c
|
@ -204,15 +204,16 @@ CreateClipShape(WindowPtr pWin)
|
||||||
static int
|
static int
|
||||||
ProcShapeQueryVersion(ClientPtr client)
|
ProcShapeQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xShapeQueryVersionReply rep;
|
xShapeQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_SHAPE_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_SHAPE_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
|
REQUEST_SIZE_MATCH(xShapeQueryVersionReq);
|
||||||
memset(&rep, 0, sizeof(xShapeQueryVersionReply));
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -631,12 +632,13 @@ ProcShapeQueryExtents(ClientPtr client)
|
||||||
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
|
rep = (xShapeQueryExtentsReply) {
|
||||||
rep.type = X_Reply;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
rep.boundingShaped = (wBoundingShape(pWin) != 0);
|
.boundingShaped = (wBoundingShape(pWin) != 0),
|
||||||
rep.clipShaped = (wClipShape(pWin) != 0);
|
.clipShaped = (wClipShape(pWin) != 0)
|
||||||
|
};
|
||||||
if ((region = wBoundingShape(pWin))) {
|
if ((region = wBoundingShape(pWin))) {
|
||||||
/* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
|
/* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
|
||||||
pExtents = RegionExtents(region);
|
pExtents = RegionExtents(region);
|
||||||
|
@ -920,10 +922,12 @@ ProcShapeInputSelected(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.type = X_Reply;
|
rep = (xShapeInputSelectedReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.enabled = enabled,
|
||||||
rep.enabled = enabled;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -1001,11 +1005,13 @@ ProcShapeGetRectangles(ClientPtr client)
|
||||||
rects[i].height = box->y2 - box->y1;
|
rects[i].height = box->y2 - box->y1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.type = X_Reply;
|
rep = (xShapeGetRectanglesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = bytes_to_int32(nrects * sizeof(xRectangle));
|
.ordering = YXBanded,
|
||||||
rep.ordering = YXBanded;
|
.sequenceNumber = client->sequence,
|
||||||
rep.nrects = nrects;
|
.length = bytes_to_int32(nrects * sizeof(xRectangle)),
|
||||||
|
.nrects = nrects
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
47
Xext/shm.c
47
Xext/shm.c
|
@ -285,19 +285,20 @@ ShmRegisterFbFuncs(ScreenPtr pScreen)
|
||||||
static int
|
static int
|
||||||
ProcShmQueryVersion(ClientPtr client)
|
ProcShmQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xShmQueryVersionReply rep;
|
xShmQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sharedPixmaps = sharedPixmaps,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_SHM_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_SHM_MINOR_VERSION,
|
||||||
|
.uid = geteuid(),
|
||||||
|
.gid = getegid(),
|
||||||
|
.pixmapFormat = sharedPixmaps ? ZPixmap : 0
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
|
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
|
||||||
memset(&rep, 0, sizeof(xShmQueryVersionReply));
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.sharedPixmaps = sharedPixmaps;
|
|
||||||
rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0;
|
|
||||||
rep.majorVersion = SERVER_SHM_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_SHM_MINOR_VERSION;
|
|
||||||
rep.uid = geteuid();
|
|
||||||
rep.gid = getegid();
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -656,11 +657,13 @@ ProcShmGetImage(ClientPtr client)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
visual = None;
|
visual = None;
|
||||||
}
|
}
|
||||||
xgi.type = X_Reply;
|
xgi = (xShmGetImageReply) {
|
||||||
xgi.length = 0;
|
.type = X_Reply,
|
||||||
xgi.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
xgi.visual = visual;
|
.length = 0,
|
||||||
xgi.depth = pDraw->depth;
|
.visual = visual,
|
||||||
|
.depth = pDraw->depth
|
||||||
|
};
|
||||||
if (stuff->format == ZPixmap) {
|
if (stuff->format == ZPixmap) {
|
||||||
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height;
|
||||||
}
|
}
|
||||||
|
@ -832,11 +835,13 @@ ProcPanoramiXShmGetImage(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
xgi.visual = wVisual(((WindowPtr) pDraw));
|
xgi = (xShmGetImageReply) {
|
||||||
xgi.type = X_Reply;
|
.type = X_Reply,
|
||||||
xgi.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
xgi.sequenceNumber = client->sequence;
|
.length = 0,
|
||||||
xgi.depth = pDraw->depth;
|
.visual = wVisual(((WindowPtr) pDraw)),
|
||||||
|
.depth = pDraw->depth
|
||||||
|
};
|
||||||
|
|
||||||
if (format == ZPixmap) {
|
if (format == ZPixmap) {
|
||||||
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
widthBytesLine = PixmapBytePad(w, pDraw->depth);
|
||||||
|
|
95
Xext/sync.c
95
Xext/sync.c
|
@ -1185,17 +1185,16 @@ FreeAlarmClient(void *value, XID id)
|
||||||
static int
|
static int
|
||||||
ProcSyncInitialize(ClientPtr client)
|
ProcSyncInitialize(ClientPtr client)
|
||||||
{
|
{
|
||||||
xSyncInitializeReply rep;
|
xSyncInitializeReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = SERVER_SYNC_MAJOR_VERSION,
|
||||||
|
.minorVersion = SERVER_SYNC_MINOR_VERSION,
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncInitializeReq);
|
REQUEST_SIZE_MATCH(xSyncInitializeReq);
|
||||||
|
|
||||||
memset(&rep, 0, sizeof(xSyncInitializeReply));
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
|
|
||||||
rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
|
|
||||||
rep.length = 0;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
}
|
}
|
||||||
|
@ -1209,17 +1208,17 @@ ProcSyncInitialize(ClientPtr client)
|
||||||
static int
|
static int
|
||||||
ProcSyncListSystemCounters(ClientPtr client)
|
ProcSyncListSystemCounters(ClientPtr client)
|
||||||
{
|
{
|
||||||
xSyncListSystemCountersReply rep;
|
xSyncListSystemCountersReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.nCounters = 0,
|
||||||
|
};
|
||||||
SysCounterInfo *psci;
|
SysCounterInfo *psci;
|
||||||
int len = 0;
|
int len = 0;
|
||||||
xSyncSystemCounter *list = NULL, *walklist = NULL;
|
xSyncSystemCounter *list = NULL, *walklist = NULL;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
|
REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.nCounters = 0;
|
|
||||||
|
|
||||||
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
xorg_list_for_each_entry(psci, &SysCounterList, entry) {
|
||||||
/* pad to 4 byte boundary */
|
/* pad to 4 byte boundary */
|
||||||
len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name));
|
len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name));
|
||||||
|
@ -1329,10 +1328,12 @@ ProcSyncGetPriority(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xSyncGetPriorityReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.priority = priorityclient->priority;
|
.length = 0,
|
||||||
|
.priority = priorityclient->priority
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
@ -1606,19 +1607,20 @@ ProcSyncQueryCounter(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
|
|
||||||
/* if system counter, ask it what the current value is */
|
/* if system counter, ask it what the current value is */
|
||||||
|
|
||||||
if (IsSystemCounter(pCounter)) {
|
if (IsSystemCounter(pCounter)) {
|
||||||
(*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
|
(*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
|
||||||
&pCounter->value);
|
&pCounter->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.value_hi = XSyncValueHigh32(pCounter->value);
|
rep = (xSyncQueryCounterReply) {
|
||||||
rep.value_lo = XSyncValueLow32(pCounter->value);
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.value_hi = XSyncValueHigh32(pCounter->value),
|
||||||
|
.value_lo = XSyncValueLow32(pCounter->value)
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -1772,32 +1774,33 @@ ProcSyncQueryAlarm(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length =
|
|
||||||
bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
|
|
||||||
pTrigger = &pAlarm->trigger;
|
pTrigger = &pAlarm->trigger;
|
||||||
rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None;
|
rep = (xSyncQueryAlarmReply) {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length =
|
||||||
|
bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)),
|
||||||
|
.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None,
|
||||||
|
|
||||||
#if 0 /* XXX unclear what to do, depends on whether relative value-types
|
#if 0 /* XXX unclear what to do, depends on whether relative value-types
|
||||||
* are "consumed" immediately and are considered absolute from then
|
* are "consumed" immediately and are considered absolute from then
|
||||||
* on.
|
* on.
|
||||||
*/
|
*/
|
||||||
rep.value_type = pTrigger->value_type;
|
.value_type = pTrigger->value_type,
|
||||||
rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value);
|
.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value),
|
||||||
rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value);
|
.wait_value_lo = XSyncValueLow32(pTrigger->wait_value),
|
||||||
#else
|
#else
|
||||||
rep.value_type = XSyncAbsolute;
|
.value_type = XSyncAbsolute,
|
||||||
rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
|
.wait_value_hi = XSyncValueHigh32(pTrigger->test_value),
|
||||||
rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value);
|
.wait_value_lo = XSyncValueLow32(pTrigger->test_value),
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rep.test_type = pTrigger->test_type;
|
.test_type = pTrigger->test_type,
|
||||||
rep.delta_hi = XSyncValueHigh32(pAlarm->delta);
|
.delta_hi = XSyncValueHigh32(pAlarm->delta),
|
||||||
rep.delta_lo = XSyncValueLow32(pAlarm->delta);
|
.delta_lo = XSyncValueLow32(pAlarm->delta),
|
||||||
rep.events = pAlarm->events;
|
.events = pAlarm->events,
|
||||||
rep.state = pAlarm->state;
|
.state = pAlarm->state
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
@ -1956,11 +1959,13 @@ ProcSyncQueryFence(ClientPtr client)
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xSyncQueryFenceReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
|
||||||
rep.triggered = pFence->funcs.CheckTriggered(pFence);
|
.triggered = pFence->funcs.CheckTriggered(pFence)
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
|
|
|
@ -45,14 +45,16 @@ from The Open Group.
|
||||||
static int
|
static int
|
||||||
ProcXCMiscGetVersion(ClientPtr client)
|
ProcXCMiscGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXCMiscGetVersionReply rep;
|
xXCMiscGetVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = XCMiscMajorVersion,
|
||||||
|
.minorVersion = XCMiscMinorVersion
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = XCMiscMajorVersion;
|
|
||||||
rep.minorVersion = XCMiscMinorVersion;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.majorVersion);
|
swaps(&rep.majorVersion);
|
||||||
|
@ -70,11 +72,13 @@ ProcXCMiscGetXIDRange(ClientPtr client)
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
|
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
|
||||||
GetXIDRange(client->index, FALSE, &min_id, &max_id);
|
GetXIDRange(client->index, FALSE, &min_id, &max_id);
|
||||||
rep.type = X_Reply;
|
rep = (xXCMiscGetXIDRangeReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.start_id = min_id;
|
.length = 0,
|
||||||
rep.count = max_id - min_id + 1;
|
.start_id = min_id,
|
||||||
|
.count = max_id - min_id + 1
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.start_id);
|
swapl(&rep.start_id);
|
||||||
|
@ -102,10 +106,12 @@ ProcXCMiscGetXIDList(ClientPtr client)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
}
|
}
|
||||||
count = GetXIDList(client, stuff->count, pids);
|
count = GetXIDList(client, stuff->count, pids);
|
||||||
rep.type = X_Reply;
|
rep = (xXCMiscGetXIDListReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = count;
|
.sequenceNumber = client->sequence,
|
||||||
rep.count = count;
|
.length = count,
|
||||||
|
.count = count
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
|
@ -277,25 +277,23 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
|
||||||
xXF86BigfontQueryVersionReply reply;
|
xXF86BigfontQueryVersionReply reply;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
|
REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq);
|
||||||
reply.type = X_Reply;
|
reply = (xXF86BigfontQueryVersionReply) {
|
||||||
reply.length = 0;
|
.type = X_Reply,
|
||||||
reply.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION;
|
.length = 0,
|
||||||
reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION;
|
.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION,
|
||||||
reply.uid = geteuid();
|
.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION,
|
||||||
reply.gid = getegid();
|
.uid = geteuid(),
|
||||||
|
.gid = getegid(),
|
||||||
#ifdef HAS_SHM
|
#ifdef HAS_SHM
|
||||||
reply.signature = signature;
|
.signature = signature,
|
||||||
|
.capabilities = (LocalClient(client) && !client->swapped)
|
||||||
|
? XF86Bigfont_CAP_LocalShm : 0
|
||||||
#else
|
#else
|
||||||
reply.signature = 0; /* This is redundant. Avoids uninitialized memory. */
|
.signature = 0,
|
||||||
|
.capabilities = 0
|
||||||
#endif
|
#endif
|
||||||
reply.capabilities =
|
};
|
||||||
#ifdef HAS_SHM
|
|
||||||
(LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0)
|
|
||||||
#else
|
|
||||||
0
|
|
||||||
#endif
|
|
||||||
; /* may add more bits here in future versions */
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
char tmp;
|
char tmp;
|
||||||
|
|
||||||
|
|
69
Xext/xres.c
69
Xext/xres.c
|
@ -194,15 +194,16 @@ static int
|
||||||
ProcXResQueryVersion(ClientPtr client)
|
ProcXResQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryVersionReq);
|
REQUEST(xXResQueryVersionReq);
|
||||||
xXResQueryVersionReply rep;
|
xXResQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.server_major = SERVER_XRES_MAJOR_VERSION,
|
||||||
|
.server_minor = SERVER_XRES_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
REQUEST_SIZE_MATCH(xXResQueryVersionReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.server_major = SERVER_XRES_MAJOR_VERSION;
|
|
||||||
rep.server_minor = SERVER_XRES_MINOR_VERSION;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -233,10 +234,12 @@ ProcXResQueryClients(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xXResQueryClientsReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_clients = num_clients;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
|
.length = bytes_to_int32(num_clients * sz_xXResClient),
|
||||||
|
.num_clients = num_clients
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -300,10 +303,12 @@ ProcXResQueryClientResources(ClientPtr client)
|
||||||
num_types++;
|
num_types++;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xXResQueryClientResourcesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_types = num_types;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
|
.length = bytes_to_int32(num_types * sz_xXResType),
|
||||||
|
.num_types = num_types
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -470,15 +475,17 @@ ProcXResQueryClientPixmapBytes(ClientPtr client)
|
||||||
(pointer)(&bytes));
|
(pointer)(&bytes));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xXResQueryClientPixmapBytesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.bytes = bytes;
|
.length = 0,
|
||||||
|
.bytes = bytes,
|
||||||
#ifdef _XSERVER64
|
#ifdef _XSERVER64
|
||||||
rep.bytes_overflow = bytes >> 32;
|
.bytes_overflow = bytes >> 32
|
||||||
#else
|
#else
|
||||||
rep.bytes_overflow = 0;
|
.bytes_overflow = 0
|
||||||
#endif
|
#endif
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -650,7 +657,6 @@ ProcXResQueryClientIds (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryClientIdsReq);
|
REQUEST(xXResQueryClientIdsReq);
|
||||||
|
|
||||||
xXResQueryClientIdsReply rep;
|
|
||||||
xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff));
|
||||||
int rc;
|
int rc;
|
||||||
ConstructClientIdCtx ctx;
|
ConstructClientIdCtx ctx;
|
||||||
|
@ -664,12 +670,14 @@ ProcXResQueryClientIds (ClientPtr client)
|
||||||
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
|
rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx);
|
||||||
|
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
rep.type = X_Reply;
|
xXResQueryClientIdsReply rep = {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = bytes_to_int32(ctx.resultBytes),
|
||||||
|
.numIds = ctx.numIds
|
||||||
|
};
|
||||||
|
|
||||||
assert((ctx.resultBytes & 3) == 0);
|
assert((ctx.resultBytes & 3) == 0);
|
||||||
rep.length = bytes_to_int32(ctx.resultBytes);
|
|
||||||
rep.numIds = ctx.numIds;
|
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps (&rep.sequenceNumber);
|
swaps (&rep.sequenceNumber);
|
||||||
|
@ -1028,7 +1036,6 @@ ProcXResQueryResourceBytes (ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXResQueryResourceBytesReq);
|
REQUEST(xXResQueryResourceBytesReq);
|
||||||
|
|
||||||
xXResQueryResourceBytesReply rep;
|
|
||||||
int rc;
|
int rc;
|
||||||
ConstructResourceBytesCtx ctx;
|
ConstructResourceBytesCtx ctx;
|
||||||
|
|
||||||
|
@ -1046,10 +1053,12 @@ ProcXResQueryResourceBytes (ClientPtr client)
|
||||||
rc = ConstructResourceBytes(stuff->client, &ctx);
|
rc = ConstructResourceBytes(stuff->client, &ctx);
|
||||||
|
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
rep.type = X_Reply;
|
xXResQueryResourceBytesReply rep = {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.numSizes = ctx.numSizes;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = bytes_to_int32(ctx.resultBytes);
|
.length = bytes_to_int32(ctx.resultBytes),
|
||||||
|
.numSizes = ctx.numSizes
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps (&rep.sequenceNumber);
|
swaps (&rep.sequenceNumber);
|
||||||
|
|
|
@ -63,13 +63,13 @@ SELinuxCopyContext(char *ptr, unsigned len)
|
||||||
static int
|
static int
|
||||||
ProcSELinuxQueryVersion(ClientPtr client)
|
ProcSELinuxQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
SELinuxQueryVersionReply rep;
|
SELinuxQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
rep.type = X_Reply;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = 0;
|
.length = 0,
|
||||||
rep.sequenceNumber = client->sequence;
|
.server_major = SELINUX_MAJOR_VERSION,
|
||||||
rep.server_major = SELINUX_MAJOR_VERSION;
|
.server_minor = SELINUX_MINOR_VERSION
|
||||||
rep.server_minor = SELINUX_MINOR_VERSION;
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -93,10 +93,12 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
|
||||||
len = strlen(ctx) + 1;
|
len = strlen(ctx) + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (SELinuxGetContextReply) {
|
||||||
rep.length = bytes_to_int32(len);
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.context_len = len;
|
.length = bytes_to_int32(len),
|
||||||
|
.context_len = len
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
@ -372,10 +374,12 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send reply to client */
|
/* Send reply to client */
|
||||||
rep.type = X_Reply;
|
rep = (SELinuxListItemsReply) {
|
||||||
rep.length = size;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.count = count;
|
.length = size,
|
||||||
|
.count = count
|
||||||
|
};
|
||||||
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swapl(&rep.length);
|
swapl(&rep.length);
|
||||||
|
|
24
Xext/xtest.c
24
Xext/xtest.c
|
@ -88,14 +88,16 @@ static int XTestSwapFakeInput(ClientPtr /* client */ ,
|
||||||
static int
|
static int
|
||||||
ProcXTestGetVersion(ClientPtr client)
|
ProcXTestGetVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xXTestGetVersionReply rep;
|
xXTestGetVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.majorVersion = XTestMajorVersion,
|
||||||
|
.minorVersion = XTestMinorVersion
|
||||||
|
};
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.majorVersion = XTestMajorVersion;
|
|
||||||
rep.minorVersion = XTestMinorVersion;
|
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
swaps(&rep.minorVersion);
|
swaps(&rep.minorVersion);
|
||||||
|
@ -134,10 +136,12 @@ ProcXTestCompareCursor(ClientPtr client)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rep.type = X_Reply;
|
rep = (xXTestCompareCursorReply) {
|
||||||
rep.length = 0;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.same = (wCursor(pWin) == pCursor);
|
.length = 0,
|
||||||
|
.same = (wCursor(pWin) == pCursor)
|
||||||
|
};
|
||||||
if (client->swapped) {
|
if (client->swapped) {
|
||||||
swaps(&rep.sequenceNumber);
|
swaps(&rep.sequenceNumber);
|
||||||
}
|
}
|
||||||
|
|
112
Xext/xvdisp.c
112
Xext/xvdisp.c
|
@ -302,17 +302,17 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep)
|
||||||
static int
|
static int
|
||||||
ProcXvQueryExtension(ClientPtr client)
|
ProcXvQueryExtension(ClientPtr client)
|
||||||
{
|
{
|
||||||
xvQueryExtensionReply rep;
|
xvQueryExtensionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.version = XvVersion,
|
||||||
|
.revision = XvRevision
|
||||||
|
};
|
||||||
|
|
||||||
/* REQUEST(xvQueryExtensionReq); */
|
/* REQUEST(xvQueryExtensionReq); */
|
||||||
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
REQUEST_SIZE_MATCH(xvQueryExtensionReq);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.version = XvVersion;
|
|
||||||
rep.revision = XvRevision;
|
|
||||||
|
|
||||||
_WriteQueryExtensionReply(client, &rep);
|
_WriteQueryExtensionReply(client, &rep);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -343,10 +343,12 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||||
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
|
pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates,
|
||||||
XvGetScreenKey());
|
XvGetScreenKey());
|
||||||
if (!pxvs) {
|
if (!pxvs) {
|
||||||
rep.type = X_Reply;
|
rep = (xvQueryAdaptorsReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_adaptors = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = 0;
|
.length = 0,
|
||||||
|
.num_adaptors = 0
|
||||||
|
};
|
||||||
|
|
||||||
_WriteQueryAdaptorsReply(client, &rep);
|
_WriteQueryAdaptorsReply(client, &rep);
|
||||||
|
|
||||||
|
@ -355,9 +357,11 @@ ProcXvQueryAdaptors(ClientPtr client)
|
||||||
|
|
||||||
(*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
|
(*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvQueryAdaptorsReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_adaptors = pxvs->nAdaptors;
|
.sequenceNumber = client->sequence,
|
||||||
|
.num_adaptors = pxvs->nAdaptors
|
||||||
|
};
|
||||||
|
|
||||||
/* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
|
/* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */
|
||||||
|
|
||||||
|
@ -429,9 +433,11 @@ ProcXvQueryEncodings(ClientPtr client)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvQueryEncodingsReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_encodings = pPort->pAdaptor->nEncodings;
|
.sequenceNumber = client->sequence,
|
||||||
|
.num_encodings = pPort->pAdaptor->nEncodings
|
||||||
|
};
|
||||||
|
|
||||||
/* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
|
/* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */
|
||||||
|
|
||||||
|
@ -662,11 +668,12 @@ ProcXvGrabPort(ClientPtr client)
|
||||||
if (status != Success) {
|
if (status != Success) {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
rep = (xvGrabPortReply) {
|
||||||
rep.type = X_Reply;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = 0;
|
.length = 0,
|
||||||
rep.result = result;
|
.result = result
|
||||||
|
};
|
||||||
|
|
||||||
_WriteGrabPortReply(client, &rep);
|
_WriteGrabPortReply(client, &rep);
|
||||||
|
|
||||||
|
@ -777,10 +784,12 @@ ProcXvGetPortAttribute(ClientPtr client)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvGetPortAttributeReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.value = value;
|
.length = 0,
|
||||||
|
.value = value
|
||||||
|
};
|
||||||
|
|
||||||
_WriteGetPortAttributeReply(client, &rep);
|
_WriteGetPortAttributeReply(client, &rep);
|
||||||
|
|
||||||
|
@ -805,17 +814,18 @@ ProcXvQueryBestSize(ClientPtr client)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
|
|
||||||
(*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion,
|
(*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion,
|
||||||
stuff->vid_w, stuff->vid_h,
|
stuff->vid_w, stuff->vid_h,
|
||||||
stuff->drw_w, stuff->drw_h,
|
stuff->drw_w, stuff->drw_h,
|
||||||
&actual_width, &actual_height);
|
&actual_width, &actual_height);
|
||||||
|
|
||||||
rep.actual_width = actual_width;
|
rep = (xvQueryBestSizeReply) {
|
||||||
rep.actual_height = actual_height;
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.actual_width = actual_width,
|
||||||
|
.actual_height = actual_height
|
||||||
|
};
|
||||||
|
|
||||||
_WriteQueryBestSizeReply(client, &rep);
|
_WriteQueryBestSizeReply(client, &rep);
|
||||||
|
|
||||||
|
@ -841,10 +851,12 @@ ProcXvQueryPortAttributes(ClientPtr client)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvQueryPortAttributesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_attributes = pPort->pAdaptor->nAttributes;
|
.sequenceNumber = client->sequence,
|
||||||
rep.text_size = 0;
|
.num_attributes = pPort->pAdaptor->nAttributes,
|
||||||
|
.text_size = 0
|
||||||
|
};
|
||||||
|
|
||||||
for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
for (i = 0, pAtt = pPort->pAdaptor->pAttributes;
|
||||||
i < pPort->pAdaptor->nAttributes; i++, pAtt++) {
|
i < pPort->pAdaptor->nAttributes; i++, pAtt++) {
|
||||||
|
@ -1089,13 +1101,15 @@ ProcXvQueryImageAttributes(ClientPtr client)
|
||||||
&width, &height, offsets,
|
&width, &height, offsets,
|
||||||
pitches);
|
pitches);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvQueryImageAttributesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.length = planeLength = num_planes << 1;
|
.sequenceNumber = client->sequence,
|
||||||
rep.num_planes = num_planes;
|
.length = planeLength = num_planes << 1,
|
||||||
rep.width = width;
|
.num_planes = num_planes,
|
||||||
rep.height = height;
|
.width = width,
|
||||||
rep.data_size = size;
|
.height = height,
|
||||||
|
.data_size = size
|
||||||
|
};
|
||||||
|
|
||||||
_WriteQueryImageAttributesReply(client, &rep);
|
_WriteQueryImageAttributesReply(client, &rep);
|
||||||
if (client->swapped)
|
if (client->swapped)
|
||||||
|
@ -1122,11 +1136,13 @@ ProcXvListImageFormats(ClientPtr client)
|
||||||
|
|
||||||
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvListImageFormatsReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num_formats = pPort->pAdaptor->nImages;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length =
|
.num_formats = pPort->pAdaptor->nImages,
|
||||||
bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo);
|
.length =
|
||||||
|
bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo)
|
||||||
|
};
|
||||||
|
|
||||||
_WriteListImageFormatsReply(client, &rep);
|
_WriteListImageFormatsReply(client, &rep);
|
||||||
|
|
||||||
|
|
98
Xext/xvmc.c
98
Xext/xvmc.c
|
@ -109,15 +109,17 @@ XvMCDestroySubpictureRes(pointer data, XID id)
|
||||||
static int
|
static int
|
||||||
ProcXvMCQueryVersion(ClientPtr client)
|
ProcXvMCQueryVersion(ClientPtr client)
|
||||||
{
|
{
|
||||||
xvmcQueryVersionReply rep;
|
xvmcQueryVersionReply rep = {
|
||||||
|
.type = X_Reply,
|
||||||
|
.sequenceNumber = client->sequence,
|
||||||
|
.length = 0,
|
||||||
|
.major = SERVER_XVMC_MAJOR_VERSION,
|
||||||
|
.minor = SERVER_XVMC_MINOR_VERSION
|
||||||
|
};
|
||||||
|
|
||||||
/* REQUEST(xvmcQueryVersionReq); */
|
/* REQUEST(xvmcQueryVersionReq); */
|
||||||
REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
|
REQUEST_SIZE_MATCH(xvmcQueryVersionReq);
|
||||||
rep.type = X_Reply;
|
|
||||||
rep.sequenceNumber = client->sequence;
|
|
||||||
rep.length = 0;
|
|
||||||
rep.major = SERVER_XVMC_MAJOR_VERSION;
|
|
||||||
rep.minor = SERVER_XVMC_MINOR_VERSION;
|
|
||||||
WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep);
|
WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep);
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -151,10 +153,12 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvmcListSurfaceTypesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num = (adaptor) ? adaptor->num_surfaces : 0;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo));
|
.num = (adaptor) ? adaptor->num_surfaces : 0,
|
||||||
|
.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo)),
|
||||||
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
|
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
|
||||||
|
|
||||||
|
@ -247,12 +251,14 @@ ProcXvMCCreateContext(ClientPtr client)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvmcCreateContextReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.width_actual = pContext->width;
|
.sequenceNumber = client->sequence,
|
||||||
rep.height_actual = pContext->height;
|
.length = dwords,
|
||||||
rep.flags_return = pContext->flags;
|
.width_actual = pContext->width,
|
||||||
rep.length = dwords;
|
.height_actual = pContext->height,
|
||||||
|
.flags_return = pContext->flags
|
||||||
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateContextReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
|
@ -320,10 +326,11 @@ ProcXvMCCreateSurface(ClientPtr client)
|
||||||
free(pSurface);
|
free(pSurface);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
rep = (xvmcCreateSurfaceReply) {
|
||||||
rep.type = X_Reply;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.length = dwords;
|
.length = dwords
|
||||||
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
|
@ -435,18 +442,19 @@ ProcXvMCCreateSubpicture(ClientPtr client)
|
||||||
free(pSubpicture);
|
free(pSubpicture);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
rep = (xvmcCreateSubpictureReply) {
|
||||||
rep.type = X_Reply;
|
.type = X_Reply,
|
||||||
rep.sequenceNumber = client->sequence;
|
.sequenceNumber = client->sequence,
|
||||||
rep.width_actual = pSubpicture->width;
|
.length = dwords,
|
||||||
rep.height_actual = pSubpicture->height;
|
.width_actual = pSubpicture->width,
|
||||||
rep.num_palette_entries = pSubpicture->num_palette_entries;
|
.height_actual = pSubpicture->height,
|
||||||
rep.entry_bytes = pSubpicture->entry_bytes;
|
.num_palette_entries = pSubpicture->num_palette_entries,
|
||||||
rep.component_order[0] = pSubpicture->component_order[0];
|
.entry_bytes = pSubpicture->entry_bytes,
|
||||||
rep.component_order[1] = pSubpicture->component_order[1];
|
.component_order[0] = pSubpicture->component_order[0],
|
||||||
rep.component_order[2] = pSubpicture->component_order[2];
|
.component_order[1] = pSubpicture->component_order[1],
|
||||||
rep.component_order[3] = pSubpicture->component_order[3];
|
.component_order[2] = pSubpicture->component_order[2],
|
||||||
rep.length = dwords;
|
.component_order[3] = pSubpicture->component_order[3]
|
||||||
|
};
|
||||||
|
|
||||||
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
|
WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep);
|
||||||
if (dwords)
|
if (dwords)
|
||||||
|
@ -525,9 +533,11 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
||||||
if (!surface)
|
if (!surface)
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvmcListSubpictureTypesReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.num = 0;
|
.sequenceNumber = client->sequence,
|
||||||
|
.num = 0
|
||||||
|
};
|
||||||
if (surface->compatible_subpictures)
|
if (surface->compatible_subpictures)
|
||||||
rep.num = surface->compatible_subpictures->num_xvimages;
|
rep.num = surface->compatible_subpictures->num_xvimages;
|
||||||
|
|
||||||
|
@ -595,13 +605,16 @@ ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
pScreen = pPort->pAdaptor->pScreen;
|
pScreen = pPort->pAdaptor->pScreen;
|
||||||
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
pScreenPriv = XVMC_GET_PRIVATE(pScreen);
|
||||||
|
|
||||||
rep.type = X_Reply;
|
rep = (xvmcGetDRInfoReply) {
|
||||||
rep.sequenceNumber = client->sequence;
|
.type = X_Reply,
|
||||||
rep.major = pScreenPriv->major;
|
.sequenceNumber = client->sequence,
|
||||||
rep.minor = pScreenPriv->minor;
|
.major = pScreenPriv->major,
|
||||||
rep.patchLevel = pScreenPriv->patchLevel;
|
.minor = pScreenPriv->minor,
|
||||||
rep.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1);
|
.patchLevel = pScreenPriv->patchLevel,
|
||||||
rep.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1);
|
.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1),
|
||||||
|
.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1),
|
||||||
|
.isLocal = 1
|
||||||
|
};
|
||||||
|
|
||||||
rep.length = rep.nameLen + rep.busIDLen;
|
rep.length = rep.nameLen + rep.busIDLen;
|
||||||
rep.nameLen <<= 2;
|
rep.nameLen <<= 2;
|
||||||
|
@ -612,7 +625,6 @@ ProcXvMCGetDRInfo(ClientPtr client)
|
||||||
* segment she prepared for us.
|
* segment she prepared for us.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rep.isLocal = 1;
|
|
||||||
#ifdef HAS_XVMCSHM
|
#ifdef HAS_XVMCSHM
|
||||||
patternP = (CARD32 *) shmat(stuff->shmKey, NULL, SHM_RDONLY);
|
patternP = (CARD32 *) shmat(stuff->shmKey, NULL, SHM_RDONLY);
|
||||||
if (-1 != (long) patternP) {
|
if (-1 != (long) patternP) {
|
||||||
|
|
Loading…
Reference in New Issue