mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 14:34:29 +00:00
Xi: ProcXGetDeviceButtonMapping(): use x_rpcbuf_t
Use x_rpcbuf_t for reply payload assembly. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
61eb2e2675
commit
e45decb482
22
Xi/getbmap.c
22
Xi/getbmap.c
@@ -52,9 +52,13 @@ SOFTWARE.
|
||||
|
||||
#include <dix-config.h>
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include <X11/extensions/XI.h>
|
||||
#include <X11/extensions/XIproto.h>
|
||||
|
||||
#include "dix/dix_priv.h"
|
||||
#include "dix/rpcbuf_priv.h"
|
||||
|
||||
#include "inputstr.h" /* DeviceIntPtr */
|
||||
#include "exglobals.h"
|
||||
|
||||
#include "getbmap.h"
|
||||
@@ -83,19 +87,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client)
|
||||
if (b == NULL)
|
||||
return BadMatch;
|
||||
|
||||
xGetDeviceButtonMappingReply rep = {
|
||||
.repType = X_Reply,
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_CARD8s(&rpcbuf, &b->map[1], b->numButtons);
|
||||
|
||||
xGetDeviceButtonMappingReply reply = {
|
||||
.RepType = X_GetDeviceButtonMapping,
|
||||
.sequenceNumber = client->sequence,
|
||||
.nElts = b->numButtons,
|
||||
.length = bytes_to_int32(b->numButtons),
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&rep.sequenceNumber);
|
||||
swapl(&rep.length);
|
||||
}
|
||||
WriteToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep);
|
||||
WriteToClient(client, rep.nElts, &b->map[1]);
|
||||
return Success;
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user