WriteToClient: preserve constness of buf while extracting length value

Fixes gcc warning:
io.c: In function 'WriteToClient':
io.c:826:6: warning: cast discards qualifiers from pointer target type

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Alan Coopersmith 2011-12-12 16:49:33 -08:00
parent 2c9800f915
commit af4113bfeb

View File

@ -823,7 +823,7 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
CARD32 replylen;
unsigned long bytesleft;
replylen = ((xGenericReply *)buf)->length;
replylen = ((const xGenericReply *)buf)->length;
if (who->swapped)
swapl(&replylen);
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;