summaryrefslogtreecommitdiff
path: root/vio
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2018-01-12 18:25:02 +0000
committerVladislav Vaintroub <wlad@mariadb.com>2018-01-26 10:37:46 +0000
commit9891ee5a2aadd2672d8d7f6b217e852344ff86eb (patch)
tree2f5950ed243a10e36e1d8b9609c6426946fe9011 /vio
parent859d100d70a9dba222b229bbc0d5a01194e8ed5f (diff)
downloadmariadb-git-9891ee5a2aadd2672d8d7f6b217e852344ff86eb.tar.gz
Fix and reenable Windows compiler warning C4800 (size_t conversion).
Diffstat (limited to 'vio')
-rw-r--r--vio/viopipe.c4
-rw-r--r--vio/viosocket.c4
-rw-r--r--vio/viossl.c12
3 files changed, 10 insertions, 10 deletions
diff --git a/vio/viopipe.c b/vio/viopipe.c
index f9af50bc3c9..d3447a95c6e 100644
--- a/vio/viopipe.c
+++ b/vio/viopipe.c
@@ -78,7 +78,7 @@ size_t vio_read_pipe(Vio *vio, uchar *buf, size_t count)
disable_iocp_notification(&vio->overlapped);
/* Attempt to read from the pipe (overlapped I/O). */
- if (ReadFile(vio->hPipe, buf, count, &transferred, &vio->overlapped))
+ if (ReadFile(vio->hPipe, buf, (DWORD)count, &transferred, &vio->overlapped))
{
/* The operation completed immediately. */
ret= transferred;
@@ -101,7 +101,7 @@ size_t vio_write_pipe(Vio *vio, const uchar *buf, size_t count)
disable_iocp_notification(&vio->overlapped);
/* Attempt to write to the pipe (overlapped I/O). */
- if (WriteFile(vio->hPipe, buf, count, &transferred, &vio->overlapped))
+ if (WriteFile(vio->hPipe, buf, (DWORD)count, &transferred, &vio->overlapped))
{
/* The operation completed immediately. */
ret= transferred;
diff --git a/vio/viosocket.c b/vio/viosocket.c
index cb353c1ce75..6d76d99eb99 100644
--- a/vio/viosocket.c
+++ b/vio/viosocket.c
@@ -1296,7 +1296,7 @@ int vio_getnameinfo(const struct sockaddr *sa,
}
return getnameinfo(sa, sa_length,
- hostname, hostname_size,
- port, port_size,
+ hostname, (uint)hostname_size,
+ port, (uint)port_size,
flags);
}
diff --git a/vio/viossl.c b/vio/viossl.c
index e7cc85ea539..000a526a892 100644
--- a/vio/viossl.c
+++ b/vio/viossl.c
@@ -141,10 +141,10 @@ size_t vio_ssl_read(Vio *vio, uchar *buf, size_t size)
vio->ssl_arg));
if (vio->async_context && vio->async_context->active)
- ret= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, size);
+ ret= my_ssl_read_async(vio->async_context, (SSL *)vio->ssl_arg, buf, (int)size);
else
{
- while ((ret= SSL_read(ssl, buf, size)) < 0)
+ while ((ret= SSL_read(ssl, buf, (int)size)) < 0)
{
enum enum_vio_io_event event;
@@ -174,10 +174,10 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size)
if (vio->async_context && vio->async_context->active)
ret= my_ssl_write_async(vio->async_context, (SSL *)vio->ssl_arg, buf,
- size);
+ (int)size);
else
{
- while ((ret= SSL_write(ssl, buf, size)) < 0)
+ while ((ret= SSL_write(ssl, buf, (int)size)) < 0)
{
enum enum_vio_io_event event;
@@ -200,7 +200,7 @@ size_t vio_ssl_write(Vio *vio, const uchar *buf, size_t size)
static long yassl_recv(void *ptr, void *buf, size_t len,
int flag __attribute__((unused)))
{
- return vio_read(ptr, buf, len);
+ return (long)vio_read(ptr, buf, len);
}
@@ -208,7 +208,7 @@ static long yassl_recv(void *ptr, void *buf, size_t len,
static long yassl_send(void *ptr, const void *buf, size_t len,
int flag __attribute__((unused)))
{
- return vio_write(ptr, buf, len);
+ return (long)vio_write(ptr, buf, len);
}
#endif