summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-16 00:24:59 +0300
committerAndrei Karas <akaras@inbox.ru>2018-12-12 21:18:05 +0300
commit172734fc0a75b6f00f7ef8ecabfda32d5c341187 (patch)
tree9b7fd45b12753a1d9c29bfe8936af72daabcbcc4 /src/common
parentaf9e75a46245eee406eb1b9d7b3c98181b3a9cc4 (diff)
downloadhercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.gz
hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.bz2
hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.tar.xz
hercules-172734fc0a75b6f00f7ef8ecabfda32d5c341187.zip
Fix some visual studio warnings.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/packetsstatic_len.h4
-rw-r--r--src/common/socket.c2
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);
}