Bug 716544 - Fix comparison between signed and unsigned integer expressions in nsStringAPI.h. r=dbaron
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 13 Mar 2012 09:47:02 +0100
changeset 92687 cbc1ba56dbde9275fbba50bac5f97f25186743d4
parent 92686 012028b5efd928bd2f642fa8c22e1b447fddc5bc
child 92688 10123c7f98e93b497ec211419c991967c91cd561
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs716544
milestone14.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);