Bug 1061253 - Fix more bad implicit constructors in widget; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Sep 2014 09:46:06 -0400
changeset 202986 3251a4a4135b40907613ff9bfce0c3359933bdb8
parent 202985 f8fb5a1f20d32cf9bccea7b703c69224d11fc62a
child 202987 63e2bfe378e3546b43108b5b43cac402f3016dda
push id48543
push usereakhgari@mozilla.com
push dateTue, 02 Sep 2014 13:47:01 +0000
treeherdermozilla-inbound@63e2bfe378e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1061253
milestone34.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 1061253 - Fix more bad implicit constructors in widget; r=roc
widget/gtk/nsGtkIMModule.h
widget/gtk/nsGtkKeyUtils.h
widget/gtk/nsSound.cpp
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsGtkIMModule.h
+++ b/widget/gtk/nsGtkIMModule.h
@@ -49,17 +49,17 @@ public:
 
 protected:
     nsAutoRefCnt mRefCnt;
 
 public:
     // aOwnerWindow is a pointer of the owner window.  When aOwnerWindow is
     // destroyed, the related IME contexts are released (i.e., IME cannot be
     // used with the instance after that).
-    nsGtkIMModule(nsWindow* aOwnerWindow);
+    explicit nsGtkIMModule(nsWindow* aOwnerWindow);
     ~nsGtkIMModule();
 
     // "Enabled" means the users can use all IMEs.
     // I.e., the focus is in the normal editors.
     bool IsEnabled();
 
     // OnFocusWindow is a notification that aWindow is going to be focused.
     void OnFocusWindow(nsWindow* aWindow);
--- a/widget/gtk/nsGtkKeyUtils.h
+++ b/widget/gtk/nsGtkKeyUtils.h
@@ -152,17 +152,17 @@ protected:
 
     /**
      * mModifierKeys stores each hardware key information.
      */
     struct ModifierKey {
         guint mHardwareKeycode;
         guint mMask;
 
-        ModifierKey(guint aHardwareKeycode) :
+        explicit ModifierKey(guint aHardwareKeycode) :
           mHardwareKeycode(aHardwareKeycode), mMask(0)
         {
         }
     };
     nsTArray<ModifierKey> mModifierKeys;
 
     /**
      * GetModifierKey() returns modifier key information of the hardware
--- a/widget/gtk/nsSound.cpp
+++ b/widget/gtk/nsSound.cpp
@@ -64,17 +64,17 @@ static ca_context_destroy_fn ca_context_
 static ca_context_play_fn ca_context_play;
 static ca_context_change_props_fn ca_context_change_props;
 static ca_proplist_create_fn ca_proplist_create;
 static ca_proplist_destroy_fn ca_proplist_destroy;
 static ca_proplist_sets_fn ca_proplist_sets;
 static ca_context_play_full_fn ca_context_play_full;
 
 struct ScopedCanberraFile {
-    ScopedCanberraFile(nsIFile *file): mFile(file) {};
+    explicit ScopedCanberraFile(nsIFile *file): mFile(file) {};
 
     ~ScopedCanberraFile() {
         if (mFile) {
             mFile->Remove(false);
         }
     }
 
     void forget() {
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -289,17 +289,17 @@ static guint gButtonState;
 // nsAutoRef<pixman_region32> uses nsSimpleRef<> to know how to automatically
 // destroy regions.
 template <>
 class nsSimpleRef<pixman_region32> : public pixman_region32 {
 protected:
     typedef pixman_region32 RawRef;
 
     nsSimpleRef() { data = nullptr; }
-    nsSimpleRef(const RawRef &aRawRef) : pixman_region32(aRawRef) { }
+    explicit nsSimpleRef(const RawRef &aRawRef) : pixman_region32(aRawRef) { }
 
     static void Release(pixman_region32& region) {
         pixman_region32_fini(&region);
     }
     // Whether this needs to be released:
     bool HaveResource() const { return data != nullptr; }
 
     pixman_region32& get() { return *this; }