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 90126 7b590e1e392cc2ac40682a65124a8e3fb2bc77ab
parent 90125 f5171db26f48e6cd28cb2ea7192e97bdeb7c64ad
child 90127 bd9a2f904e1f20b3972c61b2c1d57fc7472f29b4
push idunknown
push userunknown
push dateunknown
reviewersdbaron
bugs716544
milestone13.0a1
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);