Skip to content

Added 2 casts to signed int in HardwareSerial::store_char and HardwareSeial::write. #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
4 changes: 2 additions & 2 deletions hardware/arduino/cores/arduino/HardwareSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
// just before the tail (meaning that the head would advance to the
// current location of the tail), we're about to overflow the buffer
// and so we don't write the character or advance the head.
if (i != buffer->tail) {
if (i != (int) buffer->tail) {
buffer->buffer[buffer->head] = c;
buffer->head = i;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ size_t HardwareSerial::write(uint8_t c)
// If the output buffer is full, there's nothing for it other than to
// wait for the interrupt handler to empty it a bit
// ???: return 0 here instead?
while (i == _tx_buffer->tail)
while (i == (int) _tx_buffer->tail)
;

_tx_buffer->buffer[_tx_buffer->head] = c;
Expand Down