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:
André Bargull 2020-02-10 20:35:07 +00:00
parent e1cc9ae36b
commit 0bcaa98062
5 changed files with 10 additions and 10 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -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 {

View File

@ -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;

View File

@ -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_);