From 7c990c498c40821d22c101b4f180784a033095da Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Tue, 11 Feb 2020 14:33:58 -0800 Subject: [PATCH] Fix compilation warning. size_t is unsigned; the #defined constant was treated as an integer, which caused the following warning: In file included from cores\nRF5\Uart.cpp:21:0: cores\nRF5\Arduino.h: In instantiation of ```C++ decltype ( ((b < a) ? b : a) ) min(const T&, const L&) [with T = unsigned int; L = int; decltype (((b < a) ? b : a)) = unsigned int ]: ``` cores\nRF5\Uart.cpp:228:54: required from here cores\nRF5\Arduino.h:92:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] return (b < a) ? b : a; --- cores/nRF5/Uart.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/nRF5/Uart.cpp b/cores/nRF5/Uart.cpp index e96959ed..f87f7a99 100644 --- a/cores/nRF5/Uart.cpp +++ b/cores/nRF5/Uart.cpp @@ -225,7 +225,7 @@ size_t Uart::write(const uint8_t *buffer, size_t size) do { size_t remaining = size - sent; - size_t txSize = min(remaining, SERIAL_BUFFER_SIZE); + size_t txSize = min(remaining, (size_t)SERIAL_BUFFER_SIZE); xSemaphoreTake(_mutex, portMAX_DELAY);