From e5f665c7187b6934a71169cab5075f899150f17a Mon Sep 17 00:00:00 2001 From: marxin Date: Thu, 21 Feb 2019 20:57:39 +0100 Subject: Fix -Wsign-compare warnings. I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type. --- modules/websocket/packet_buffer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules/websocket/packet_buffer.h') diff --git a/modules/websocket/packet_buffer.h b/modules/websocket/packet_buffer.h index 5794288c2b..47786a87a6 100644 --- a/modules/websocket/packet_buffer.h +++ b/modules/websocket/packet_buffer.h @@ -50,7 +50,7 @@ public: Error write_packet(const uint8_t *p_payload, uint32_t p_size, const T *p_info) { #ifdef TOOLS_ENABLED // Verbose buffer warnings - if (p_payload && _payload.space_left() < p_size) { + if (p_payload && _payload.space_left() < (int32_t)p_size) { ERR_PRINT("Buffer payload full! Dropping data."); ERR_FAIL_V(ERR_OUT_OF_MEMORY); } @@ -83,8 +83,8 @@ public: ERR_FAIL_COND_V(_packets.data_left() < 1, ERR_UNAVAILABLE); _Packet p; _packets.read(&p, 1); - ERR_FAIL_COND_V(_payload.data_left() < p.size, ERR_BUG); - ERR_FAIL_COND_V(p_bytes < p.size, ERR_OUT_OF_MEMORY); + ERR_FAIL_COND_V(_payload.data_left() < (int)p.size, ERR_BUG); + ERR_FAIL_COND_V(p_bytes < (int)p.size, ERR_OUT_OF_MEMORY); r_read = p.size; copymem(r_info, &p.info, sizeof(T)); -- cgit v1.2.3