From 518b43db02a69511d951bacc04bfc91d8eedebc7 Mon Sep 17 00:00:00 2001 From: Emil Axelsson Date: Fri, 31 Aug 2018 14:30:35 +0200 Subject: [PATCH] Fix compiler warnings --- include/openspace/network/messagestructures.h | 2 +- .../rendering/renderableatmosphere.cpp | 12 ----------- modules/base/rotation/constantrotation.cpp | 3 +-- modules/imgui/src/gui.cpp | 1 - src/interaction/orbitalnavigator.cpp | 4 ++-- src/network/parallelpeer.cpp | 4 ---- src/rendering/renderengine.cpp | 20 ++----------------- src/rendering/transferfunction.cpp | 9 +++------ src/util/blockplaneintersectiongeometry.cpp | 2 ++ src/util/timemanager.cpp | 2 -- 10 files changed, 11 insertions(+), 48 deletions(-) diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index 38710aa0ae..b32e1109a5 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -193,7 +193,7 @@ struct TimeTimeline { reinterpret_cast(&nKeyframes), reinterpret_cast(&nKeyframes) + sizeof(int64_t) ); - for (const auto k : _keyframes) { + for (const auto& k : _keyframes) { k.serialize(buffer); } }; diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index c684f145a3..37ef93ddb9 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -200,18 +200,6 @@ namespace { "Unitless for now" }; - constexpr openspace::properties::Property::PropertyInfo AtmosphereExposureInfo = { - "HdrExposure", - "Atmosphere Exposure", - "Constant to controls the exposure of the radiance range" - }; - - constexpr openspace::properties::Property::PropertyInfo AtmosphereGammaInfo = { - "Gamma", - "Gamma Correction", - "Gamma Correction" - }; - constexpr openspace::properties::Property::PropertyInfo EnableSunOnCameraPositionInfo = { diff --git a/modules/base/rotation/constantrotation.cpp b/modules/base/rotation/constantrotation.cpp index 5562fd2cf9..1369cd31c3 100644 --- a/modules/base/rotation/constantrotation.cpp +++ b/modules/base/rotation/constantrotation.cpp @@ -116,8 +116,7 @@ glm::dmat3 ConstantRotation::matrix(const UpdateData& data) const { if (_accumulatedRotation < -glm::tau()) { _accumulatedRotation += glm::tau(); } - - const glm::dvec3 axis = _rotationAxis; + glm::dquat q = glm::angleAxis(_accumulatedRotation, _rotationAxis.value()); return glm::toMat3(q); } diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index 5d091b0b17..2c8f660907 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -46,7 +46,6 @@ namespace { constexpr const char* configurationFile = "imgui.ini"; constexpr const char* GuiFont = "${FONTS}/arimo/Arimo-Regular.ttf"; constexpr const float FontSize = 14.f; - const glm::vec2 Size = { 500.f, 500.f }; char* iniFileBuffer = nullptr; diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 8276498120..6b9beae5fa 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -153,13 +153,13 @@ OrbitalNavigator::OrbitalNavigator() , _minimumAllowedDistance(MinimumDistanceInfo, 10.0f, 0.0f, 10000.f) , _mouseSensitivity(MouseSensitivityInfo, 15.0f, 1.0f, 50.f) , _joystickSensitivity(JoystickSensitivityInfo, 10.0f, 1.0f, 50.f) - , _mouseStates(_mouseSensitivity * 0.0001, 1 / (_friction.friction + 0.0000001)) - , _joystickStates(_joystickSensitivity * 0.1, 1 / (_friction.friction + 0.0000001)) , _useAdaptiveStereoscopicDepth(UseAdaptiveStereoscopicDepthInfo, true) , _stereoscopicDepthOfFocusSurface(StereoscopicDepthOfFocusSurfaceInfo, 8, 0.25, 100) , _staticViewScaleExponent(StaticViewScaleExponentInfo, 0.f, -30, 10) , _rotateToFocusInterpolationTime(RotateToFocusInterpolationTimeInfo, 2.0, 0.0, 10.0) , _stereoInterpolationTime(StereoInterpolationTimeInfo, 8.0, 0.0, 10.0) + , _mouseStates(_mouseSensitivity * 0.0001, 1 / (_friction.friction + 0.0000001)) + , _joystickStates(_joystickSensitivity * 0.1, 1 / (_friction.friction + 0.0000001)) { _followRotationInterpolator.setTransferFunction([](double t) { const double res = 3.0 * t*t - 2.0 * t*t*t; diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index 0311a9640d..e8876625b3 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -40,7 +40,6 @@ #include "parallelpeer_lua.inl" namespace { - constexpr const uint32_t ProtocolVersion = 3; constexpr const size_t MaxLatencyDiffs = 64; constexpr const char* _loggerCat = "ParallelPeer"; @@ -453,7 +452,6 @@ void ParallelPeer::requestHostship() { reinterpret_cast(&passwordHash) + sizeof(uint64_t) ); - const double now = global::windowDelegate.applicationTime(); _connection.sendMessage(ParallelConnection::Message( ParallelConnection::MessageType::HostshipRequest, buffer @@ -461,8 +459,6 @@ void ParallelPeer::requestHostship() { } void ParallelPeer::resignHostship() { - const double now = global::windowDelegate.applicationTime(); - std::vector buffer; _connection.sendMessage(ParallelConnection::Message( ParallelConnection::MessageType::HostshipResignation, diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 65790f4487..644e7030cc 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -92,23 +92,6 @@ namespace { "performance." }; - constexpr openspace::properties::Property::PropertyInfo ShowDateInfo = { - "ShowDate", - "Show Date Information", - "This values determines whether the date will be printed in the top left corner " - "of the rendering window if a regular rendering window is used (as opposed to a " - "fisheye rendering, for example)." - }; - - constexpr openspace::properties::Property::PropertyInfo ShowInfoInfo = { - "ShowInfo", - "Show Rendering Information", - "This value determines whether the rendering info, which is the delta time and " - "the frame time, is shown in the top left corner of the rendering window if a " - "regular rendering window is used (as opposed to a fisheye rendering, for " - "example)." - }; - constexpr openspace::properties::Property::PropertyInfo ShowOverlaySlavesInfo = { "ShowOverlayOnSlaves", "Show Overlay Information on Slaves", @@ -406,7 +389,8 @@ void RenderEngine::updateScene() { _scene->update({ { glm::dvec3(0.0), glm::dmat3(11.), 1.0 }, currentTime, - integrateFromTime + integrateFromTime, + _doPerformanceMeasurements }); LTRACE("RenderEngine::updateSceneGraph(end)"); diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index 3a13d84787..5d610f457c 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -189,7 +189,7 @@ void TransferFunction::setTextureFromTxt(std::shared_ptr const float dist = fpos - prevKey->position; const float weight = dist / (currentKey->position - prevKey->position); - for (size_t channel = 0; channel < 4; ++channel) { + for (int channel = 0; channel < 4; ++channel) { const size_t position = 4 * i + channel; // Interpolate linearly between prev and next mapping key float value = (prevKey->color[channel] * (1.f - weight) + @@ -229,14 +229,11 @@ glm::vec4 TransferFunction::sample(size_t offset) { const int nPixels = _texture->width(); // Clamp to range. - if (offset >= nPixels) { + if (offset >= static_cast(nPixels)) { offset = nPixels - 1; } - if (offset < 0) { - offset = 0; - } - return _texture->texelAsFloat(offset); + return _texture->texelAsFloat(static_cast(offset)); } size_t TransferFunction::width() { diff --git a/src/util/blockplaneintersectiongeometry.cpp b/src/util/blockplaneintersectiongeometry.cpp index 59f4bdd777..184bd3f977 100644 --- a/src/util/blockplaneintersectiongeometry.cpp +++ b/src/util/blockplaneintersectiongeometry.cpp @@ -37,6 +37,8 @@ BlockPlaneIntersectionGeometry::BlockPlaneIntersectionGeometry(glm::vec3 blockSi glm::vec3 planeNormal, float planeDistance) : _size(blockSize) + , _normal(planeNormal) + , _planeDistance(planeDistance) {} BlockPlaneIntersectionGeometry::~BlockPlaneIntersectionGeometry() { diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index bbd4d6b7f5..58ec369132 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -64,8 +64,6 @@ namespace { "The default duration taken to transition to the unpaused state, " "when interpolating" }; - - constexpr const char* _loggerCat = "TimeManager"; } namespace openspace {