Commit 524aa2e5 authored by Sergey Lyubka's avatar Sergey Lyubka

Merge pull request #556 from nesteroff/vs2013

Fix VS2013 warnings
parents 4cb0c686 990a1b9a
...@@ -42,11 +42,16 @@ ...@@ -42,11 +42,16 @@
#undef UNICODE // Use ANSI WinAPI functions #undef UNICODE // Use ANSI WinAPI functions
#undef _UNICODE // Use multibyte encoding on Windows #undef _UNICODE // Use multibyte encoding on Windows
#ifndef _MBCS
#define _MBCS // Use multibyte encoding on Windows #define _MBCS // Use multibyte encoding on Windows
#endif
#define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows #define _INTEGRAL_MAX_BITS 64 // Enable _stati64() on Windows
#ifndef _CRT_SECURE_NO_WARNINGS #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+ #define _CRT_SECURE_NO_WARNINGS // Disable deprecation warning in VS2005+
#endif #endif
#ifndef _WINSOCK_DEPRECATED_NO_WARNINGS
#define _WINSOCK_DEPRECATED_NO_WARNINGS // Disable deprecated Winsock API warnings in VS2013+
#endif
#undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h #undef WIN32_LEAN_AND_MEAN // Let windows.h always include winsock2.h
#ifdef __Linux__ #ifdef __Linux__
#define _XOPEN_SOURCE 600 // For flockfile() on Linux #define _XOPEN_SOURCE 600 // For flockfile() on Linux
...@@ -3887,7 +3892,7 @@ static void handle_put(struct connection *conn, const char *path) { ...@@ -3887,7 +3892,7 @@ static void handle_put(struct connection *conn, const char *path) {
static void forward_put_data(struct connection *conn) { static void forward_put_data(struct connection *conn) {
struct iobuf *io = &conn->ns_conn->recv_iobuf; struct iobuf *io = &conn->ns_conn->recv_iobuf;
size_t k = conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len; // To write size_t k = (size_t)(conn->cl < (int64_t) io->len ? conn->cl : (int64_t) io->len); // To write
size_t n = write(conn->endpoint.fd, io->buf, k); // Write them! size_t n = write(conn->endpoint.fd, io->buf, k); // Write them!
if (n > 0) { if (n > 0) {
iobuf_remove(io, n); iobuf_remove(io, n);
...@@ -4796,7 +4801,7 @@ static void on_recv_data(struct connection *conn) { ...@@ -4796,7 +4801,7 @@ static void on_recv_data(struct connection *conn) {
} }
if (conn->ns_conn->flags & NSF_DISCARD) { if (conn->ns_conn->flags & NSF_DISCARD) {
size_t n = conn->cl; size_t n = (size_t)conn->cl;
if (n > io->len) { if (n > io->len) {
n = io->len; n = io->len;
} }
......
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