Bug 1384719 - Fix -Wnull-conversion warning in nsStyleContext::CalcStyleDifference(). r=heycam draft
authorBotond Ballo <botond@mozilla.com>
Wed, 26 Jul 2017 16:53:25 -0400
changeset 617514 7ef60d0fd895eb1604aa11b1c41f7b21586d637d
parent 614544 462d7561089c98e33382384896434861ad7bc491
child 617673 efee596c4ff6713667d7c6ca5de8446cbcaff9d2
push id71068
push userbballo@mozilla.com
push dateFri, 28 Jul 2017 15:19:50 +0000
reviewersheycam
bugs1384719
milestone56.0a1
Bug 1384719 - Fix -Wnull-conversion warning in nsStyleContext::CalcStyleDifference(). r=heycam MozReview-Commit-ID: FBYcQ2fbIFo
layout/style/nsStyleContext.cpp
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -349,17 +349,17 @@ nsStyleContext::CalcStyleDifference(nsSt
 
     // NB: Calling Peek on |this|, not |thisVis|, since callers may look
     // at a struct on |this| without looking at the same struct on
     // |thisVis| (including this function if we skip one of these checks
     // due to change being true already or due to the old style context
     // not having a style-if-visited), but not the other way around.
 #define STYLE_FIELD(name_) thisVisStruct->name_ != otherVisStruct->name_
 #define STYLE_STRUCT(name_, fields_)                                    \
-    if (!change && PEEK(name_)) {                                       \
+    if (!change && (PEEK(name_) != nullptr)) {                          \
       const nsStyle##name_* thisVisStruct =                             \
         thisVis->ThreadsafeStyle##name_();                              \
       const nsStyle##name_* otherVisStruct =                            \
         otherVis->ThreadsafeStyle##name_();                             \
       if (MOZ_FOR_EACH_SEPARATED(STYLE_FIELD, (||), (), fields_)) {     \
         change = true;                                                  \
       }                                                                 \
     }