From 4d0c88fb9411ae48731b07fc3feab750c6eceaff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Thu, 4 Jan 2018 02:12:34 +0100 Subject: [PATCH] Mark constructors explicit (#6928) --- src/openrct2-ui/UiContext.cpp | 2 +- .../drawing/engines/opengl/OpenGLDrawingEngine.cpp | 2 +- src/openrct2/PlatformEnvironment.cpp | 2 +- src/openrct2/config/IniReader.cpp | 2 +- src/openrct2/config/IniWriter.cpp | 2 +- src/openrct2/object/ObjectRepository.cpp | 4 ++-- src/openrct2/scenario/ScenarioRepository.cpp | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index fb7a5fc07f..1b28b8ef7e 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -87,7 +87,7 @@ private: float _gestureRadius = 0; public: - UiContext(IPlatformEnvironment * env) + explicit UiContext(IPlatformEnvironment * env) : _platformUiContext(CreatePlatformUiContext()), _windowManager(CreateWindowManager()), _keyboardShortcuts(env) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 524c6d3c07..5fbb3ed07f 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -149,7 +149,7 @@ public: SDL_Color Palette[256]; vec4 GLPalette[256]; - OpenGLDrawingEngine(IUiContext * uiContext) + explicit OpenGLDrawingEngine(IUiContext * uiContext) : _uiContext(uiContext) { _window = (SDL_Window *)_uiContext->GetWindow(); diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 57ca672e14..9a1e80783a 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -34,7 +34,7 @@ private: std::string _basePath[DIRBASE_COUNT]; public: - PlatformEnvironment(DIRBASE_VALUES basePaths) + explicit PlatformEnvironment(DIRBASE_VALUES basePaths) { for (sint32 i = 0; i < DIRBASE_COUNT; i++) { diff --git a/src/openrct2/config/IniReader.cpp b/src/openrct2/config/IniReader.cpp index 6fe7caf10e..f28426e06f 100644 --- a/src/openrct2/config/IniReader.cpp +++ b/src/openrct2/config/IniReader.cpp @@ -100,7 +100,7 @@ private: std::unordered_map _values; public: - IniReader(IStream * stream) + explicit IniReader(IStream * stream) { uint64 length = stream->GetLength() - stream->GetPosition(); _buffer.resize(length); diff --git a/src/openrct2/config/IniWriter.cpp b/src/openrct2/config/IniWriter.cpp index e3aed73d80..23c9879a92 100644 --- a/src/openrct2/config/IniWriter.cpp +++ b/src/openrct2/config/IniWriter.cpp @@ -27,7 +27,7 @@ private: bool _firstSection = true; public: - IniWriter(IStream * stream) + explicit IniWriter(IStream * stream) : _stream(stream) { } diff --git a/src/openrct2/object/ObjectRepository.cpp b/src/openrct2/object/ObjectRepository.cpp index cd48d04942..681a34ef55 100644 --- a/src/openrct2/object/ObjectRepository.cpp +++ b/src/openrct2/object/ObjectRepository.cpp @@ -83,7 +83,7 @@ private: static constexpr auto PATTERN = "*.dat;*.pob"; public: - ObjectFileIndex(IPlatformEnvironment * env) : + explicit ObjectFileIndex(IPlatformEnvironment * env) : FileIndex("object index", MAGIC_NUMBER, VERSION, @@ -195,7 +195,7 @@ class ObjectRepository final : public IObjectRepository ObjectEntryMap _itemMap; public: - ObjectRepository(IPlatformEnvironment * env) + explicit ObjectRepository(IPlatformEnvironment * env) : _env(env), _fileIndex(env) { diff --git a/src/openrct2/scenario/ScenarioRepository.cpp b/src/openrct2/scenario/ScenarioRepository.cpp index 53685d005b..3b3c289b9a 100644 --- a/src/openrct2/scenario/ScenarioRepository.cpp +++ b/src/openrct2/scenario/ScenarioRepository.cpp @@ -127,7 +127,7 @@ private: static constexpr auto PATTERN = "*.sc4;*.sc6"; public: - ScenarioFileIndex(IPlatformEnvironment * env) : + explicit ScenarioFileIndex(IPlatformEnvironment * env) : FileIndex("scenario index", MAGIC_NUMBER, VERSION, @@ -325,7 +325,7 @@ private: std::vector _highscores; public: - ScenarioRepository(IPlatformEnvironment * env) + explicit ScenarioRepository(IPlatformEnvironment * env) : _env(env), _fileIndex(env) {