Skip to content

Commit d8d6f4c

Browse files
committed
Fixing more warnings (Paul Stoffregen).
1 parent e2d7d21 commit d8d6f4c

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

hardware/arduino/cores/arduino/HardwareSerial.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ inline void store_char(unsigned char c, ring_buffer *buffer)
9191
#if !defined(USART_RX_vect) && !defined(SIG_USART0_RECV) && \
9292
!defined(SIG_UART0_RECV) && !defined(USART0_RX_vect) && \
9393
!defined(SIG_UART_RECV)
94-
#error Don't know what the Data Received vector is called for the first UART
94+
#error "Don't know what the Data Received vector is called for the first UART"
9595
#else
9696
void serialEvent() __attribute__((weak));
9797
void serialEvent() {}
@@ -180,7 +180,7 @@ void serialEventRun(void)
180180
// do nothing - on the 32u4 the first USART is USART1
181181
#else
182182
#if !defined(UART0_UDRE_vect) && !defined(UART_UDRE_vect) && !defined(USART0_UDRE_vect) && !defined(USART_UDRE_vect)
183-
#error Don't know what the Data Register Empty vector is called for the first UART
183+
#error "Don't know what the Data Register Empty vector is called for the first UART"
184184
#else
185185
#if defined(UART0_UDRE_vect)
186186
ISR(UART0_UDRE_vect)

hardware/arduino/cores/arduino/Print.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ size_t Print::print(const __FlashStringHelper *ifsh)
5454
size_t Print::print(const String &s)
5555
{
5656
size_t n = 0;
57-
for (int i = 0; i < s.length(); i++) {
57+
for (uint16_t i = 0; i < s.length(); i++) {
5858
n += write(s[i]);
5959
}
6060
return n;

hardware/arduino/cores/arduino/WString.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ int String::lastIndexOf( char theChar ) const
498498
return lastIndexOf(theChar, len - 1);
499499
}
500500

501-
int String::lastIndexOf(char ch, int fromIndex) const
501+
int String::lastIndexOf(char ch, unsigned int fromIndex) const
502502
{
503503
if (fromIndex >= len || fromIndex < 0) return -1;
504504
char tempchar = buffer[fromIndex + 1];
@@ -514,15 +514,15 @@ int String::lastIndexOf(const String &s2) const
514514
return lastIndexOf(s2, len - s2.len);
515515
}
516516

517-
int String::lastIndexOf(const String &s2, int fromIndex) const
517+
int String::lastIndexOf(const String &s2, unsigned int fromIndex) const
518518
{
519519
if (s2.len == 0 || len == 0 || s2.len > len || fromIndex < 0) return -1;
520520
if (fromIndex >= len) fromIndex = len - 1;
521521
int found = -1;
522522
for (char *p = buffer; p <= buffer + fromIndex; p++) {
523523
p = strstr(p, s2.buffer);
524524
if (!p) break;
525-
if (p - buffer <= fromIndex) found = p - buffer;
525+
if ((unsigned int)(p - buffer) <= fromIndex) found = p - buffer;
526526
}
527527
return found;
528528
}

hardware/arduino/cores/arduino/WString.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ class String
154154
int indexOf( const String &str ) const;
155155
int indexOf( const String &str, unsigned int fromIndex ) const;
156156
int lastIndexOf( char ch ) const;
157-
int lastIndexOf( char ch, int fromIndex ) const;
157+
int lastIndexOf( char ch, unsigned int fromIndex ) const;
158158
int lastIndexOf( const String &str ) const;
159-
int lastIndexOf( const String &str, int fromIndex ) const;
159+
int lastIndexOf( const String &str, unsigned int fromIndex ) const;
160160
String substring( unsigned int beginIndex ) const;
161161
String substring( unsigned int beginIndex, unsigned int endIndex ) const;
162162

hardware/arduino/cores/arduino/wiring_private.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
#include <avr/io.h>
2929
#include <avr/interrupt.h>
30-
#include <avr/delay.h>
3130
#include <stdio.h>
3231
#include <stdarg.h>
3332

0 commit comments

Comments
 (0)