mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
Bug 712939 - Part 6: Replace JS_STATIC_ASSERT in js/src/*. r=jwalden
Depends on D62277 Differential Revision: https://phabricator.services.mozilla.com/D62278 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e1cc9ae36b
commit
0bcaa98062
@ -32,7 +32,7 @@ const size_t TestSize = 10000;
|
||||
const size_t TestIterations = 10;
|
||||
#endif
|
||||
|
||||
JS_STATIC_ASSERT(TestSize <= 0x0000FFFF / 2);
|
||||
static_assert(TestSize <= 0x0000FFFF / 2);
|
||||
|
||||
struct LowToHigh {
|
||||
static uint32_t rekey(uint32_t initial) {
|
||||
|
@ -130,8 +130,8 @@ static UniquePtr<T> CopyErrorHelper(JSContext* cx, T* report) {
|
||||
* Such layout together with the properties enforced by the following
|
||||
* asserts does not need any extra alignment padding.
|
||||
*/
|
||||
JS_STATIC_ASSERT(sizeof(T) % sizeof(const char*) == 0);
|
||||
JS_STATIC_ASSERT(sizeof(const char*) % sizeof(char16_t) == 0);
|
||||
static_assert(sizeof(T) % sizeof(const char*) == 0);
|
||||
static_assert(sizeof(const char*) % sizeof(char16_t) == 0);
|
||||
|
||||
size_t filenameSize = report->filename ? strlen(report->filename) + 1 : 0;
|
||||
size_t messageSize = 0;
|
||||
|
@ -2262,7 +2262,7 @@ static MOZ_ALWAYS_INLINE JSAtom* JSID_TO_ATOM(jsid id) {
|
||||
return (JSAtom*)JSID_TO_STRING(id);
|
||||
}
|
||||
|
||||
JS_STATIC_ASSERT(sizeof(jsid) == sizeof(void*));
|
||||
static_assert(sizeof(jsid) == sizeof(void*));
|
||||
|
||||
namespace js {
|
||||
|
||||
|
@ -42,7 +42,7 @@ void* js::GetNativeStackBaseImpl() {
|
||||
|
||||
#elif defined(SOLARIS)
|
||||
|
||||
JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0);
|
||||
static_assert(JS_STACK_GROWTH_DIRECTION < 0);
|
||||
|
||||
void* js::GetNativeStackBaseImpl() {
|
||||
stack_t st;
|
||||
@ -52,7 +52,7 @@ void* js::GetNativeStackBaseImpl() {
|
||||
|
||||
#elif defined(AIX)
|
||||
|
||||
JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0);
|
||||
static_assert(JS_STACK_GROWTH_DIRECTION < 0);
|
||||
|
||||
void* js::GetNativeStackBaseImpl() {
|
||||
ucontext_t context;
|
||||
|
@ -112,10 +112,10 @@ JSLinearString* JSStringBuilder::finishString() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JS_STATIC_ASSERT(JSFatInlineString::MAX_LENGTH_TWO_BYTE <
|
||||
TwoByteCharBuffer::InlineLength);
|
||||
JS_STATIC_ASSERT(JSFatInlineString::MAX_LENGTH_LATIN1 <
|
||||
Latin1CharBuffer::InlineLength);
|
||||
static_assert(JSFatInlineString::MAX_LENGTH_TWO_BYTE <
|
||||
TwoByteCharBuffer::InlineLength);
|
||||
static_assert(JSFatInlineString::MAX_LENGTH_LATIN1 <
|
||||
Latin1CharBuffer::InlineLength);
|
||||
|
||||
return isLatin1() ? finishStringInternal<Latin1Char>(cx_)
|
||||
: finishStringInternal<char16_t>(cx_);
|
||||
|
Loading…
Reference in New Issue
Block a user