summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
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);
}