Add keyword 'explicit' to some constructors

This commit is contained in:
Markus Gans 2015-05-27 02:25:13 +02:00
parent 1ebd703f05
commit 7789ee4fba
25 changed files with 40 additions and 40 deletions

View File

@ -31,7 +31,7 @@ class FButton : public FWidget
friend class FDialog;
public:
FButton (FWidget* parent=0); // constructor
explicit FButton (FWidget* parent=0); // constructor
FButton (const FString&, FWidget* parent=0); // constructor
virtual ~FButton(); // destructor

View File

@ -38,7 +38,7 @@ class FButtonGroup : public FWidget
void drawLabel();
public:
FButtonGroup (FWidget* parent=0); // constructor
explicit FButtonGroup (FWidget* parent=0); // constructor
FButtonGroup (const FString&, FWidget* parent=0); // constructor
virtual ~FButtonGroup(); // destructor
const char* getClassName() const;

View File

@ -23,7 +23,7 @@ class FCheckBox : public FToggleButton
void drawCheckButton();
public:
FCheckBox (FWidget* parent=0); // constructor
explicit FCheckBox (FWidget* parent=0); // constructor
FCheckBox (const FString&, FWidget* parent=0); // constructor
virtual ~FCheckBox(); // destructor
const char* getClassName() const;

View File

@ -46,7 +46,7 @@ class FDialog : public FWindow
virtual void onClose (FCloseEvent*);
public:
FDialog (FWidget* parent=0); // constructor
explicit FDialog (FWidget* parent=0); // constructor
FDialog (const FString&, FWidget* parent=0); // constructor
virtual ~FDialog(); // destructor
virtual const char* getClassName() const;

View File

@ -40,7 +40,7 @@
class FEvent // event base class
{
public:
FEvent(int);
explicit FEvent(int);
~FEvent();
int type() const;
@ -190,7 +190,7 @@ enum FocusTypes
class FFocusEvent : public FEvent // focus event
{
public:
FFocusEvent (int);
explicit FFocusEvent (int);
bool gotFocus() const;
bool lostFocus() const;
FocusTypes getFocusType() const;
@ -239,7 +239,7 @@ class FAccelEvent : public FEvent // focus event
class FResizeEvent : public FEvent // resize event
{
public:
FResizeEvent (int);
explicit FResizeEvent (int);
bool isAccepted() const;
void accept();
void ignore();
@ -258,7 +258,7 @@ class FResizeEvent : public FEvent // resize event
class FShowEvent : public FEvent // show event
{
public:
FShowEvent (int);
explicit FShowEvent (int);
};
#define F_SHOW_EVENT(x) ((FShowEvent*)x)
@ -271,7 +271,7 @@ class FShowEvent : public FEvent // show event
class FHideEvent : public FEvent // hide event
{
public:
FHideEvent (int);
explicit FHideEvent (int);
};
#define F_HIDE_EVENT(x) ((FHideEvent*)x)
@ -284,7 +284,7 @@ class FHideEvent : public FEvent // hide event
class FCloseEvent : public FEvent // close event
{
public:
FCloseEvent(int);
explicit FCloseEvent(int);
bool isAccepted() const;
void accept();
void ignore();

View File

@ -83,7 +83,7 @@ class FFileDialog : public FDialog
void adjustSize();
public:
FFileDialog (FWidget* parent=0);
explicit FFileDialog (FWidget* parent=0);
FFileDialog (const FString&,
const FString&,
DialogType type = FFileDialog::Open,

View File

@ -39,7 +39,7 @@ class FLabel : public FWidget
void draw();
public:
FLabel (FWidget* parent=0); // constructor
explicit FLabel (FWidget* parent=0); // constructor
FLabel (const FString&, FWidget* parent=0); // constructor
virtual ~FLabel(); // destructor
const char* getClassName() const;

View File

@ -56,7 +56,7 @@ class FLineEdit : public FWidget
void adjustSize();
public:
FLineEdit (FWidget* parent=0); // constructor
explicit FLineEdit (FWidget* parent=0); // constructor
FLineEdit (const FString&, FWidget* parent=0); // constructor
virtual ~FLineEdit(); // destructor
const char* getClassName() const;

View File

@ -25,9 +25,9 @@ class FListBoxItem
bool selected;
public:
FListBoxItem ();
FListBoxItem (FString&);
FListBoxItem (const std::string&);
FListBoxItem (const char*);
explicit FListBoxItem (FString&);
explicit FListBoxItem (const std::string&);
explicit FListBoxItem (const char*);
virtual ~FListBoxItem();
virtual FString getText() const;
protected:
@ -111,7 +111,7 @@ class FListBox : public FWidget
void adjustSize();
public:
FListBox (FWidget* parent=0); // constructor
explicit FListBox (FWidget* parent=0); // constructor
~FListBox(); // destructor
const char* getClassName() const;

View File

@ -58,7 +58,7 @@ class FMessageBox : public FDialog
void cb_processClick (FWidget*, void*);
public:
FMessageBox (FWidget* parent=0);
explicit FMessageBox (FWidget* parent=0);
FMessageBox (const FString&, const FString&,
int, int, int,
FWidget* parent=0);

View File

@ -58,7 +58,7 @@ class FObject
friend class FApplication;
public:
FObject (FObject* parent=0);
explicit FObject (FObject* parent=0);
virtual ~FObject();
virtual const char* getClassName() const;

View File

@ -78,7 +78,7 @@ class FOptiMove
bool isWideMove (int, int, int, int);
public:
FOptiMove(int baud=0); // constructor
explicit FOptiMove(int baud=0); // constructor
~FOptiMove(); // destructor
void setBaudRate (int);

View File

@ -29,7 +29,7 @@ class FProgressbar : public FWidget
virtual void draw();
public:
FProgressbar(FWidget* parent=0); // constructor
explicit FProgressbar(FWidget* parent=0); // constructor
virtual ~FProgressbar();
const char* getClassName() const;

View File

@ -22,7 +22,7 @@ class FRadioButton : public FToggleButton
void drawRadioButton();
public:
FRadioButton (FWidget* parent=0); // constructor
explicit FRadioButton (FWidget* parent=0); // constructor
FRadioButton (const FString&, FWidget* parent=0); // constructor
virtual ~FRadioButton(); // destructor
const char* getClassName() const;

View File

@ -59,7 +59,7 @@ class FScrollbar : public FWidget
void processScroll();
public:
FScrollbar(FWidget* parent=0); // constructor
explicit FScrollbar(FWidget* parent=0); // constructor
FScrollbar(int o=fc::vertical, FWidget* parent=0); // constructor
virtual ~FScrollbar();
const char* getClassName() const;

View File

@ -33,7 +33,7 @@ class FStatusKey : public FWidget
void setStatusbar (FStatusBar*);
public:
FStatusKey (FWidget* parent=0);
explicit FStatusKey (FWidget* parent=0);
FStatusKey (int, FString&, FWidget* parent=0);
FStatusKey (int, const std::string&, FWidget* parent=0);
FStatusKey (int, const char*, FWidget* parent=0);
@ -133,7 +133,7 @@ class FStatusBar : public FWindow
void adjustSize();
public:
FStatusBar (FWidget* parent=0); // constructor
explicit FStatusBar (FWidget* parent=0); // constructor
virtual ~FStatusBar(); // destructor
virtual const char* getClassName() const;

View File

@ -753,7 +753,7 @@ const FString operator + (const std::string& s1, const FString& s2)
//----------------------------------------------------------------------
const FString operator + (const char* s1, const FString& s2)
{
FString tmp = s1;
FString tmp(s1);
tmp._insert ( tmp.getLength(),
uInt(wcslen(s2.wc_str())),
s2.wc_str() );
@ -763,7 +763,7 @@ const FString operator + (const char* s1, const FString& s2)
//----------------------------------------------------------------------
const FString operator + (const wchar_t c, const FString& s)
{
FString tmp = c;
FString tmp(c);
tmp._insert (1, uInt(wcslen(s.wc_str())), s.wc_str());
return (tmp);
}
@ -771,7 +771,7 @@ const FString operator + (const wchar_t c, const FString& s)
//----------------------------------------------------------------------
const FString operator + (const char c, const FString& s)
{
FString tmp = c;
FString tmp(c);
tmp._insert (1, uInt(wcslen(s.wc_str())), s.wc_str());
return (tmp);
}
@ -1832,7 +1832,7 @@ FString FString::expandTabs (uInt tabstop) const
{
uLong end;
FString instr(this->string);
FString outstr = "";
FString outstr("");
std::vector<FString> tab_split = instr.split("\t");
end = tab_split.size();

View File

@ -71,8 +71,8 @@ class FString
public:
FString (); // constructor
FString (int); // constructor
FString (uInt); // constructor
explicit FString (int); // constructor
explicit FString (uInt); // constructor
FString (int, wchar_t); // constructor
FString (uInt, wchar_t); // constructor
FString (int, char); // constructor
@ -83,7 +83,7 @@ class FString
FString (const std::string&); // constructor
FString (const char*); // constructor
FString (const wchar_t); // constructor
FString (const char); // constructor
explicit FString (const char); // constructor
virtual ~FString (); // destructor
bool isNull() const;

View File

@ -45,7 +45,7 @@ class FTextView : public FWidget
void adjustSize();
public:
FTextView (FWidget* parent=0); // constructor
explicit FTextView (FWidget* parent=0); // constructor
~FTextView(); // destructor
const char* getClassName() const;

View File

@ -45,7 +45,7 @@ class FToggleButton : public FWidget
virtual void onKeyPress (FKeyEvent*);
public:
FToggleButton (FWidget* parent=0); // constructor
explicit FToggleButton (FWidget* parent=0); // constructor
FToggleButton (const FString&, FWidget* parent=0); // constructor
virtual ~FToggleButton(); // destructor
virtual const char* getClassName() const;

View File

@ -220,7 +220,7 @@ class FWidget : public FObject, public FTerm
virtual bool focusPrevChild (void);
public:
FWidget (FWidget* parent=0); // constructor
explicit FWidget (FWidget* parent=0); // constructor
~FWidget(); // destructor
const char* getClassName() const;

View File

@ -31,7 +31,7 @@ class FWindow : public FWidget
virtual void onWindowLowered (FEvent*);
public:
FWindow (FWidget* parent=0); // constructor
explicit FWindow (FWidget* parent=0); // constructor
~FWindow (); // destructor
const char* getClassName() const;

View File

@ -17,7 +17,7 @@ class Mandelbrot : public FDialog
virtual void draw();
public:
Mandelbrot (FWidget* parent=0); // constructor
explicit Mandelbrot (FWidget* parent=0); // constructor
~Mandelbrot(); // destructor
void onAccel (FAccelEvent*);
void onClose (FCloseEvent*);

View File

@ -9,7 +9,7 @@
class timer : public FWidget
{
public:
timer (FWidget* parent = 0);
explicit timer (FWidget* parent = 0);
protected:
virtual void draw();
void onTimer (FTimerEvent*);

View File

@ -21,7 +21,7 @@ class ProgressDialog : public FDialog
FProgressbar* progressBar;
public:
ProgressDialog (FWidget* parent=0); // constructor
explicit ProgressDialog (FWidget* parent=0); // constructor
~ProgressDialog(); // destructor
void onShow (FShowEvent*);
@ -149,7 +149,7 @@ class MyDialog : public FDialog
private:
FListBox* myList;
public:
MyDialog (FWidget* parent=0); // constructor
explicit MyDialog (FWidget* parent=0); // constructor
~MyDialog(); // destructor
void onClose (FCloseEvent*);
void cb_noFunctionMsg (FWidget*, void*);