Bug 855850: Use MOZ_STATIC_ASSERT instead of #if, to verify that "break type" values are representable in 4 bits. r=mats

This commit is contained in:
Daniel Holbert 2013-03-28 16:27:31 -07:00
Родитель 5d94ac13f5
Коммит c28f7f825d
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -16,6 +16,7 @@
#include "nsBidiPresUtils.h"
#endif
#include "nsStyleStructInlines.h"
#include "mozilla/Assertions.h"
#include "mozilla/Likely.h"
#ifdef DEBUG
@ -43,6 +44,9 @@ nsLineBox::nsLineBox(nsIFrame* aFrame, int32_t aCount, bool aIsBlock)
}
#endif
MOZ_STATIC_ASSERT(NS_STYLE_CLEAR_LAST_VALUE <= 15,
"FlagBits needs more bits to store the full range of "
"break type ('clear') values");
#if NS_STYLE_CLEAR_NONE > 0
mFlags.mBreakType = NS_STYLE_CLEAR_NONE;
#endif

Просмотреть файл

@ -146,10 +146,6 @@ protected:
#define LINE_MAX_BREAK_TYPE ((1 << 4) - 1)
#define LINE_MAX_CHILD_COUNT INT32_MAX
#if NS_STYLE_CLEAR_LAST_VALUE > 15
need to rearrange the mBits bitfield;
#endif
/**
* Function to create a line box and initialize it with a single frame.
* The allocation is infallible.