зеркало из https://github.com/mozilla/pjs.git
Bug 674522 - Remove bad static assert; fix strict-aliasing warnings (rs=waldo)
--HG-- extra : rebase_source : bf6867ae067ecf83815792f14bf6e552885580b0
This commit is contained in:
Родитель
3c244f0e54
Коммит
b1e940ef5d
|
@ -317,6 +317,7 @@ typedef union jsval_layout
|
|||
} s;
|
||||
double asDouble;
|
||||
void *asPtr;
|
||||
jsuword asWord;
|
||||
} jsval_layout;
|
||||
# endif /* JS_BITS_PER_WORD */
|
||||
#else /* defined(IS_LITTLE_ENDIAN) */
|
||||
|
@ -358,6 +359,7 @@ typedef union jsval_layout
|
|||
} s;
|
||||
double asDouble;
|
||||
void *asPtr;
|
||||
jsuword asWord;
|
||||
} jsval_layout;
|
||||
# endif /* JS_BITS_PER_WORD */
|
||||
#endif /* defined(IS_LITTLE_ENDIAN) */
|
||||
|
|
|
@ -295,7 +295,6 @@ JSVAL_EXTRACT_NON_DOUBLE_TAG_IMPL(jsval_layout l)
|
|||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
JS_STATIC_ASSERT(offsetof(jsval_layout, s.payload) == 0);
|
||||
JS_STATIC_ASSERT((JSVAL_TYPE_NONFUNOBJ & 0xF) == JSVAL_TYPE_OBJECT);
|
||||
JS_STATIC_ASSERT((JSVAL_TYPE_FUNOBJ & 0xF) == JSVAL_TYPE_OBJECT);
|
||||
#endif
|
||||
|
@ -744,9 +743,9 @@ class Value
|
|||
|
||||
const jsuword *payloadWord() const {
|
||||
#if JS_BITS_PER_WORD == 32
|
||||
return reinterpret_cast<const jsuword *>(&data.s.payload.word);
|
||||
return &data.s.payload.word;
|
||||
#elif JS_BITS_PER_WORD == 64
|
||||
return reinterpret_cast<const jsuword *>(&data.asBits);
|
||||
return &data.asWord;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче