From c7639adb1596131c4a5d75b4336aca7badd6c776 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 19 Jan 2019 14:49:31 +0100 Subject: [PATCH] Remove warnings in Clang --- ext/ghoul | 2 +- modules/gaia/rendering/octreeculler.cpp | 4 --- modules/imgui/src/gui.cpp | 8 ----- modules/server/servermodule.cpp | 1 - modules/server/src/connection.cpp | 2 +- modules/server/src/serverinterface.cpp | 10 +++--- modules/space/rendering/renderablestars.cpp | 32 +++++++++++++------ modules/webbrowser/include/browserinstance.h | 9 ++++++ modules/webbrowser/include/eventhandler.h | 9 ++++++ .../webbrowser/include/screenspacebrowser.h | 9 ++++++ .../webbrowser/include/webkeyboardhandler.h | 10 ++++++ modules/webgui/webguimodule.cpp | 2 +- 12 files changed, 68 insertions(+), 30 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 5e70561a05..f819f18803 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 5e70561a05142c6bbb2484399b6816f61ce01bf7 +Subproject commit f819f18803cdfd479fe80e18816c0fe800b64910 diff --git a/modules/gaia/rendering/octreeculler.cpp b/modules/gaia/rendering/octreeculler.cpp index c3a28004f9..04df883c77 100644 --- a/modules/gaia/rendering/octreeculler.cpp +++ b/modules/gaia/rendering/octreeculler.cpp @@ -27,10 +27,6 @@ #include #include -namespace { - constexpr const char* _loggerCat = "OctreeCuller"; -} // namespace - namespace openspace { namespace { diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index a77a6b41cf..5070129ff7 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -95,14 +95,6 @@ namespace { "Tooltip Delay (in s)", "This value determines the delay in seconds after which the tooltip is shown." }; - - constexpr openspace::properties::Property::PropertyInfo HiddenInfo = { - "IsHidden", - "Is Hidden", - "If this value is true, all GUI items will not be rendered, regardless of their " - "status" - }; - } // namespace namespace openspace::gui { diff --git a/modules/server/servermodule.cpp b/modules/server/servermodule.cpp index 89d4cfa922..33a805b591 100644 --- a/modules/server/servermodule.cpp +++ b/modules/server/servermodule.cpp @@ -37,7 +37,6 @@ #include namespace { - constexpr const char* _loggerCat = "ServerModule"; constexpr const char* KeyInterfaces = "Interfaces"; } // namespace diff --git a/modules/server/src/connection.cpp b/modules/server/src/connection.cpp index 728afab4dd..9fdc542b78 100644 --- a/modules/server/src/connection.cpp +++ b/modules/server/src/connection.cpp @@ -76,7 +76,7 @@ Connection::Connection(std::unique_ptr s, _topicFactory.registerClass( AuthenticationTopicKey, - [password](bool useDictionary, const ghoul::Dictionary& dict) { + [password](bool, const ghoul::Dictionary&) { return new AuthorizationTopic(password); } ); diff --git a/modules/server/src/serverinterface.cpp b/modules/server/src/serverinterface.cpp index cbc2cadfc4..49b62d55b9 100644 --- a/modules/server/src/serverinterface.cpp +++ b/modules/server/src/serverinterface.cpp @@ -89,22 +89,22 @@ namespace { namespace openspace { std::unique_ptr ServerInterface::createFromDictionary( - const ghoul::Dictionary& config) + const ghoul::Dictionary& config) { // TODO: Use documentation to verify dictionary std::unique_ptr si = std::make_unique(config); - return std::move(si); + return si; } ServerInterface::ServerInterface(const ghoul::Dictionary& config) : properties::PropertyOwner({ "", "", "" }) , _type(TypeInfo) , _port(PortInfo, 0) - , _defaultAccess(DefaultAccessInfo) + , _enabled(EnabledInfo) , _allowAddresses(AllowAddressesInfo) , _requirePasswordAddresses(RequirePasswordAddressesInfo) , _denyAddresses(DenyAddressesInfo) - , _enabled(EnabledInfo) + , _defaultAccess(DefaultAccessInfo) , _password(PasswordInfo) { @@ -117,7 +117,7 @@ ServerInterface::ServerInterface(const ghoul::Dictionary& config) const std::string identifier = config.value(KeyIdentifier); - std::function readList = + auto readList = [config](const std::string& key, properties::StringListProperty& list) { if (config.hasValue(key)) { const ghoul::Dictionary& dict = config.value(key); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 2d0c9787d4..09060984cb 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -41,6 +41,8 @@ #include #include +#include + namespace { constexpr const char* _loggerCat = "RenderableStars"; @@ -56,27 +58,39 @@ namespace { constexpr int8_t CurrentCacheVersion = 2; - struct CommonDataLayout { + struct ColorVBOLayout { + std::array position; // (x,y,z,e) + float value; + float luminance; + float absoluteMagnitude; + }; + + struct VelocityVBOLayout { std::array position; // (x,y,z,e) float value; float luminance; float absoluteMagnitude; - }; - - struct ColorVBOLayout : public CommonDataLayout {}; - - struct VelocityVBOLayout : public CommonDataLayout { float vx; // v_x float vy; // v_y float vz; // v_z }; - struct SpeedVBOLayout : public CommonDataLayout { + struct SpeedVBOLayout { + std::array position; // (x,y,z,e) + float value; + float luminance; + float absoluteMagnitude; + float speed; }; - struct OtherDataLayout : public CommonDataLayout {}; + struct OtherDataLayout { + std::array position; // (x,y,z,e) + float value; + float luminance; + float absoluteMagnitude; + }; constexpr openspace::properties::Property::PropertyInfo SpeckFileInfo = { "SpeckFile", @@ -407,7 +421,7 @@ void RenderableStars::initializeGL() { LERROR(fmt::format("Could not find other data column {}", _queuedOtherData)); } else { - _otherDataOption = std::distance(_dataNames.begin(), it); + _otherDataOption = static_cast(std::distance(_dataNames.begin(), it)); _queuedOtherData.clear(); } } diff --git a/modules/webbrowser/include/browserinstance.h b/modules/webbrowser/include/browserinstance.h index ab6df6a94d..aa5261d3fd 100644 --- a/modules/webbrowser/include/browserinstance.h +++ b/modules/webbrowser/include/browserinstance.h @@ -30,8 +30,17 @@ #pragma warning (disable : 4100) #endif // _MSC_VER +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif // __clang__ + #include +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + #ifdef _MSC_VER #pragma warning (pop) #endif // _MSC_VER diff --git a/modules/webbrowser/include/eventhandler.h b/modules/webbrowser/include/eventhandler.h index 16a6ba046c..eb7e0725f6 100644 --- a/modules/webbrowser/include/eventhandler.h +++ b/modules/webbrowser/include/eventhandler.h @@ -35,8 +35,17 @@ #pragma warning (disable : 4100) #endif // _MSC_VER +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif // __clang__ + #include +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + #ifdef _MSC_VER #pragma warning (pop) #endif // _MSC_VER diff --git a/modules/webbrowser/include/screenspacebrowser.h b/modules/webbrowser/include/screenspacebrowser.h index 88010829ba..be248483b1 100644 --- a/modules/webbrowser/include/screenspacebrowser.h +++ b/modules/webbrowser/include/screenspacebrowser.h @@ -36,8 +36,17 @@ #pragma warning (disable : 4100) #endif // _MSC_VER +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif // __clang__ + #include +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + #ifdef _MSC_VER #pragma warning (pop) #endif // _MSC_VER diff --git a/modules/webbrowser/include/webkeyboardhandler.h b/modules/webbrowser/include/webkeyboardhandler.h index b723be63bd..2e609145a1 100644 --- a/modules/webbrowser/include/webkeyboardhandler.h +++ b/modules/webbrowser/include/webkeyboardhandler.h @@ -30,8 +30,18 @@ #pragma warning (disable : 4100) #endif // _MSC_VER + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif // __clang__ + #include +#ifdef __clang__ +#pragma clang diagnostic pop +#endif // __clang__ + #ifdef _MSC_VER #pragma warning (pop) #endif // _MSC_VER diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index ac5a1bcabf..a4444272c2 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -85,8 +85,8 @@ WebGuiModule::WebGuiModule() , _enabled(ServerProcessEnabledInfo, false) , _entryPoint(ServerProcessEntryPointInfo) , _webDirectory(WebDirectoryInfo) - , _address(AddressInfo, DefaultAddress) , _port(PortInfo, DefaultPort) + , _address(AddressInfo, DefaultAddress) , _webSocketInterface(WebSocketInterfaceInfo, "") { addProperty(_enabled);