1 # HG changeset patch
2 # User Ehsan Akhgari <ehsan@mozilla.com>
3 # Date 1308340787 14400
4 # Node ID c0e8643e8e60d1c98bff30c78e034f991f75c191
5 # Parent  284ebc48b2cb8e35dc04482ede700e717d8d214f
6 Bug 662962 - Silence the clang warnings issued because of alignment requirements increase when compiling jsscript.h; r=Waldo
7 
8 --- deps/mozilla/js/src/jsscript.h.orig	2011-03-31 19:08:36 UTC
9 +++ deps/mozilla/js/src/jsscript.h
10 @@ -496,32 +496,32 @@
11 
12      JSObjectArray *objects() {
13          JS_ASSERT(isValidOffset(objectsOffset));
14 -        return (JSObjectArray *)((uint8 *) (this + 1) + objectsOffset);
15 +        return reinterpret_cast<JSObjectArray *>(uintptr_t(this + 1) + objectsOffset);
16      }
17 
18      JSUpvarArray *upvars() {
19          JS_ASSERT(isValidOffset(upvarsOffset));
20 -        return (JSUpvarArray *) ((uint8 *) (this + 1) + upvarsOffset);
21 +        return reinterpret_cast<JSUpvarArray *>(uintptr_t(this + 1) + upvarsOffset);
22      }
23 
24      JSObjectArray *regexps() {
25          JS_ASSERT(isValidOffset(regexpsOffset));
26 -        return (JSObjectArray *) ((uint8 *) (this + 1) + regexpsOffset);
27 +        return reinterpret_cast<JSObjectArray *>(uintptr_t(this + 1) + regexpsOffset);
28      }
29 
30      JSTryNoteArray *trynotes() {
31          JS_ASSERT(isValidOffset(trynotesOffset));
32 -        return (JSTryNoteArray *) ((uint8 *) (this + 1) + trynotesOffset);
33 +        return reinterpret_cast<JSTryNoteArray *>(uintptr_t(this + 1) + trynotesOffset);
34      }
35 
36      js::GlobalSlotArray *globals() {
37          JS_ASSERT(isValidOffset(globalsOffset));
38 -        return (js::GlobalSlotArray *) ((uint8 *) (this + 1) + globalsOffset);
39 +        return reinterpret_cast<js::GlobalSlotArray *>(uintptr_t(this + 1) + globalsOffset);
40      }
41 
42      JSConstArray *consts() {
43          JS_ASSERT(isValidOffset(constOffset));
44 -        return (JSConstArray *) ((uint8 *) (this + 1) + constOffset);
45 +        return reinterpret_cast<JSConstArray *>(uintptr_t(this + 1) + constOffset);
46      }
47 
48      JSAtom *getAtom(size_t index) {
49