Bug 1406380 Fix -Wreorder warnings r=njn
authorTom Ritter <tom@mozilla.com>
Mon, 09 Oct 2017 01:36:36 -0500
changeset 385080 224eccf80d4732b148d9a3dbf83725dc2f347c24
parent 385079 daa2f3495ceef50fca612d0da44a86aa8b754e1f
child 385081 fc7159c2cd73feb90ccb224648882730748c379a
push id32646
push userarchaeopteryx@coole-files.de
push dateMon, 09 Oct 2017 21:47:29 +0000
treeherdermozilla-central@4afc55e7033c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1406380
milestone58.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 1406380 Fix -Wreorder warnings r=njn MozReview-Commit-ID: 7Zh2pvAMpXR
dom/gamepad/windows/WindowsGamepad.cpp
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginUtilsWin.cpp
gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp
widget/windows/PDFiumEngineShim.cpp
widget/windows/WindowsEMF.cpp
old mode 100644
new mode 100755
--- a/dom/gamepad/windows/WindowsGamepad.cpp
+++ b/dom/gamepad/windows/WindowsGamepad.cpp
@@ -134,38 +134,38 @@ public:
 
   // Used during rescan to find devices that were disconnected.
   bool present;
 
   Gamepad(uint32_t aNumAxes,
           uint32_t aNumButtons,
           bool aHasDpad,
           GamepadType aType) :
+    type(aType),
     numAxes(aNumAxes),
     numButtons(aNumButtons),
     hasDpad(aHasDpad),
-    type(aType),
     present(true)
   {
     buttons.SetLength(numButtons);
     axes.SetLength(numAxes);
   }
 private:
   Gamepad() {}
 };
 
 // Drop this in favor of decltype when we require a new enough SDK.
 typedef void (WINAPI *XInputEnable_func)(BOOL);
 
 // RAII class to wrap loading the XInput DLL
 class XInputLoader {
 public:
   XInputLoader() : module(nullptr),
-                   mXInputEnable(nullptr),
-                   mXInputGetState(nullptr) {
+                   mXInputGetState(nullptr),
+                   mXInputEnable(nullptr) {
     // xinput1_4.dll exists on Windows 8
     // xinput9_1_0.dll exists on Windows 7 and Vista
     // xinput1_3.dll shipped with the DirectX SDK
     const wchar_t* dlls[] = {L"xinput1_4.dll",
                              L"xinput9_1_0.dll",
                              L"xinput1_3.dll"};
     const size_t kNumDLLs = ArrayLength(dlls);
     for (size_t i = 0; i < kNumDLLs; ++i) {
@@ -275,24 +275,24 @@ SupportedUsage(USHORT page, USHORT usage
       return true;
     }
   }
   return false;
 }
 
 class HIDLoader {
 public:
-  HIDLoader() : mModule(LoadLibraryW(L"hid.dll")),
-                mHidD_GetProductString(nullptr),
+  HIDLoader() : mHidD_GetProductString(nullptr),
                 mHidP_GetCaps(nullptr),
                 mHidP_GetButtonCaps(nullptr),
                 mHidP_GetValueCaps(nullptr),
                 mHidP_GetUsages(nullptr),
                 mHidP_GetUsageValue(nullptr),
-                mHidP_GetScaledUsageValue(nullptr)
+                mHidP_GetScaledUsageValue(nullptr),
+                mModule(LoadLibraryW(L"hid.dll"))
   {
     if (mModule) {
       mHidD_GetProductString = reinterpret_cast<decltype(HidD_GetProductString)*>(GetProcAddress(mModule, "HidD_GetProductString"));
       mHidP_GetCaps = reinterpret_cast<decltype(HidP_GetCaps)*>(GetProcAddress(mModule, "HidP_GetCaps"));
       mHidP_GetButtonCaps = reinterpret_cast<decltype(HidP_GetButtonCaps)*>(GetProcAddress(mModule, "HidP_GetButtonCaps"));
       mHidP_GetValueCaps = reinterpret_cast<decltype(HidP_GetValueCaps)*>(GetProcAddress(mModule, "HidP_GetValueCaps"));
       mHidP_GetUsages = reinterpret_cast<decltype(HidP_GetUsages)*>(GetProcAddress(mModule, "HidP_GetUsages"));
       mHidP_GetUsageValue = reinterpret_cast<decltype(HidP_GetUsageValue)*>(GetProcAddress(mModule, "HidP_GetUsageValue"));
old mode 100644
new mode 100755
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -168,18 +168,18 @@ WMFVideoMFTManager::WMFVideoMFTManager(
   layers::KnowsCompositor* aKnowsCompositor,
   layers::ImageContainer* aImageContainer,
   float aFramerate,
   bool aDXVAEnabled)
   : mVideoInfo(aConfig)
   , mImageSize(aConfig.mImage)
   , mVideoStride(0)
   , mImageContainer(aImageContainer)
+  , mKnowsCompositor(aKnowsCompositor)
   , mDXVAEnabled(aDXVAEnabled)
-  , mKnowsCompositor(aKnowsCompositor)
   , mAMDVP9InUse(false)
   , mFramerate(aFramerate)
   // mVideoStride, mVideoWidth, mVideoHeight, mUseHwAccel are initialized in
   // Init().
 {
   MOZ_COUNT_CTOR(WMFVideoMFTManager);
 
   // Need additional checks/params to check vp8/vp9
old mode 100644
new mode 100755
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -1970,19 +1970,19 @@ class GetKeyStateTask : public Runnable
 {
     SHORT* mKeyState;
     int mVirtKey;
     HANDLE mSemaphore;
 
 public:
     explicit GetKeyStateTask(int aVirtKey, HANDLE aSemaphore, SHORT* aKeyState) :
         Runnable("GetKeyStateTask"),
+        mKeyState(aKeyState),
         mVirtKey(aVirtKey),
-        mSemaphore(aSemaphore),
-        mKeyState(aKeyState)
+        mSemaphore(aSemaphore)
     {}
 
     NS_IMETHOD Run() override
     {
         PLUGIN_LOG_DEBUG_METHOD;
         AssertPluginThread();
         *mKeyState = PMCGetKeyState(mVirtKey);
         if (!ReleaseSemaphore(mSemaphore, 1, nullptr)) {
@@ -2044,18 +2044,20 @@ class PluginThreadTask : public Runnable
 {
     bool mSuccess;
     PluginThreadTaskData* mTaskData;
     HANDLE mSemaphore;
 
 public:
     explicit PluginThreadTask(PluginThreadTaskData* aTaskData,
                               HANDLE aSemaphore) :
-        Runnable("PluginThreadTask"), mTaskData(aTaskData),
-        mSemaphore(aSemaphore), mSuccess(false)
+        Runnable("PluginThreadTask"),
+        mSuccess(false),
+        mTaskData(aTaskData),
+        mSemaphore(aSemaphore)
     {}
 
     NS_IMETHOD Run() override
     {
         PLUGIN_LOG_DEBUG_METHOD;
         AssertPluginThread();
         mSuccess = mTaskData->RunTask();
         if (!ReleaseSemaphore(mSemaphore, 1, nullptr)) {
--- a/dom/plugins/ipc/PluginUtilsWin.cpp
+++ b/dom/plugins/ipc/PluginUtilsWin.cpp
@@ -44,18 +44,18 @@ protected:
   NPAudioDeviceChangeDetailsIPC mChangeDetails;
   const PluginModuleSet* mAudioNotificationSet;
 };
 
 class AudioNotification final : public IMMNotificationClient
 {
 public:
   AudioNotification() :
-      mRefCt(1)
-    , mIsRegistered(false)
+      mIsRegistered(false)
+    , mRefCt(1)
   {
     HRESULT hr = CoCreateInstance(__uuidof(MMDeviceEnumerator),
                                   NULL, CLSCTX_INPROC_SERVER,
                                   IID_PPV_ARGS(&mDeviceEnum));
     if (FAILED(hr)) {
       mDeviceEnum = nullptr;
       return;
     }
old mode 100644
new mode 100755
--- a/gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp
+++ b/gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp
@@ -35,19 +35,19 @@ GetEGLTextureFormat(gfx::SurfaceFormat a
       return LOCAL_EGL_TEXTURE_RGBA;
   }
 }
 
 RenderDXGITextureHostOGL::RenderDXGITextureHostOGL(WindowsHandle aHandle,
                                                    gfx::SurfaceFormat aFormat,
                                                    gfx::IntSize aSize)
   : mHandle(aHandle)
-  , mTextureHandle{0}
   , mSurface(0)
   , mStream(0)
+  , mTextureHandle{0}
   , mFormat(aFormat)
   , mSize(aSize)
   , mLocked(false)
 {
   MOZ_COUNT_CTOR_INHERITED(RenderDXGITextureHostOGL, RenderTextureHostOGL);
   MOZ_ASSERT(mFormat != gfx::SurfaceFormat::NV12 ||
              (mSize.width % 2 == 0 && mSize.height % 2 == 0));
 }
old mode 100644
new mode 100755
--- a/widget/windows/PDFiumEngineShim.cpp
+++ b/widget/windows/PDFiumEngineShim.cpp
@@ -35,25 +35,25 @@ PDFiumEngineShim::GetInstanceOrNull(cons
   if (!shim->Init(aLibrary)) {
     return nullptr;
   }
 
   return shim.forget();
 }
 
 PDFiumEngineShim::PDFiumEngineShim()
-  : mFPDF_InitLibrary(nullptr)
+  : mInitialized(false)
+  , mFPDF_InitLibrary(nullptr)
   , mFPDF_DestroyLibrary(nullptr)
   , mFPDF_CloseDocument(nullptr)
   , mFPDF_GetPageCount(nullptr)
   , mFPDF_LoadPage(nullptr)
   , mFPDF_ClosePage(nullptr)
   , mFPDF_RenderPage(nullptr)
   , mPRLibrary(nullptr)
-  , mInitialized(false)
 {
 }
 
 PDFiumEngineShim::~PDFiumEngineShim()
 {
   if (mInitialized) {
     mFPDF_DestroyLibrary();
   }
old mode 100644
new mode 100755
--- a/widget/windows/WindowsEMF.cpp
+++ b/widget/windows/WindowsEMF.cpp
@@ -5,18 +5,18 @@
 
 #include "WindowsEMF.h"
 
 
 namespace mozilla {
 namespace widget {
 
 WindowsEMF::WindowsEMF()
-  : mDC(nullptr)
-  , mEmf(nullptr)
+  : mEmf(nullptr)
+  , mDC(nullptr)
 {
 }
 
 WindowsEMF::~WindowsEMF()
 {
   ReleaseAllResource();
 }