Skip to content

Commit 7c990c4

Browse files
committed
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;
1 parent 1cb51ff commit 7c990c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/Uart.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ size_t Uart::write(const uint8_t *buffer, size_t size)
225225
do
226226
{
227227
size_t remaining = size - sent;
228-
size_t txSize = min(remaining, SERIAL_BUFFER_SIZE);
228+
size_t txSize = min(remaining, (size_t)SERIAL_BUFFER_SIZE);
229229

230230
xSemaphoreTake(_mutex, portMAX_DELAY);
231231

0 commit comments

Comments
 (0)