Bug 1048241 - Fix more bad implicit constructors in widget; r=roc
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -239,17 +239,17 @@ struct nsIMEUpdatePreference {
NOTIFY_CHANGES_CAUSED_BY_COMPOSITION
};
nsIMEUpdatePreference()
: mWantUpdates(DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES)
{
}
- nsIMEUpdatePreference(Notifications aWantUpdates)
+ explicit nsIMEUpdatePreference(Notifications aWantUpdates)
: mWantUpdates(aWantUpdates | DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES)
{
}
void DontNotifyChangesCausedByComposition()
{
mWantUpdates &= ~DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES;
}
@@ -364,17 +364,17 @@ struct IMEState {
* Web contents can specify this value by |ime-mode: inactive;|.
*/
CLOSED
};
Open mOpen;
IMEState() : mEnabled(ENABLED), mOpen(DONT_CHANGE_OPEN_STATE) { }
- IMEState(Enabled aEnabled, Open aOpen = DONT_CHANGE_OPEN_STATE) :
+ explicit IMEState(Enabled aEnabled, Open aOpen = DONT_CHANGE_OPEN_STATE) :
mEnabled(aEnabled), mOpen(aOpen)
{
}
};
struct InputContext {
InputContext() : mNativeIMEContext(nullptr) {}
@@ -447,18 +447,18 @@ struct InputContextAction {
mCause == CAUSE_MOUSE);
}
InputContextAction() :
mCause(CAUSE_UNKNOWN), mFocusChange(FOCUS_NOT_CHANGED)
{
}
- InputContextAction(Cause aCause,
- FocusChange aFocusChange = FOCUS_NOT_CHANGED) :
+ explicit InputContextAction(Cause aCause,
+ FocusChange aFocusChange = FOCUS_NOT_CHANGED) :
mCause(aCause), mFocusChange(aFocusChange)
{
}
};
/**
* Size constraints for setting the minimum and maximum size of a widget.
* Values are in device pixels.
@@ -505,17 +505,17 @@ enum IMEMessage MOZ_ENUM_TYPE(int8_t)
REQUEST_TO_COMMIT_COMPOSITION,
// Request to cancel current composition to IME
// (some platforms may not support)
REQUEST_TO_CANCEL_COMPOSITION
};
struct IMENotification
{
- IMENotification(IMEMessage aMessage)
+ MOZ_IMPLICIT IMENotification(IMEMessage aMessage)
: mMessage(aMessage)
{
switch (aMessage) {
case NOTIFY_IME_OF_SELECTION_CHANGE:
mSelectionChangeData.mCausedByComposition = false;
break;
case NOTIFY_IME_OF_TEXT_CHANGE:
mTextChangeData.mStartOffset = 0;
--- a/widget/xpwidgets/GfxInfoCollector.h
+++ b/widget/xpwidgets/GfxInfoCollector.h
@@ -24,17 +24,17 @@ class MOZ_STACK_CLASS InfoObject
public:
void DefineProperty(const char *name, int value);
void DefineProperty(const char *name, nsAString &value);
void DefineProperty(const char *name, const char *value);
private:
// We need to ensure that this object lives on the stack so that GC sees it properly
- InfoObject(JSContext *aCx);
+ explicit InfoObject(JSContext *aCx);
InfoObject(InfoObject&);
JSContext *mCx;
JS::Rooted<JSObject*> mObj;
bool mOk;
};
/*