mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-25 01:59:56 +00:00
dix: WriteRpcbufToClient(): fix int type mismatches
Use explicit cast to match WriteToClient()'s expectation and return ssize_t, as coming from WriteToClient() Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
committed by
Enrico Weigelt
parent
f03042a2b7
commit
35c075e2c4
@@ -704,9 +704,13 @@ static inline ClientPtr dixLookupXIDOwner(XID xid)
|
||||
* @param rpcbuf the buffer whose contents will be written
|
||||
* @return the result of WriteToClient() call
|
||||
*/
|
||||
static inline int WriteRpcbufToClient(ClientPtr pClient,
|
||||
x_rpcbuf_t *rpcbuf) {
|
||||
int ret = WriteToClient(pClient, rpcbuf->wpos, rpcbuf->buffer);
|
||||
static inline ssize_t WriteRpcbufToClient(ClientPtr pClient,
|
||||
x_rpcbuf_t *rpcbuf) {
|
||||
/* explicitly casting between (s)size_t and int - should be safe,
|
||||
since payloads are always small enough to easily fit into int. */
|
||||
ssize_t ret = WriteToClient(pClient,
|
||||
(int)rpcbuf->wpos,
|
||||
rpcbuf->buffer);
|
||||
x_rpcbuf_clear(rpcbuf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user