Bug 841295 - Metro widget should use uintptr_t for wParam and lParam. r=jimm
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Fri, 15 Feb 2013 13:37:38 +0900
changeset 131879 7c0ef5c0e554aeab48a4bc6891cbc9965732b9d5
parent 131878 a8bdef08967144e65fd86bbc76a8bed3b2754e41
child 131880 17579083472fc8e51f97007b128751d4f8b34b3f
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs841295
milestone21.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 841295 - Metro widget should use uintptr_t for wParam and lParam. r=jimm
widget/windows/winrt/MetroInput.cpp
--- a/widget/windows/winrt/MetroInput.cpp
+++ b/widget/windows/winrt/MetroInput.cpp
@@ -160,17 +160,17 @@ namespace {
   // `pluginEvent` member of our `nsInputEvent` to it.  We must set the
   // `wParam` and `lParam` members of our `NPEvent` according to what
   // Windows would have sent for this particular WM_* message.  See the
   // following documentation for descriptions of what these values should
   // be for the various keyboard events.
   //
   // This union is used when setting up the lParam for keyboard events.
   union LParamForKeyEvents {
-    LPARAM lParam;
+    uintptr_t lParam;
     struct {
       // bits 0-15    Repeat count, always 1 for WM_KEYUP
       uint16_t repeatCount;
       // bits 16-23   Scan code
       uint8_t scanCode;
       // See LParamFlagsForKeyEvents
       uint8_t flags;
     } parts;
@@ -192,17 +192,17 @@ namespace {
     //              Always 0 for WM_KEYDOWN
     //              Always 1 for WM_KEYUP
     isKeyReleased = 1<<7
   };
   // This helper function sets up the lParam for plugin events that we create
   // in response to keyboard events.
   void
   InitPluginKeyEventLParamFromKeyStatus(
-                      uint32_t& aLParam,
+                      uintptr_t& aLParam,
                       UI::Core::CorePhysicalKeyStatus const& aKeyStatus) {
     LParamForKeyEvents lParam;
 
     lParam.parts.repeatCount = aKeyStatus.RepeatCount;
     lParam.parts.scanCode = aKeyStatus.ScanCode;
     if (aKeyStatus.IsExtendedKey) {
       lParam.parts.flags |= LParamFlagsForKeyEvents::isExtendedKey;
     }
@@ -223,31 +223,31 @@ namespace {
   // `pluginEvent` member of our `nsInputEvent` to it.  We must set the
   // `wParam` and `lParam` members of our `NPEvent` according to what
   // Windows would have sent for this particular WM_* message.  See the
   // following documentation for descriptions of what these values should
   // be for the various mouse events.
   //
   // This union is used when setting up the lParam for mouse events.
   union LParamForMouseEvents {
-    LPARAM lParam;
+    uintptr_t lParam;
     // lParam is the position at which the event occurred.
     struct lParamDeconstruction {
       // The low-order word is the x-coordinate
       uint16_t x;
       // The high-order word is the y-coordinate
       uint16_t y;
     } parts;
   };
   // This helper function sets up the wParam and lParam for plugin events
   // that we create in response to mouse events.
   void
   InitPluginMouseEventParams(nsInputEvent const& aEvent,
-                             uint32_t& aWParam,
-                             uint32_t& aLParam) {
+                             uintptr_t& aWParam,
+                             uintptr_t& aLParam) {
     // wParam is a mask indicating whether certain virtual keys are down.
     aWParam = 0;
     if (IS_VK_DOWN(VK_LBUTTON)) {
       aWParam |= MK_LBUTTON;
     }
     if (IS_VK_DOWN(VK_MBUTTON)) {
       aWParam |= MK_MBUTTON;
     }
@@ -448,17 +448,17 @@ MetroInput::OnPointerWheelChanged(UI::Co
     wheelEvent.lineOrPageDeltaY = previousVertLeftOverDelta / WHEEL_DELTA;
     previousVertLeftOverDelta %= WHEEL_DELTA;
   }
 
   NPEvent pluginEvent;
   pluginEvent.event = horzEvent ? WM_MOUSEHWHEEL : WM_MOUSEWHEEL;
 
   union {
-    uint32_t wParam;
+    uintptr_t wParam;
     uint16_t parts[2];
   } wParam;
 
   // This sets lParam and the low-order word of wParam
   InitPluginMouseEventParams(wheelEvent,
                              wParam.wParam,
                              pluginEvent.lParam);