diff --git a/include/os.h b/include/os.h index 4be6b8010..c0f04c6af 100644 --- a/include/os.h +++ b/include/os.h @@ -115,7 +115,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); @@ -448,7 +448,7 @@ typedef struct { extern CallbackListPtr ReplyCallback; typedef struct { ClientPtr client; - pointer replyData; + const void *replyData; unsigned long dataLenBytes; unsigned long bytesRemaining; Bool startOfReply; diff --git a/os/io.c b/os/io.c index e7ec60952..4f4a10903 100644 --- a/os/io.c +++ b/os/io.c @@ -730,11 +730,12 @@ SetCriticalOutputPending(void) *****************/ _X_EXPORT int -WriteToClient (ClientPtr who, int count, char *buf) +WriteToClient (ClientPtr who, int count, const void *__buf) { OsCommPtr oc = (OsCommPtr)who->osPrivate; ConnectionOutputPtr oco = oc->output; int padBytes; + const char *buf = __buf; #ifdef DEBUG_COMMUNICATION Bool multicount = FALSE; #endif @@ -871,13 +872,14 @@ WriteToClient (ClientPtr who, int count, char *buf) **********************/ int -FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) +FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) { ConnectionOutputPtr oco = oc->output; int connection = oc->fd; XtransConnInfo trans_conn = oc->trans_conn; struct iovec iov[3]; static char padBuffer[3]; + const char *extraBuf = __extraBuf; long written; long padsize; long notWritten; @@ -916,14 +918,14 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) before = (-len); \ } else { \ iov[i].iov_len = len; \ - iov[i].iov_base = (pointer) + before; \ + iov[i].iov_base = (pointer) + before; \ i++; \ remain -= len; \ before = 0; \ } InsertIOV ((char *)oco->buf, oco->count) - InsertIOV (extraBuf, extraCount) + InsertIOV ((char *)extraBuf, extraCount) InsertIOV (padBuffer, padsize) errno = 0; diff --git a/os/osdep.h b/os/osdep.h index b6894c146..84f7177db 100644 --- a/os/osdep.h +++ b/os/osdep.h @@ -184,7 +184,7 @@ typedef struct _osComm { extern int FlushClient( ClientPtr /*who*/, OsCommPtr /*oc*/, - char* /*extraBuf*/, + const void * /*extraBuf*/, int /*extraCount*/ );