aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/WString.cpp
diff options
context:
space:
mode:
authorDavid A. Mellis <d.mellis@arduino.cc>2011-10-10 11:28:44 -0400
committerDavid A. Mellis <d.mellis@arduino.cc>2011-10-10 11:28:44 -0400
commit77cdeb5b930c473488933e04573159bda93b9491 (patch)
tree6b5a1348f5a2a26b8affc302ab66b5ac5ac9853f /cores/arduino/WString.cpp
parent075bb009b9bf48169921e1a43329ea49c15480bc (diff)
Fixing more warnings (Paul Stoffregen).
Diffstat (limited to 'cores/arduino/WString.cpp')
-rw-r--r--cores/arduino/WString.cpp6
1 files changed, 3 insertions, 3 deletions
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;
}