Bug 1048240 - Fix more bad implicit constructors in accessible; r=tbsaunde
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 05 Aug 2014 17:57:52 -0400
changeset 198060 cbfe7963a7a5f3905f03edfccd08eb4df0e5e495
parent 198059 2af2a0050c300bbb82d06135b485b6b7d29ef789
child 198061 5405cd1684fd9629833c4aa3d867c7fbeaf24c93
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewerstbsaunde
bugs1048240
milestone34.0a1
Bug 1048240 - Fix more bad implicit constructors in accessible; r=tbsaunde
accessible/base/AccEvent.h
accessible/generic/Accessible.h
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -286,17 +286,17 @@ public:
 
 
 /**
  * Class for reorder accessible event. Takes care about
  */
 class AccReorderEvent : public AccEvent
 {
 public:
-  AccReorderEvent(Accessible* aTarget) :
+  explicit AccReorderEvent(Accessible* aTarget) :
     AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget,
              eAutoDetect, eCoalesceReorder) { }
   virtual ~AccReorderEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eReorderEvent;
   virtual unsigned int GetEventGroups() const
   {
@@ -494,17 +494,17 @@ private:
 };
 
 /**
  * Downcast the generic accessible event object to derived type.
  */
 class downcast_accEvent
 {
 public:
-  downcast_accEvent(AccEvent* e) : mRawPtr(e) { }
+  explicit downcast_accEvent(AccEvent* e) : mRawPtr(e) { }
 
   template<class Destination>
   operator Destination*() {
     if (!mRawPtr)
       return nullptr;
 
     return mRawPtr->GetEventGroups() & (1U << Destination::kEventGroup) ?
       static_cast<Destination*>(mRawPtr) : nullptr;
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -91,17 +91,17 @@ struct GroupPos
 };
 
 /**
  * An index type. Assert if out of range value was attempted to be used.
  */
 class index_t
 {
 public:
-  index_t(int32_t aVal) : mVal(aVal) {}
+  MOZ_IMPLICIT index_t(int32_t aVal) : mVal(aVal) {}
 
   operator uint32_t() const
   {
     MOZ_ASSERT(mVal >= 0, "Attempt to use wrong index!");
     return mVal;
   }
 
   bool IsValid() const { return mVal >= 0; }