Bug 1384719 - Fix -Wnull-conversion warning in nsStyleContext::CalcStyleDifference(). r=heycam
authorBotond Ballo <botond@mozilla.com>
Wed, 26 Jul 2017 16:53:25 -0400
changeset 420358 fcae3602b0c39c00ed550e2339363dab8b7c2052
parent 420357 174e8648aae9512af99bd5094eb5ccaac2a1da6a
child 420359 49555e689cc8b55c56d413c88ffbe6a4d0e610fd
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1384719
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -348,17 +348,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;                                                  \
       }                                                                 \
     }