From a0fbfe1c6d6f42b4c2704c882beda1c4cafe5016 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 24 Oct 2017 11:27:44 +0200 Subject: [SERVER] Fix types or add explicit casts everywhere we might have type conversion problems --- src/shared/protocol.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/shared/protocol.h') diff --git a/src/shared/protocol.h b/src/shared/protocol.h index c3ccbc1..561e5a1 100644 --- a/src/shared/protocol.h +++ b/src/shared/protocol.h @@ -26,7 +26,7 @@ static inline int dnbd3_read_reply(int sock, dnbd3_reply_t *reply, bool wait) { - int ret = recv( sock, reply, sizeof(*reply), (wait ? MSG_WAITALL : MSG_DONTWAIT) | MSG_NOSIGNAL ); + ssize_t ret = recv( sock, reply, sizeof(*reply), (wait ? MSG_WAITALL : MSG_DONTWAIT) | MSG_NOSIGNAL ); if ( ret == 0 ) return REPLY_CLOSED; if ( ret < 0 ) { if ( errno == EAGAIN || errno == EWOULDBLOCK ) return REPLY_AGAIN; @@ -62,7 +62,7 @@ static inline bool dnbd3_select_image(int sock, const char *name, uint16_t rid, const ssize_t len = serializer_get_written_length( &serialized ); request.magic = dnbd3_packet_magic; request.cmd = CMD_SELECT_IMAGE; - request.size = len; + request.size = (uint32_t)len; #ifdef _DEBUG request.handle = 0; request.offset = 0; -- cgit v1.2.3-55-g7522