Bug 1342330 Part 2 - Convert uint32_t to bool in nsLineBox::FlagBits. r?xidorn draft
authorTing-Yu Lin <tlin@mozilla.com>
Fri, 24 Feb 2017 15:19:45 +0800
changeset 489005 833ea2cab3bb420b5632a3f52444a9234819933b
parent 489004 c8edac77ba36bd72e8797c6badd8e2dfea81ef1c
child 489006 e68ded30a51a77b9d891b6d2571c6067bde00267
child 489070 098f3137507640a179b943ad90657f0c3452d8dc
push id46726
push userbmo:tlin@mozilla.com
push dateFri, 24 Feb 2017 07:43:17 +0000
reviewersxidorn
bugs1342330
milestone54.0a1
Bug 1342330 Part 2 - Convert uint32_t to bool in nsLineBox::FlagBits. r?xidorn They're all one bit flags, so we should use bool. MozReview-Commit-ID: 5twqu3SIXKl
layout/generic/nsLineBox.h
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -218,17 +218,17 @@ public:
                                   nsIFrame* aFrame, int32_t aCount);
   void Destroy(nsIPresShell* aPresShell);
 
   // mBlock bit
   bool IsBlock() const {
     return mFlags.mBlock;
   }
   bool IsInline() const {
-    return 0 == mFlags.mBlock;
+    return !mFlags.mBlock;
   }
 
   // mDirty bit
   void MarkDirty() {
     mFlags.mDirty = 1;
   }
   void ClearDirty() {
     mFlags.mDirty = 0;
@@ -652,35 +652,35 @@ public:
 
   // mFlags.mHasHashedFrames says which one to use
   union {
     nsTHashtable< nsPtrHashKey<nsIFrame> >* mFrames;
     uint32_t mChildCount;
   };
 
   struct FlagBits {
-    uint32_t mDirty : 1;
-    uint32_t mPreviousMarginDirty : 1;
-    uint32_t mHasClearance : 1;
-    uint32_t mBlock : 1;
-    uint32_t mImpactedByFloat : 1;
-    uint32_t mLineWrapped: 1;
-    uint32_t mInvalidateTextRuns : 1;
+    bool mDirty : 1;
+    bool mPreviousMarginDirty : 1;
+    bool mHasClearance : 1;
+    bool mBlock : 1;
+    bool mImpactedByFloat : 1;
+    bool mLineWrapped: 1;
+    bool mInvalidateTextRuns : 1;
     // default 0 = means that the opt potentially applies to this line.
     // 1 = never skip reflowing this line for a resize reflow
-    uint32_t mResizeReflowOptimizationDisabled: 1;
-    uint32_t mEmptyCacheValid: 1;
-    uint32_t mEmptyCacheState: 1;
+    bool mResizeReflowOptimizationDisabled: 1;
+    bool mEmptyCacheValid: 1;
+    bool mEmptyCacheState: 1;
     // mHasBullet indicates that this is an inline line whose block's
     // bullet is adjacent to this line and non-empty.
-    uint32_t mHasBullet : 1;
+    bool mHasBullet : 1;
     // Indicates that this line *may* have a placeholder for a float
     // that was pushed to a later column or page.
-    uint32_t mHadFloatPushed : 1;
-    uint32_t mHasHashedFrames: 1;
+    bool mHadFloatPushed : 1;
+    bool mHasHashedFrames: 1;
     uint32_t mBreakType : 4;
   };
 
   struct ExtraData {
     explicit ExtraData(const nsRect& aBounds) : mOverflowAreas(aBounds, aBounds) {
     }
     nsOverflowAreas mOverflowAreas;
   };