Xi: drop SWAPIF macro

Trivial enough for just writing the actual code.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2025-12-04 17:11:44 +01:00
committed by Enrico Weigelt
parent f5a70d968c
commit d2e5ed2a89

View File

@@ -424,8 +424,6 @@ attach_slave(ClientPtr client, xXIAttachSlaveInfo * c, int flags[MAXDEVICES])
return rc;
}
#define SWAPIF(cmd) if (client->swapped) { cmd; }
int
ProcXIChangeHierarchy(ClientPtr client)
{
@@ -454,8 +452,10 @@ ProcXIChangeHierarchy(ClientPtr client)
goto unwind;
}
SWAPIF(swaps(&any->type));
SWAPIF(swaps(&any->length));
if (client->swapped) {
swaps(&any->type);
swaps(&any->length);
}
if (len < ((size_t)any->length << 2))
return BadLength;
@@ -478,7 +478,10 @@ ProcXIChangeHierarchy(ClientPtr client)
rc = BadLength;
goto unwind;
}
SWAPIF(swaps(&c->name_len));
if (client->swapped)
swaps(&c->name_len);
if (c->name_len > (len - sizeof(xXIAddMasterInfo))) {
rc = BadLength;
goto unwind;