mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 05:54:08 +00:00
treewide: macro for computing extra units needed for reply header
Add and use macro X_REPLY_HEADER_UNITS() for computing how many extra protocol units are needed for a reply header (for .length field) Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
bb6a70be0f
commit
d6089c52c3
@@ -709,8 +709,7 @@ ProcXkbGetControls(ClientPtr client)
|
||||
.type = X_Reply,
|
||||
.deviceID = ((DeviceIntPtr) dev)->id,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(sizeof(xkbGetControlsReply) -
|
||||
sizeof(xGenericReply)),
|
||||
.length = X_REPLY_HEADER_UNITS(xkbGetControlsReply),
|
||||
.mkDfltBtn = xkb->mk_dflt_btn,
|
||||
.numGroups = xkb->num_groups,
|
||||
.groupsWrap = xkb->groups_wrap,
|
||||
@@ -5800,8 +5799,7 @@ ProcXkbGetKbdByName(ClientPtr client)
|
||||
reported &= ~(XkbGBN_SymbolsMask | XkbGBN_TypesMask);
|
||||
else if (reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask)) {
|
||||
mrep.deviceID = dev->id;
|
||||
mrep.length =
|
||||
((SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2);
|
||||
mrep.length = X_REPLY_HEADER_UNITS(xkbGetMapReply);
|
||||
mrep.minKeyCode = new->min_key_code;
|
||||
mrep.maxKeyCode = new->max_key_code;
|
||||
mrep.totalSyms = mrep.totalActs =
|
||||
|
||||
Reference in New Issue
Block a user