mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
[PR #1533] Xext: xcmisc: use REQUEST_HEAD_STRUCT and REQUEST_FIELD_* macros
PR: https://github.com/X11Libre/xserver/pull/1533
This commit is contained in:
@@ -48,31 +48,22 @@ from The Open Group.
|
||||
static int
|
||||
ProcXCMiscGetVersion(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCMiscGetVersionReq);
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&stuff->majorVersion);
|
||||
swaps(&stuff->minorVersion);
|
||||
}
|
||||
X_REQUEST_HEAD_STRUCT(xXCMiscGetVersionReq);
|
||||
X_REQUEST_FIELD_CARD16(majorVersion);
|
||||
X_REQUEST_FIELD_CARD16(minorVersion);
|
||||
|
||||
xXCMiscGetVersionReply reply = {
|
||||
.majorVersion = XCMiscMajorVersion,
|
||||
.minorVersion = XCMiscMinorVersion
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&reply.majorVersion);
|
||||
swaps(&reply.minorVersion);
|
||||
}
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
}
|
||||
|
||||
static int
|
||||
ProcXCMiscGetXIDRange(ClientPtr client)
|
||||
{
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
|
||||
X_REQUEST_HEAD_STRUCT(xXCMiscGetXIDRangeReq);
|
||||
|
||||
XID min_id, max_id;
|
||||
GetXIDRange(client->index, FALSE, &min_id, &max_id);
|
||||
@@ -92,11 +83,8 @@ ProcXCMiscGetXIDRange(ClientPtr client)
|
||||
static int
|
||||
ProcXCMiscGetXIDList(ClientPtr client)
|
||||
{
|
||||
REQUEST(xXCMiscGetXIDListReq);
|
||||
REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
|
||||
|
||||
if (client->swapped)
|
||||
swapl(&stuff->count);
|
||||
X_REQUEST_HEAD_STRUCT(xXCMiscGetXIDListReq);
|
||||
X_REQUEST_FIELD_CARD32(count);
|
||||
|
||||
if (stuff->count > UINT32_MAX / sizeof(XID))
|
||||
return BadAlloc;
|
||||
|
||||
Reference in New Issue
Block a user