From f99a845ffb8d68ffc9b9d4dcb1d103584bd3a86f Mon Sep 17 00:00:00 2001 From: dylan45pie Date: Sat, 9 Jun 2012 14:45:20 +1200 Subject: [PATCH] Added 2 casts to signed int in HardwareSerial::store_char and HardwareSerial::write to stop gcc from spitting out "signed/unsigned mismatch" warnings. --- hardware/arduino/cores/arduino/HardwareSerial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hardware/arduino/cores/arduino/HardwareSerial.cpp b/hardware/arduino/cores/arduino/HardwareSerial.cpp index f40ddee0606..03b1c4d5838 100644 --- a/hardware/arduino/cores/arduino/HardwareSerial.cpp +++ b/hardware/arduino/cores/arduino/HardwareSerial.cpp @@ -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; } @@ -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;