diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2011-04-25 12:56:53 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2011-04-25 12:56:53 -0400 |
commit | 860be17ec3c19a1aeba0bbe7ecaf30be409ea446 (patch) | |
tree | d15c287b1ce9ea89d220ec2bf963c1ef61a3792d /src/backend/port/win32/socket.c | |
parent | 77622887449f0fd0eb08b28fe4fa5992c357d45a (diff) |
Assorted minor changes to silence Windows compiler warnings.
Mostly to do with macro redefinitions or object signedness.
Diffstat (limited to 'src/backend/port/win32/socket.c')
-rw-r--r-- | src/backend/port/win32/socket.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/port/win32/socket.c b/src/backend/port/win32/socket.c index dbbd4a35d16..e2ae0f8e4f5 100644 --- a/src/backend/port/win32/socket.c +++ b/src/backend/port/win32/socket.c @@ -369,8 +369,18 @@ pgwin32_recv(SOCKET s, char *buf, int len, int f) return -1; } +/* + * The second argument to send() is defined by SUS to be a "const void *" + * and so we use the same signature here to keep compilers happy when + * handling callers. + * + * But the buf member of a WSABUF struct is defined as "char *", so we cast + * the second argument to that here when assigning it, also to keep compilers + * happy. + */ + int -pgwin32_send(SOCKET s, char *buf, int len, int flags) +pgwin32_send(SOCKET s, const void *buf, int len, int flags) { WSABUF wbuf; int r; @@ -380,7 +390,7 @@ pgwin32_send(SOCKET s, char *buf, int len, int flags) return -1; wbuf.len = len; - wbuf.buf = buf; + wbuf.buf = (char *) buf; /* * Readiness of socket to send data to UDP socket may be not true: socket |