Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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;
  • Loading branch information
henrygab committed Feb 11, 2020
commit 7c990c498c40821d22c101b4f180784a033095da
2 changes: 1 addition & 1 deletion cores/nRF5/Uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down