diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-16 00:24:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-12-12 21:18:05 +0300 |
commit | 172734fc0a75b6f00f7ef8ecabfda32d5c341187 (patch) | |
tree | 9b7fd45b12753a1d9c29bfe8936af72daabcbcc4 | |
parent | af9e75a46245eee406eb1b9d7b3c98181b3a9cc4 (diff) | |
download | hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.gz hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.bz2 hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.xz hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.zip |
Fix some visual studio warnings.
-rw-r--r-- | src/common/packetsstatic_len.h | 4 | ||||
-rw-r--r-- | src/common/socket.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/common/packetsstatic_len.h b/src/common/packetsstatic_len.h index 8e724cfa8..31a3988e8 100644 --- a/src/common/packetsstatic_len.h +++ b/src/common/packetsstatic_len.h @@ -25,8 +25,8 @@ #endif #define DEFINE_PACKET_HEADER(name, id) \ - STATIC_ASSERT(PACKET_LEN_##id == -1 || sizeof(struct PACKET_##name) == \ - PACKET_LEN_##id, "Wrong size PACKET_"#name); \ + STATIC_ASSERT((int32)(PACKET_LEN_##id) == -1 || sizeof(struct PACKET_##name) == \ + (size_t)PACKET_LEN_##id, "Wrong size PACKET_"#name); \ enum { HEADER_##name = id }; #define packetLen(id, len) PACKET_LEN_##id = (len), diff --git a/src/common/socket.c b/src/common/socket.c index 025776172..95d8bf578 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -2133,7 +2133,7 @@ static void socket_validateWfifo(int fd, size_t len) ShowError("Sent packet 0x%04X with size %d, but must be size %d\n", cmd, len2, packet_len); Assert_retv(0); } - if (last_head_size < packet_len) { + if (last_head_size < (uint32)packet_len) { ShowError("Reserved too small packet buffer for packet 0x%04X with size %u, but must be size %d\n", cmd, last_head_size, packet_len); Assert_retv(0); } |