mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
dix: rpcbuf: add x_rpcbuf_write_INT32s()
litle wrapper for directly writing INT32 arrays w/o signess warnings. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -266,6 +266,26 @@ Bool x_rpcbuf_write_CARD16s(x_rpcbuf_t *rpcbuf, const CARD16 *values,
|
||||
Bool x_rpcbuf_write_CARD32s(x_rpcbuf_t *rpcbuf, const CARD32 *values,
|
||||
size_t count) _X_ATTRIBUTE_NONNULL_ARG(1);
|
||||
|
||||
/*
|
||||
* write array of INT32s and do byte-swapping (when needed).
|
||||
*
|
||||
* allocate a region for INT32s, write them into the buffer and do byte-swap
|
||||
* if buffer is configured to do so (`swapped` field is TRUE).
|
||||
* when `values` or `count` are zero, does nothing.
|
||||
*
|
||||
* doesn't do any padding.
|
||||
*
|
||||
* @param rpcbuf pointer to x_rpcbuf_t to operate on
|
||||
* @param values pointer to INT32 array to write
|
||||
* @param count number of elements in the array
|
||||
* @return TRUE on success, FALSE on allocation failure
|
||||
*/
|
||||
static inline Bool x_rpcbuf_write_INT32s(x_rpcbuf_t *rpcbuf,
|
||||
const INT32 *values, size_t count)
|
||||
{
|
||||
return x_rpcbuf_write_CARD32s(rpcbuf, (CARD32*)values, count);
|
||||
}
|
||||
|
||||
/*
|
||||
* retrieve number of 4-byte-units (padded) of data written in the buffer
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user