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
parent 5d94ac13f5
commit c28f7f825d
2 changed files with 4 additions and 4 deletions

View File

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

View File

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