From 41e3aa10d7183b54e7f745ffae7af2be2aba2d3d Mon Sep 17 00:00:00 2001 From: "rickg%netscape.com" Date: Mon, 19 Jul 1999 03:10:41 +0000 Subject: [PATCH] improved api's git-svn-id: svn://10.0.0.236/trunk@40070 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsStr.cpp | 4 ++-- mozilla/string/obsolete/nsString.cpp | 4 ++-- mozilla/string/obsolete/nsString.h | 4 ++-- mozilla/string/obsolete/nsString2.cpp | 8 ++++---- mozilla/string/obsolete/nsString2.h | 10 +++++----- mozilla/xpcom/ds/bufferRoutines.h | 10 +++++----- mozilla/xpcom/ds/nsStr.cpp | 4 ++-- mozilla/xpcom/ds/nsString.cpp | 4 ++-- mozilla/xpcom/ds/nsString.h | 4 ++-- mozilla/xpcom/ds/nsString2.cpp | 8 ++++---- mozilla/xpcom/ds/nsString2.h | 10 +++++----- mozilla/xpcom/string/obsolete/nsStr.cpp | 4 ++-- mozilla/xpcom/string/obsolete/nsString.cpp | 4 ++-- mozilla/xpcom/string/obsolete/nsString.h | 4 ++-- mozilla/xpcom/string/obsolete/nsString2.cpp | 8 ++++---- mozilla/xpcom/string/obsolete/nsString2.h | 10 +++++----- 16 files changed, 50 insertions(+), 50 deletions(-) diff --git a/mozilla/string/obsolete/nsStr.cpp b/mozilla/string/obsolete/nsStr.cpp index 52b1cc2466f..a7955192aea 100644 --- a/mozilla/string/obsolete/nsStr.cpp +++ b/mozilla/string/obsolete/nsStr.cpp @@ -34,7 +34,7 @@ #include "nsCRT.h" #include "nsDeque.h" - + static const char* kFoolMsg = "Error: Some fool overwrote the shared buffer."; static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1."; static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1."; @@ -566,7 +566,7 @@ PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnore * @param aDest string to search * @param aTarget is the substring you're trying to find. * @param aIgnorecase indicates case sensitivity of search - * @param anOffset tells us where to start the search + * @param anOffset tells us where to start the search (counting from left) * @return index in aDest where member of aSet occurs, or -1 if not found */ PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) { diff --git a/mozilla/string/obsolete/nsString.cpp b/mozilla/string/obsolete/nsString.cpp index 693bf0849d7..0b7744511f3 100644 --- a/mozilla/string/obsolete/nsString.cpp +++ b/mozilla/string/obsolete/nsString.cpp @@ -1252,7 +1252,7 @@ PRInt32 nsCString::Find(const nsStr& aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1365,7 +1365,7 @@ PRInt32 nsCString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h index b4b527ad528..74ce1eeb5e9 100644 --- a/mozilla/string/obsolete/nsString.h +++ b/mozilla/string/obsolete/nsString.h @@ -561,7 +561,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -595,7 +595,7 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index f0f7fa5c4b5..f6f886b1372 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -27,7 +27,7 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" #include "nsISizeOfHandler.h" -#endif +#endif static const char* kNullPointerError = "Error: unexpected null ptr"; @@ -1359,7 +1359,7 @@ PRInt32 nsString::Find(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOffs * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1484,11 +1484,11 @@ PRInt32 nsString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset) * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } - + /** * Search for a given char, starting at given offset * diff --git a/mozilla/string/obsolete/nsString2.h b/mozilla/string/obsolete/nsString2.h index dbd1667d072..2b2b1e17fc6 100644 --- a/mozilla/string/obsolete/nsString2.h +++ b/mozilla/string/obsolete/nsString2.h @@ -570,7 +570,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -589,7 +589,7 @@ PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const; * This methods scans the string backwards, looking for the given string * @param aString is substring to be sought in this * @param aIgnoreCase tells us whether or not to do caseless compare - * @return offset in string, or -1 (kNotFound) + * @param anOffset tells us where in this strig to start searching (counting from left) */ PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; @@ -601,18 +601,18 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * Search for given char within this string * * @param aString is substring to be sought in this - * @param anOffset tells us where in this strig to start searching + * @param anOffset tells us where in this strig to start searching (counting from left) * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** * This method searches this string for the last character * found in the given string * @param aString contains set of chars to be found - * @param anOffset tells us where to start searching in this + * @param anOffset tells us where in this strig to start searching (counting from left) * @return -1 if not found, else the offset in this */ PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const; diff --git a/mozilla/xpcom/ds/bufferRoutines.h b/mozilla/xpcom/ds/bufferRoutines.h index f1634c1d9e6..ce501e1d5d0 100644 --- a/mozilla/xpcom/ds/bufferRoutines.h +++ b/mozilla/xpcom/ds/bufferRoutines.h @@ -336,10 +336,10 @@ inline PRInt32 FindChar2(const char* aDest,PRUint32 aLength,PRUint32 anOffset,co * @param aIgnorecase tells us whether to use a case sensitive search * @return index of pos if found, else -1 (kNotFound) */ -inline PRInt32 RFindChar1(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) { +inline PRInt32 RFindChar1(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) { PRUnichar theCmpChar=(aIgnoreCase ? nsCRT::ToUpper(aChar) : aChar); PRInt32 theIndex=0; - PRInt32 thePos=(PRInt32)aLength-anOffset-1; + PRInt32 thePos=(PRInt32)anOffset; for(theIndex=thePos;theIndex>=0;theIndex--){ PRUnichar theChar=GetCharAt(aDest,theIndex); if(aIgnoreCase) @@ -362,10 +362,10 @@ inline PRInt32 RFindChar1(const char* aDest,PRUint32 aLength,PRUint32 anOffset,c * @param aIgnorecase tells us whether to use a case sensitive search * @return index of pos if found, else -1 (kNotFound) */ -inline PRInt32 RFindChar2(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) { +inline PRInt32 RFindChar2(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase) { PRUnichar theCmpChar=(aIgnoreCase ? nsCRT::ToUpper(aChar) : aChar); PRInt32 theIndex=0; - PRInt32 thePos=(PRInt32)aLength-anOffset-1; + PRInt32 thePos=(PRInt32)anOffset; for(theIndex=thePos;theIndex>=0;theIndex--){ PRUnichar theChar=GetUnicharAt(aDest,theIndex); if(aIgnoreCase) @@ -376,7 +376,7 @@ inline PRInt32 RFindChar2(const char* aDest,PRUint32 aLength,PRUint32 anOffset,c return kNotFound; } -typedef PRInt32 (*FindChars)(const char* aDest,PRUint32 aLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase); +typedef PRInt32 (*FindChars)(const char* aDest,PRUint32 aDestLength,PRUint32 anOffset,const PRUnichar aChar,PRBool aIgnoreCase); FindChars gFindChars[]={&FindChar1,&FindChar2}; FindChars gRFindChars[]={&RFindChar1,&RFindChar2}; diff --git a/mozilla/xpcom/ds/nsStr.cpp b/mozilla/xpcom/ds/nsStr.cpp index 52b1cc2466f..a7955192aea 100644 --- a/mozilla/xpcom/ds/nsStr.cpp +++ b/mozilla/xpcom/ds/nsStr.cpp @@ -34,7 +34,7 @@ #include "nsCRT.h" #include "nsDeque.h" - + static const char* kFoolMsg = "Error: Some fool overwrote the shared buffer."; static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1."; static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1."; @@ -566,7 +566,7 @@ PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnore * @param aDest string to search * @param aTarget is the substring you're trying to find. * @param aIgnorecase indicates case sensitivity of search - * @param anOffset tells us where to start the search + * @param anOffset tells us where to start the search (counting from left) * @return index in aDest where member of aSet occurs, or -1 if not found */ PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) { diff --git a/mozilla/xpcom/ds/nsString.cpp b/mozilla/xpcom/ds/nsString.cpp index 693bf0849d7..0b7744511f3 100644 --- a/mozilla/xpcom/ds/nsString.cpp +++ b/mozilla/xpcom/ds/nsString.cpp @@ -1252,7 +1252,7 @@ PRInt32 nsCString::Find(const nsStr& aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1365,7 +1365,7 @@ PRInt32 nsCString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } diff --git a/mozilla/xpcom/ds/nsString.h b/mozilla/xpcom/ds/nsString.h index b4b527ad528..74ce1eeb5e9 100644 --- a/mozilla/xpcom/ds/nsString.h +++ b/mozilla/xpcom/ds/nsString.h @@ -561,7 +561,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -595,7 +595,7 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp index f0f7fa5c4b5..f6f886b1372 100644 --- a/mozilla/xpcom/ds/nsString2.cpp +++ b/mozilla/xpcom/ds/nsString2.cpp @@ -27,7 +27,7 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" #include "nsISizeOfHandler.h" -#endif +#endif static const char* kNullPointerError = "Error: unexpected null ptr"; @@ -1359,7 +1359,7 @@ PRInt32 nsString::Find(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOffs * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1484,11 +1484,11 @@ PRInt32 nsString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset) * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } - + /** * Search for a given char, starting at given offset * diff --git a/mozilla/xpcom/ds/nsString2.h b/mozilla/xpcom/ds/nsString2.h index dbd1667d072..2b2b1e17fc6 100644 --- a/mozilla/xpcom/ds/nsString2.h +++ b/mozilla/xpcom/ds/nsString2.h @@ -570,7 +570,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -589,7 +589,7 @@ PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const; * This methods scans the string backwards, looking for the given string * @param aString is substring to be sought in this * @param aIgnoreCase tells us whether or not to do caseless compare - * @return offset in string, or -1 (kNotFound) + * @param anOffset tells us where in this strig to start searching (counting from left) */ PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; @@ -601,18 +601,18 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * Search for given char within this string * * @param aString is substring to be sought in this - * @param anOffset tells us where in this strig to start searching + * @param anOffset tells us where in this strig to start searching (counting from left) * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** * This method searches this string for the last character * found in the given string * @param aString contains set of chars to be found - * @param anOffset tells us where to start searching in this + * @param anOffset tells us where in this strig to start searching (counting from left) * @return -1 if not found, else the offset in this */ PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const; diff --git a/mozilla/xpcom/string/obsolete/nsStr.cpp b/mozilla/xpcom/string/obsolete/nsStr.cpp index 52b1cc2466f..a7955192aea 100644 --- a/mozilla/xpcom/string/obsolete/nsStr.cpp +++ b/mozilla/xpcom/string/obsolete/nsStr.cpp @@ -34,7 +34,7 @@ #include "nsCRT.h" #include "nsDeque.h" - + static const char* kFoolMsg = "Error: Some fool overwrote the shared buffer."; static const char* kCallFindChar = "For better performance, call FindChar() for targets whose length==1."; static const char* kCallRFindChar = "For better performance, call RFindChar() for targets whose length==1."; @@ -566,7 +566,7 @@ PRInt32 nsStr::FindCharInSet(const nsStr& aDest,const nsStr& aSet,PRBool aIgnore * @param aDest string to search * @param aTarget is the substring you're trying to find. * @param aIgnorecase indicates case sensitivity of search - * @param anOffset tells us where to start the search + * @param anOffset tells us where to start the search (counting from left) * @return index in aDest where member of aSet occurs, or -1 if not found */ PRInt32 nsStr::RFindSubstr(const nsStr& aDest,const nsStr& aTarget, PRBool aIgnoreCase,PRInt32 anOffset) { diff --git a/mozilla/xpcom/string/obsolete/nsString.cpp b/mozilla/xpcom/string/obsolete/nsString.cpp index 693bf0849d7..0b7744511f3 100644 --- a/mozilla/xpcom/string/obsolete/nsString.cpp +++ b/mozilla/xpcom/string/obsolete/nsString.cpp @@ -1252,7 +1252,7 @@ PRInt32 nsCString::Find(const nsStr& aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1365,7 +1365,7 @@ PRInt32 nsCString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsCString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsCString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } diff --git a/mozilla/xpcom/string/obsolete/nsString.h b/mozilla/xpcom/string/obsolete/nsString.h index b4b527ad528..74ce1eeb5e9 100644 --- a/mozilla/xpcom/string/obsolete/nsString.h +++ b/mozilla/xpcom/string/obsolete/nsString.h @@ -561,7 +561,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -595,7 +595,7 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index f0f7fa5c4b5..f6f886b1372 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -27,7 +27,7 @@ #ifndef RICKG_TESTBED #include "prdtoa.h" #include "nsISizeOfHandler.h" -#endif +#endif static const char* kNullPointerError = "Error: unexpected null ptr"; @@ -1359,7 +1359,7 @@ PRInt32 nsString::Find(const nsString& aString,PRBool aIgnoreCase,PRInt32 anOffs * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::Find(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::Find(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::FindChar(*this,aChar,aIgnoreCase,anOffset); return result; } @@ -1484,11 +1484,11 @@ PRInt32 nsString::RFind(const char* aString,PRBool aIgnoreCase,PRInt32 anOffset) * @param * @return offset of found char, or -1 (kNotFound) */ -PRInt32 nsString::RFind(PRUnichar aChar,PRUint32 anOffset,PRBool aIgnoreCase) const{ +PRInt32 nsString::RFind(PRUnichar aChar,PRInt32 anOffset,PRBool aIgnoreCase) const{ PRInt32 result=nsStr::RFindChar(*this,aChar,aIgnoreCase,anOffset); return result; } - + /** * Search for a given char, starting at given offset * diff --git a/mozilla/xpcom/string/obsolete/nsString2.h b/mozilla/xpcom/string/obsolete/nsString2.h index dbd1667d072..2b2b1e17fc6 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.h +++ b/mozilla/xpcom/string/obsolete/nsString2.h @@ -570,7 +570,7 @@ PRInt32 Find(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffs * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 Find(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 Find(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 FindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** @@ -589,7 +589,7 @@ PRInt32 FindCharInSet(const nsStr& aString,PRInt32 anOffset=-1) const; * This methods scans the string backwards, looking for the given string * @param aString is substring to be sought in this * @param aIgnoreCase tells us whether or not to do caseless compare - * @return offset in string, or -1 (kNotFound) + * @param anOffset tells us where in this strig to start searching (counting from left) */ PRInt32 RFind(const char* aCString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; PRInt32 RFind(const nsString& aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; @@ -601,18 +601,18 @@ PRInt32 RFind(const PRUnichar* aString,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOff * Search for given char within this string * * @param aString is substring to be sought in this - * @param anOffset tells us where in this strig to start searching + * @param anOffset tells us where in this strig to start searching (counting from left) * @param aIgnoreCase selects case sensitivity * @return find pos in string, or -1 (kNotFound) */ -PRInt32 RFind(PRUnichar aChar,PRUint32 offset=0,PRBool aIgnoreCase=PR_FALSE) const; +PRInt32 RFind(PRUnichar aChar,PRInt32 offset=-1,PRBool aIgnoreCase=PR_FALSE) const; PRInt32 RFindChar(PRUnichar aChar,PRBool aIgnoreCase=PR_FALSE,PRInt32 anOffset=-1) const; /** * This method searches this string for the last character * found in the given string * @param aString contains set of chars to be found - * @param anOffset tells us where to start searching in this + * @param anOffset tells us where in this strig to start searching (counting from left) * @return -1 if not found, else the offset in this */ PRInt32 RFindCharInSet(const char* aString,PRInt32 anOffset=-1) const;