diff options
author | Neil <nyamatongwe@gmail.com> | 2013-12-15 12:49:06 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2013-12-15 12:49:06 +1100 |
commit | 3d0a66fc8c15a74ae33a5d92b68c0b9adcd02920 (patch) | |
tree | 0eac4ed28358e0496be6a35f77891b308849b477 /win32 | |
parent | 7c020de8903c45bcc32795e28cc13a32285513f3 (diff) | |
download | scintilla-mirror-3d0a66fc8c15a74ae33a5d92b68c0b9adcd02920.tar.gz |
Make single argument constructors explicit to avoid unexpected conversions.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 6 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 89e3f9c97..d2bc4c05f 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -334,7 +334,7 @@ class FontCached : Font { LOGFONTA lf; int technology; int hash; - FontCached(const FontParameters &fp); + explicit FontCached(const FontParameters &fp); ~FontCached() {} bool SameAs(const FontParameters &fp); virtual void Release(); @@ -490,7 +490,7 @@ class VarBuffer { VarBuffer &operator=(const VarBuffer &); public: T *buffer; - VarBuffer(size_t length) : buffer(0) { + explicit VarBuffer(size_t length) : buffer(0) { if (length > lengthStandard) { buffer = new T[length]; } else { @@ -3058,7 +3058,7 @@ class DynamicLibraryImpl : public DynamicLibrary { protected: HMODULE h; public: - DynamicLibraryImpl(const char *modulePath) { + explicit DynamicLibraryImpl(const char *modulePath) { h = ::LoadLibraryA(modulePath); } diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 465d74d85..2a6ac369d 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -212,7 +212,7 @@ class ScintillaWin : bool renderTargetValid; #endif - ScintillaWin(HWND hwnd); + explicit ScintillaWin(HWND hwnd); ScintillaWin(const ScintillaWin &); virtual ~ScintillaWin(); ScintillaWin &operator=(const ScintillaWin &); @@ -1461,7 +1461,7 @@ class CaseFolderDBCS : public CaseFolderTable { std::vector<wchar_t> utf16Folded; UINT cp; public: - CaseFolderDBCS(UINT cp_) : cp(cp_) { + explicit CaseFolderDBCS(UINT cp_) : cp(cp_) { StandardASCII(); } virtual size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) { @@ -1634,7 +1634,7 @@ public: void *ptr; GlobalMemory() : hand(0), ptr(0) { } - GlobalMemory(HGLOBAL hand_) : hand(hand_), ptr(0) { + explicit GlobalMemory(HGLOBAL hand_) : hand(hand_), ptr(0) { if (hand) { ptr = ::GlobalLock(hand); } |