Bug 716544 - Fix comparison between signed and unsigned integer expressions in nsStringAPI.h. r=dbaron
☠☠ backed out by f7ec55cf0e95 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Mar 2012 09:47:02 +0100
changeset 88931 7b590e1e392cc2ac40682a65124a8e3fb2bc77ab
parent 88930 f5171db26f48e6cd28cb2ea7192e97bdeb7c64ad
child 88932 bd9a2f904e1f20b3972c61b2c1d57fc7472f29b4
push id22233
push usermak77@bonardo.net
push dateTue, 13 Mar 2012 13:50:06 +0000
treeherdermozilla-central@d87ad51531b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs716544
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 716544 - Fix comparison between signed and unsigned integer expressions in nsStringAPI.h. r=dbaron
xpcom/glue/nsStringAPI.h
--- a/xpcom/glue/nsStringAPI.h
+++ b/xpcom/glue/nsStringAPI.h
@@ -1317,17 +1317,17 @@ inline const nsDependentSubstring
 Substring( const nsAString& str, PRUint32 startPos, PRUint32 length )
 {
   return nsDependentSubstring(str, startPos, length);
 }
 
 inline const nsDependentSubstring
 Substring( const PRUnichar* start, const PRUnichar* end )
 {
-  NS_ABORT_IF_FALSE(PRUint32(end - start) == end - start, "string too long");
+  NS_ABORT_IF_FALSE(PRUint32(end - start) == uintptr_t(end - start), "string too long");
   return nsDependentSubstring(start, PRUint32(end - start));
 }
 
 inline const nsDependentSubstring
 Substring( const PRUnichar* start, PRUint32 length )
 {
   return nsDependentSubstring(start, length);
 }
@@ -1356,17 +1356,17 @@ Substring( const nsACString& str, PRUint
 {
   return nsDependentCSubstring(str, startPos, length);
 }
 
 inline
 const nsDependentCSubstring
 Substring( const char* start, const char* end )
 {
-  NS_ABORT_IF_FALSE(PRUint32(end - start) == end - start, "string too long");
+  NS_ABORT_IF_FALSE(PRUint32(end - start) == uintptr_t(end - start), "string too long");
   return nsDependentCSubstring(start, PRUint32(end - start));
 }
 
 inline
 const nsDependentCSubstring
 Substring( const char* start, PRUint32 length )
 {
   return nsDependentCSubstring(start, length);