Bug 1379826 - Use static_cast instead of a C style cast in APZ keyboard logs. r?botond draft
authorRyan Hunt <rhunt@eqrion.net>
Mon, 10 Jul 2017 18:39:04 -0400
changeset 606357 27b732010358ac39ba3f5675ad6ee6c590ae6da5
parent 606124 91c943f7373722ad4e122d98a2ddd6c79708b732
child 636756 e98e10600da97a9bd015469138d63389ac479812
push id67689
push userbmo:rhunt@eqrion.net
push dateMon, 10 Jul 2017 22:39:19 +0000
reviewersbotond
bugs1379826
milestone56.0a1
Bug 1379826 - Use static_cast instead of a C style cast in APZ keyboard logs. r?botond MozReview-Commit-ID: 4ca18ZxQwuL
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/FocusState.cpp
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -185,21 +185,21 @@ public:
   void MarkAsNonFocusChanging() { mMayChangeFocus = false; }
 
   ~AutoFocusSequenceNumberSetter()
   {
     if (mMayChangeFocus) {
       mFocusState.ReceiveFocusChangingEvent();
 
       APZ_KEY_LOG("Marking input with type=%d as focus changing with seq=%" PRIu64 "\n",
-                  (int)mEvent.mInputType,
+                  static_cast<int>(mEvent.mInputType),
                   mFocusState.LastAPZProcessedEvent());
     } else {
       APZ_KEY_LOG("Marking input with type=%d as non focus changing with seq=%" PRIu64 "\n",
-                  (int)mEvent.mInputType,
+                  static_cast<int>(mEvent.mInputType),
                   mFocusState.LastAPZProcessedEvent());
     }
 
     mEvent.mFocusSequenceNumber = mFocusState.LastAPZProcessedEvent();
   }
 
 private:
   FocusState& mFocusState;
--- a/gfx/layers/apz/src/FocusState.cpp
+++ b/gfx/layers/apz/src/FocusState.cpp
@@ -41,17 +41,17 @@ FocusState::ReceiveFocusChangingEvent()
 void
 FocusState::Update(uint64_t aRootLayerTreeId,
                    uint64_t aOriginatingLayersId,
                    const FocusTarget& aState)
 {
   FS_LOG("Update with rlt=%" PRIu64 ", olt=%" PRIu64 ", ft=(%d, %" PRIu64 ")\n",
          aRootLayerTreeId,
          aOriginatingLayersId,
-         (int)aState.mType,
+         static_cast<int>(intaState.mType),
          aState.mSequenceNumber);
 
   // Update the focus tree with the latest target
   mFocusTree[aOriginatingLayersId] = aState;
 
   // Reset our internal state so we can recalculate it
   mFocusHasKeyEventListeners = false;
   mFocusLayersId = aRootLayerTreeId;