mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +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
@@ -980,8 +980,8 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||
}
|
||||
reply->type = X_Reply;
|
||||
reply->length =
|
||||
bytes_to_int32(sizeof *reply - sizeof(xGenericReply) +
|
||||
pFontInfo->nprops * sizeof(xFontProp) + namelen);
|
||||
X_REPLY_HEADER_UNITS(xListFontsWithInfoReply)
|
||||
+ bytes_to_int32(pFontInfo->nprops*sizeof(xFontProp)+namelen);
|
||||
reply->sequenceNumber = client->sequence;
|
||||
reply->nameLength = namelen;
|
||||
reply->minBounds = pFontInfo->ink_minbounds;
|
||||
@@ -1020,8 +1020,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
||||
xListFontsWithInfoReply rep = {
|
||||
.type = X_Reply,
|
||||
.sequenceNumber = client->sequence,
|
||||
.length = bytes_to_int32(sizeof(xListFontsWithInfoReply)
|
||||
- sizeof(xGenericReply))
|
||||
.length = X_REPLY_HEADER_UNITS(xListFontsWithInfoReply)
|
||||
};
|
||||
if (client->swapped) {
|
||||
SwapFont((xQueryFontReply *) &rep, FALSE);
|
||||
|
||||
@@ -1578,8 +1578,7 @@ ProcGetWindowAttributes(ClientPtr client)
|
||||
.bitGravity = pWin->bitGravity,
|
||||
.winGravity = pWin->winGravity,
|
||||
.backingStore = pWin->backingStore,
|
||||
.length = bytes_to_int32(sizeof(xGetWindowAttributesReply) -
|
||||
sizeof(xGenericReply)),
|
||||
.length = X_REPLY_HEADER_UNITS(xGetWindowAttributesReply),
|
||||
.sequenceNumber = client->sequence,
|
||||
.backingBitPlanes = wBackingBitPlanes(pWin),
|
||||
.backingPixel = wBackingPixel(pWin),
|
||||
|
||||
Reference in New Issue
Block a user