From 77cdeb5b930c473488933e04573159bda93b9491 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Mon, 10 Oct 2011 11:28:44 -0400 Subject: Fixing more warnings (Paul Stoffregen). --- cores/arduino/WString.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cores/arduino/WString.cpp') diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index f90cef0..ad8d828 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -498,7 +498,7 @@ int String::lastIndexOf( char theChar ) const return lastIndexOf(theChar, len - 1); } -int String::lastIndexOf(char ch, int fromIndex) const +int String::lastIndexOf(char ch, unsigned int fromIndex) const { if (fromIndex >= len || fromIndex < 0) return -1; char tempchar = buffer[fromIndex + 1]; @@ -514,7 +514,7 @@ int String::lastIndexOf(const String &s2) const return lastIndexOf(s2, len - s2.len); } -int String::lastIndexOf(const String &s2, int fromIndex) const +int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { if (s2.len == 0 || len == 0 || s2.len > len || fromIndex < 0) return -1; if (fromIndex >= len) fromIndex = len - 1; @@ -522,7 +522,7 @@ int String::lastIndexOf(const String &s2, int fromIndex) const for (char *p = buffer; p <= buffer + fromIndex; p++) { p = strstr(p, s2.buffer); if (!p) break; - if (p - buffer <= fromIndex) found = p - buffer; + if ((unsigned int)(p - buffer) <= fromIndex) found = p - buffer; } return found; } -- cgit v1.2.3-18-g5258