From ff81a52695821704a3eb33e8de8bb7fe55bccfe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 4 Jul 2016 00:21:45 +0200 Subject: Make WriteToClient take a const void * like any decent IO write function. Enough with the casting. Doesn't break API or even ABI, but does make a lot of silly casts superfluos. --- nx-X11/programs/Xserver/include/os.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/include') diff --git a/nx-X11/programs/Xserver/include/os.h b/nx-X11/programs/Xserver/include/os.h index 6e629c42f..26ce2706c 100644 --- a/nx-X11/programs/Xserver/include/os.h +++ b/nx-X11/programs/Xserver/include/os.h @@ -124,7 +124,7 @@ extern void FlushIfCriticalOutputPending(void); extern void SetCriticalOutputPending(void); -extern int WriteToClient(ClientPtr /*who*/, int /*count*/, char* /*buf*/); +extern int WriteToClient(ClientPtr /*who*/, int /*count*/, const void* /*__buf*/); extern void ResetOsBuffers(void); @@ -444,7 +444,7 @@ typedef struct { extern CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; - void * replyData; + const void * replyData; unsigned long dataLenBytes; unsigned long bytesRemaining; Bool startOfReply; -- cgit v1.2.3 From f6a1bda2dff0c70aa13f3cb763a9b08c4c037c53 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Mon, 4 Jul 2016 00:28:47 +0200 Subject: Remove unneccesary casts from WriteToClient calls Casting return to (void) was used to tell lint that you intended to ignore the return value, so it didn't warn you about it. Casting the third argument to (char *) was used as the most generic pointer type in the days before compilers supported C89 (void *) (except for a couple places it's used for byte-sized pointer math). Signed-off-by: Alan Coopersmith Reviewed-by: Keith Packard Tested-by: Daniel Stone Backport to nx-libs: Mike Gabriel --- nx-X11/programs/Xserver/include/dix.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/programs/Xserver/include') diff --git a/nx-X11/programs/Xserver/include/dix.h b/nx-X11/programs/Xserver/include/dix.h index b7f91b6da..e68c71623 100644 --- a/nx-X11/programs/Xserver/include/dix.h +++ b/nx-X11/programs/Xserver/include/dix.h @@ -281,12 +281,12 @@ SOFTWARE. if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ - else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); } + else WriteToClient(pClient, (int)(size), (pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \ - else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf)); + else WriteToClient (pClient, (int)(size), (pbuf)); typedef struct _TimeStamp *TimeStampPtr; -- cgit v1.2.3