mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
dix: devices: use X_SEND_REPLY_SIMPLE()
Use X_SEND_REPLY_SIMPLE() for sending out simple replies. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
be6f403100
commit
6ad01ebfc7
@@ -1742,16 +1742,10 @@ ProcSetModifierMapping(ClientPtr client)
|
||||
return rc;
|
||||
|
||||
xSetModifierMappingReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
.success = rc,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
X_SEND_REPLY_SIMPLE(client, rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -1892,16 +1886,10 @@ ProcSetPointerMapping(ClientPtr client)
|
||||
return ret;
|
||||
|
||||
xSetPointerMappingReply rep = {
|
||||
.type = X_Reply,
|
||||
.success = (ret == MappingBusy) ? MappingBusy : MappingSuccess,
|
||||
.sequenceNumber = client->sequence,
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
}
|
||||
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
X_SEND_REPLY_SIMPLE(client, rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -2225,10 +2213,7 @@ ProcGetKeyboardControl(ClientPtr client)
|
||||
return rc;
|
||||
|
||||
xGetKeyboardControlReply rep = {
|
||||
.type = X_Reply,
|
||||
.globalAutoRepeat = ctrl->autoRepeat,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 5,
|
||||
.ledMask = ctrl->leds,
|
||||
.keyClickPercent = ctrl->click,
|
||||
.bellPercent = ctrl->bell,
|
||||
@@ -2239,13 +2224,11 @@ ProcGetKeyboardControl(ClientPtr client)
|
||||
rep.map[i] = ctrl->autoRepeats[i];
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
swapl(&rep.ledMask);
|
||||
swaps(&rep.bellPitch);
|
||||
swaps(&rep.bellDuration);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
X_SEND_REPLY_SIMPLE(client, rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -2385,21 +2368,17 @@ ProcGetPointerControl(ClientPtr client)
|
||||
return rc;
|
||||
|
||||
xGetPointerControlReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 0,
|
||||
.accelNumerator = ctrl->num,
|
||||
.accelDenominator = ctrl->den,
|
||||
.threshold = ctrl->threshold
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swaps(&rep.accelNumerator);
|
||||
swaps(&rep.accelDenominator);
|
||||
swaps(&rep.threshold);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
X_SEND_REPLY_SIMPLE(client, rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -2503,11 +2482,7 @@ ProcQueryKeymap(ClientPtr client)
|
||||
|
||||
REQUEST_SIZE_MATCH(xReq);
|
||||
|
||||
xQueryKeymapReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = 2
|
||||
};
|
||||
xQueryKeymapReply rep = { 0 };
|
||||
|
||||
rc = XaceHookDeviceAccess(client, keybd, DixReadAccess);
|
||||
/* If rc is Success, we're allowed to copy out the keymap.
|
||||
@@ -2520,12 +2495,7 @@ ProcQueryKeymap(ClientPtr client)
|
||||
else if (rc != BadAccess)
|
||||
return rc;
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(rep), &rep);
|
||||
|
||||
X_SEND_REPLY_SIMPLE(client, rep);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user