Commit ff81a526 authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by Mike Gabriel

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.
parent 06a97857
...@@ -124,7 +124,7 @@ extern void FlushIfCriticalOutputPending(void); ...@@ -124,7 +124,7 @@ extern void FlushIfCriticalOutputPending(void);
extern void SetCriticalOutputPending(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); extern void ResetOsBuffers(void);
...@@ -444,7 +444,7 @@ typedef struct { ...@@ -444,7 +444,7 @@ typedef struct {
extern CallbackListPtr ReplyCallback; extern CallbackListPtr ReplyCallback;
typedef struct { typedef struct {
ClientPtr client; ClientPtr client;
void * replyData; const void * replyData;
unsigned long dataLenBytes; unsigned long dataLenBytes;
unsigned long bytesRemaining; unsigned long bytesRemaining;
Bool startOfReply; Bool startOfReply;
......
...@@ -857,11 +857,12 @@ SetCriticalOutputPending(void) ...@@ -857,11 +857,12 @@ SetCriticalOutputPending(void)
*****************/ *****************/
int int
WriteToClient (ClientPtr who, int count, char *buf) WriteToClient (ClientPtr who, int count, const void *__buf)
{ {
OsCommPtr oc; OsCommPtr oc;
ConnectionOutputPtr oco; ConnectionOutputPtr oco;
int padBytes; int padBytes;
const char *buf = __buf;
#ifdef DEBUG_COMMUNICATION #ifdef DEBUG_COMMUNICATION
Bool multicount = FALSE; Bool multicount = FALSE;
#endif #endif
...@@ -999,13 +1000,14 @@ WriteToClient (ClientPtr who, int count, char *buf) ...@@ -999,13 +1000,14 @@ WriteToClient (ClientPtr who, int count, char *buf)
**********************/ **********************/
int int
FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
{ {
ConnectionOutputPtr oco = oc->output; ConnectionOutputPtr oco = oc->output;
int connection = oc->fd; int connection = oc->fd;
XtransConnInfo trans_conn = oc->trans_conn; XtransConnInfo trans_conn = oc->trans_conn;
struct iovec iov[3]; struct iovec iov[3];
static char padBuffer[3]; static char padBuffer[3];
const char *extraBuf = __extraBuf;
long written; long written;
long padsize; long padsize;
long notWritten; long notWritten;
...@@ -1051,7 +1053,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount) ...@@ -1051,7 +1053,7 @@ FlushClient(ClientPtr who, OsCommPtr oc, char *extraBuf, int extraCount)
} }
InsertIOV ((char *)oco->buf, oco->count) InsertIOV ((char *)oco->buf, oco->count)
InsertIOV (extraBuf, extraCount) InsertIOV ((char *)extraBuf, extraCount)
InsertIOV (padBuffer, padsize) InsertIOV (padBuffer, padsize)
errno = 0; errno = 0;
......
...@@ -187,7 +187,7 @@ typedef struct _osComm { ...@@ -187,7 +187,7 @@ typedef struct _osComm {
extern int FlushClient( extern int FlushClient(
ClientPtr /*who*/, ClientPtr /*who*/,
OsCommPtr /*oc*/, OsCommPtr /*oc*/,
char* /*extraBuf*/, const void * /*__extraBuf*/,
int /*extraCount*/ int /*extraCount*/
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment