mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
Replace padlength tables with inline functions from misc.h
Adds new function padding_for_int32() and uses existing pad_to_int32() depending on required results. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
2b1c1300cc
commit
ad4092cf7d
5 changed files with 50 additions and 13 deletions
6
os/io.c
6
os/io.c
|
|
@ -578,8 +578,6 @@ ResetCurrentRequest(ClientPtr client)
|
|||
}
|
||||
}
|
||||
|
||||
static const int padlength[4] = { 0, 3, 2, 1 };
|
||||
|
||||
/********************
|
||||
* FlushAllOutput()
|
||||
* Flush all clients with output. However, if some client still
|
||||
|
|
@ -757,7 +755,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
|
|||
oc->output = oco;
|
||||
}
|
||||
|
||||
padBytes = padlength[count & 3];
|
||||
padBytes = padding_for_int32(count);
|
||||
|
||||
if (ReplyCallback) {
|
||||
ReplyInfoRec replyinfo;
|
||||
|
|
@ -850,7 +848,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
|
|||
if (!oco)
|
||||
return 0;
|
||||
written = 0;
|
||||
padsize = padlength[extraCount & 3];
|
||||
padsize = padding_for_int32(extraCount);
|
||||
notWritten = oco->count + extraCount + padsize;
|
||||
todo = notWritten;
|
||||
while (notWritten) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue