diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-07-09 19:12:44 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-07-09 22:52:30 -0700 |
commit | ad4092cf7d59a89b1b2922440eef65be5c0c5ebd (patch) | |
tree | ec5d4d32e3b05d70e000771492638eb3e8ff2914 /os | |
parent | 2b1c1300cc23912ee1c59f8dde938dd4d7287f4a (diff) |
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>
Diffstat (limited to 'os')
-rw-r--r-- | os/io.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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) { |