Bug 662964 - Silence the clang warnings issued because of alignment requirements increase when compiling jscntxt.h; r=Waldo
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 17 Jun 2011 15:59:47 -0400
changeset 71394 3167cf2cde1c30087a64a85a5bee5615889ca7a2
parent 71393 c0e8643e8e60d1c98bff30c78e034f991f75c191
child 71395 f25adc3d6d6561dc4bee4f9b0edd966fd9858427
push idunknown
push userunknown
push dateunknown
reviewersWaldo
bugs662964
milestone7.0a1
Bug 662964 - Silence the clang warnings issued because of alignment requirements increase when compiling jscntxt.h; r=Waldo
js/src/jscntxt.h
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -2282,17 +2282,17 @@ js_NewContext(JSRuntime *rt, size_t stac
 
 extern void
 js_DestroyContext(JSContext *cx, JSDestroyContextMode mode);
 
 static JS_INLINE JSContext *
 js_ContextFromLinkField(JSCList *link)
 {
     JS_ASSERT(link);
-    return (JSContext *) ((uint8 *) link - offsetof(JSContext, link));
+    return reinterpret_cast<JSContext *>(uintptr_t(link) - offsetof(JSContext, link));
 }
 
 /*
  * If unlocked, acquire and release rt->gcLock around *iterp update; otherwise
  * the caller must be holding rt->gcLock.
  */
 extern JSContext *
 js_ContextIterator(JSRuntime *rt, JSBool unlocked, JSContext **iterp);