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;
This commit is contained in:
1 parent
1cb51ff4a4
commit
7c990c498c
1 file changed
+1
-1
+1
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user