Closed Bug 855850 Opened 12 years ago Closed 12 years ago

Use MOZ_STATIC_ASSERT and fix typo in "need to rearrange the mBits bitfield" compile-time error-check

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: dholbert, Assigned: dholbert)

Details

Attachments

(1 file)

nsLineBox.h currently has the following code: 149 #if NS_STYLE_CLEAR_LAST_VALUE > 15 150 need to rearrange the mBits bitfield; 151 #endif https://mxr.mozilla.org/mozilla-central/source/layout/generic/nsLineBox.h#149 which apparently is intended to break the build if NS_STYLE_CLEAR_LAST_VALUE is larger than 15 (larger than what we can represent with 4 bits). There is, however, no "mBits bitfield" (and never was). We mean to say "mFlags", which is of type FlagBits (and which contains the 4 bits to store our "clear" value). And while we're fixing that, we might as well make this a MOZ_STATIC_ASSERT.
(In reply to Daniel Holbert [:dholbert] from comment #0) > There is, however, no "mBits bitfield" (and never was). (for reference: the CVS commit that added this line was: http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/layout/generic&command=DIFF_FRAMESET&file=nsLineBox.h&rev2=1.20&rev1=1.19 and even at that point, the bitfield in question was FlagBits mFlags -- there was no no mBits.)
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attached patch fixSplinter Review
This moves the check to be a static assert in the nsLineBox constructor. (This is a sensible location for the assertion, since we're asserting about a member-var of nsLineBox)
Attachment #730901 - Flags: review?(matspal)
Attachment #730901 - Flags: review?(matspal) → review+
Flags: in-testsuite-
OS: Linux → All
Hardware: x86_64 → All
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: