Bug 781058 - Part c: Fix -Werror=int-to-pointer-cast in nsDOMClassInfo; r=mounir
authorMs2ger <ms2ger@gmail.com>
Thu, 09 Aug 2012 09:20:29 +0200
changeset 101944 3199bc043da4f3c556c8a12de2c78858a9c98954
parent 101943 2a19a83e94c81372b7d1f4a797bf30cf53a6ea48
child 101945 9249f0c9ca93f2f51bf7559a19725a8469f28ae0
push id13237
push useremorley@mozilla.com
push dateThu, 09 Aug 2012 11:51:38 +0000
treeherdermozilla-inbound@f799dd180292 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs781058
milestone17.0a1
first release with
nightly linux32
3199bc043da4 / 17.0a1 / 20120809030541 / files
nightly linux64
3199bc043da4 / 17.0a1 / 20120809030541 / files
nightly mac
3199bc043da4 / 17.0a1 / 20120809030541 / files
nightly win32
3199bc043da4 / 17.0a1 / 20120809030541 / files
nightly win64
3199bc043da4 / 17.0a1 / 20120809030541 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 781058 - Part c: Fix -Werror=int-to-pointer-cast in nsDOMClassInfo; r=mounir
dom/base/nsDOMClassInfo.cpp
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -8996,25 +8996,26 @@ GetDocumentAllHelper(JSObject *obj)
   }
 
   return obj;
 }
 
 static inline void *
 FlagsToPrivate(PRUint32 flags)
 {
-  JS_ASSERT((flags & (1 << 31)) == 0);
-  return (void *)(flags << 1);
+  MOZ_ASSERT((flags & (1 << 31)) == 0);
+  return reinterpret_cast<void*>(static_cast<uintptr_t>(flags << 1));
 }
 
 static inline PRUint32
 PrivateToFlags(void *priv)
 {
-  JS_ASSERT(size_t(priv) <= PR_UINT32_MAX && (size_t(priv) & 1) == 0);
-  return (PRUint32)(size_t(priv) >> 1);
+  uintptr_t intPriv = reinterpret_cast<uintptr_t>(priv);
+  MOZ_ASSERT(intPriv <= PR_UINT32_MAX && (intPriv & 1) == 0);
+  return static_cast<PRUint32>(intPriv >> 1);
 }
 
 JSBool
 nsHTMLDocumentSH::DocumentAllHelperGetProperty(JSContext *cx, JSHandleObject obj,
                                                JSHandleId id, JSMutableHandleValue vp)
 {
   if (nsDOMClassInfo::sAll_id != id) {
     return JS_TRUE;