diff options
| author | Neil <nyamatongwe@gmail.com> | 2019-11-04 08:40:07 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2019-11-04 08:40:07 +1100 | 
| commit | 3d784c510a00121753dddda9c656bf06cab3d0ed (patch) | |
| tree | 277e6c490f347be7d3fec67a79deaa5b0aab9ea0 /qt/ScintillaEditBase/PlatQt.cpp | |
| parent | c4771c41b036b67ffb6b72e67f9165a80ec24467 (diff) | |
| download | scintilla-mirror-3d784c510a00121753dddda9c656bf06cab3d0ed.tar.gz | |
Avoid warnings where const reasonable.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
| -rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 18 | 
1 files changed, 14 insertions, 4 deletions
| diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index c1417b29b..515052a48 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -109,15 +109,25 @@ public:  		pfont = nullptr;  	}  }; -static int FontCharacterSet(Font &f) + +namespace { + +FontAndCharacterSet *AsFontAndCharacterSet(const Font &f) { +	return reinterpret_cast<FontAndCharacterSet *>(f.GetID()); +} + +int FontCharacterSet(const Font &f)  { -	return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->characterSet; +	return AsFontAndCharacterSet(f)->characterSet;  } -static QFont *FontPointer(Font &f) +QFont *FontPointer(const Font &f)  { -	return reinterpret_cast<FontAndCharacterSet *>(f.GetID())->pfont; +	return AsFontAndCharacterSet(f)->pfont; +} +  } +  Font::Font() noexcept : fid(nullptr) {}  Font::~Font()  { | 
