[gnoduino: 228/237] Fixing warnings (unsigned comparisons to 0). (maniacbug)
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino: 228/237] Fixing warnings (unsigned comparisons to 0). (maniacbug)
- Date: Sat, 31 Mar 2012 20:34:00 +0000 (UTC)
commit a660bc70688f3e2b10c1fc40d5eaf371afcec752
Author: David A. Mellis <d mellis arduino cc>
Date: Mon Jan 2 12:57:23 2012 -0500
Fixing warnings (unsigned comparisons to 0). (maniacbug)
arduino/cores/arduino/WString.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/arduino/cores/arduino/WString.cpp b/arduino/cores/arduino/WString.cpp
index 3e81331..c6839fc 100644
--- a/arduino/cores/arduino/WString.cpp
+++ b/arduino/cores/arduino/WString.cpp
@@ -500,7 +500,7 @@ int String::lastIndexOf( char theChar ) const
int String::lastIndexOf(char ch, unsigned int fromIndex) const
{
- if (fromIndex >= len || fromIndex < 0) return -1;
+ if (fromIndex >= len) return -1;
char tempchar = buffer[fromIndex + 1];
buffer[fromIndex + 1] = '\0';
char* temp = strrchr( buffer, ch );
@@ -516,7 +516,7 @@ int String::lastIndexOf(const String &s2) 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 (s2.len == 0 || len == 0 || s2.len > len) return -1;
if (fromIndex >= len) fromIndex = len - 1;
int found = -1;
for (char *p = buffer; p <= buffer + fromIndex; p++) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]