The few instructions for byte-swapping are trivial enought to be inlined
into the actual request handlers, so we can reduce a lot of boilerplate.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The xXineramaScreenInfo payload type has the same definition as xRectangle,
so we can just use x_rpcbuf_write_rect() for those.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The macro will automatically return BadAlloc if the buffer is broken,
otherwise Success. Thus, we don't need extra prior rpcbuf check.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload and X_SEND_REPLY_WITH_RPCBUF()
for sending it all out.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, and sending out the whole
thing via X_SEND_REPLY_WITH_RPCBUF().
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t instead of our own local buffer for the reply
payload assembly and byte-swapping.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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>
Move the declaration of the reply struct down to after the payload has
been finally assembled, so we don't need extra payload size compuation
anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Use x_rpcbuf_t for reply payload assembly, instead of pre-counting and
pre-allocating buffer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since the x_rpcbuf already knows how much had been written, there's no
need for extra payload size computation anymore - just pick the number
of written bytes from the x_rpcbuf.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
use x_rpcbuf_t operations for constructing the reply payload, so we don't
need to do the byte-swapping explicitly anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Second step of migrating ProcVidModeGetAllModeLines() to x_rpcbuf_t:
Let it's callees also use x_rpcbuf_t operations, instead of raw pointers.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
First step of migration to x_rpcbuf: create a buffer with enough room for
the already calculated payload size and pass the raw buffer pointer to
our callees as we used to do with the calloc()ed one.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
When iterating screen lists, consistently use the same variable name
`walkScreen` for holding current screen pointer everywhere.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
take way the extra scope / indention on the `if (nbox)` statement and
use `continue` instead.
Hint: for easier review, one can use `git diff -w` in order to suppress
the indention-only changes.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
in preparation of upcoming new iterator macros, phase out
FOR_NSCREENS_FORWARD_SKIP, so we don't need an additional macro
for just the case where first screen is skipped.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>