xserver: Branch 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 13 22:35:17 UTC 2025
dix/swapreq.c | 2 +-
doc/Xserver-spec.xml | 2 +-
include/misc.h | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit c7b69f1acbd78e03048176db8009fbf7f0b45f87
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date: Wed Jun 11 17:05:42 2025 -0700
Revert "misc.h: drop LengthRestB() macro"
This reverts commit a6b2eb3780dc0e5a188c4442efc5286b258bc64f
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2015>
diff --git a/dix/swapreq.c b/dix/swapreq.c
index 18bc75186..9031f083d 100644
--- a/dix/swapreq.c
+++ b/dix/swapreq.c
@@ -756,7 +756,7 @@ SProcStoreColors(ClientPtr client)
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
swapl(&stuff->cmap);
pItem = (xColorItem *) &stuff[1];
- for (count = ((client->req_len << 2) - sizeof(xStoreColorsReq)) / sizeof(xColorItem); --count >= 0;)
+ for (count = LengthRestB(stuff) / sizeof(xColorItem); --count >= 0;)
SwapColorItem(pItem++);
return ((*ProcVector[X_StoreColors]) (client));
}
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 8862b31bf..96a72b2b6 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -600,7 +600,7 @@ are: REQUEST, REQUEST_SIZE_MATCH, REQUEST_AT_LEAST_SIZE,
REQUEST_FIXED_SIZE, LEGAL_NEW_RESOURCE, and
VALIDATE_DRAWABLE_AND_GC. Useful byte swapping macros can be found
in Xserver/include/dix.h: WriteReplyToClient and WriteSwappedDataToClient; and
-in Xserver/include/misc.h: bswap_64, bswap_32, bswap_16, LengthRestS,
+in Xserver/include/misc.h: bswap_64, bswap_32, bswap_16, LengthRestB, LengthRestS,
LengthRestL, SwapRestS, SwapRestL, swapl, swaps, cpswapl, and cpswaps.</para>
</section>
</section>
diff --git a/include/misc.h b/include/misc.h
index a6b54389e..9ba9f9b8a 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -227,6 +227,9 @@ extern _X_EXPORT char **xstrtokenize(const char *str, const char *separators);
/* some macros to help swap requests, replies, and events */
+#define LengthRestB(stuff) \
+ ((client->req_len << 2) - sizeof(*stuff))
+
#define LengthRestS(stuff) \
((client->req_len << 1) - (sizeof(*stuff) >> 1))
More information about the xorg-commit
mailing list