diff --git a/ext/ghoul b/ext/ghoul index c37ff8beb5..200401261c 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit c37ff8beb5b8825ecb67b121ae4deac34677e1bd +Subproject commit 200401261cba513fb1faa4b7e92bd213435625ad diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index 3f028ecb6a..224126586f 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -111,7 +111,7 @@ void DebugRenderer::renderVertices(const Vertices& clippingSpacePoints, GLenum m glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(clippingSpacePoints[0]), 0); // Draw the vertices - glDrawArrays(mode, 0, clippingSpacePoints.size()); + glDrawArrays(mode, 0, static_cast(clippingSpacePoints.size())); // Check for errors GLenum error = glGetError(); diff --git a/modules/newhorizons/rendering/renderablemodelprojection.cpp b/modules/newhorizons/rendering/renderablemodelprojection.cpp index 0a4ed8c0bb..36f448f5bc 100644 --- a/modules/newhorizons/rendering/renderablemodelprojection.cpp +++ b/modules/newhorizons/rendering/renderablemodelprojection.cpp @@ -347,7 +347,7 @@ void RenderableModelProjection::attitudeParameters(double time) { try { _instrumentMatrix = SpiceManager::ref().positionTransformMatrix(_projectionComponent.instrumentId(), _destination, time); } - catch (const SpiceManager::SpiceException& e) { + catch (const SpiceManager::SpiceException&) { return; } diff --git a/modules/newhorizons/rendering/renderableshadowcylinder.cpp b/modules/newhorizons/rendering/renderableshadowcylinder.cpp index 2350cb5e5f..72e8206064 100644 --- a/modules/newhorizons/rendering/renderableshadowcylinder.cpp +++ b/modules/newhorizons/rendering/renderableshadowcylinder.cpp @@ -34,8 +34,6 @@ namespace { - const std::string _loggerCat = "RenderablePlane"; - const char* KeyType = "TerminatorType"; const char* KeyLightSource = "LightSource"; const char* KeyObserver = "Observer"; @@ -50,7 +48,7 @@ namespace openspace { RenderableShadowCylinder::RenderableShadowCylinder(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _numberOfPoints("amountOfPoints", "Points", 190, 1, 300) - , _shadowLength("shadowLength", "Shadow Length", 0.1, 0.0, 0.5) + , _shadowLength("shadowLength", "Shadow Length", 0.1f, 0.0f, 0.5f) , _shadowColor("shadowColor", "Shadow Color", glm::vec4(1.f, 1.f, 1.f, 0.25f), glm::vec4(0.f), glm::vec4(1.f)) , _shader(nullptr) diff --git a/modules/newhorizons/util/imagesequencer.cpp b/modules/newhorizons/util/imagesequencer.cpp index 9e08dc70d1..3a59a3c52a 100644 --- a/modules/newhorizons/util/imagesequencer.cpp +++ b/modules/newhorizons/util/imagesequencer.cpp @@ -333,7 +333,9 @@ bool ImageSequencer::getImagePaths(std::vector& captures, } if (beforeDist < 1.0 || nextDist < 1.0) { - toDelete.push_back(std::distance(captures.begin(), it)); + toDelete.push_back( + static_cast(std::distance(captures.begin(), it)) + ); } } } @@ -341,7 +343,7 @@ bool ImageSequencer::getImagePaths(std::vector& captures, for (size_t i = 0; i < toDelete.size(); ++i) { // We have to subtract i here as we already have deleted i value // before this and we need to adjust the location - int v = toDelete[i] - i; + int v = toDelete[i] - static_cast(i); captures.erase(captures.begin() + v); } diff --git a/modules/newhorizons/util/instrumentdecoder.cpp b/modules/newhorizons/util/instrumentdecoder.cpp index 33372a28fe..5f4a000efc 100644 --- a/modules/newhorizons/util/instrumentdecoder.cpp +++ b/modules/newhorizons/util/instrumentdecoder.cpp @@ -27,6 +27,7 @@ #include #include #include + namespace { const std::string _loggerCat = "InstrumentDecoder"; const char* keyDetector = "DetectorType"; @@ -40,11 +41,15 @@ InstrumentDecoder::InstrumentDecoder(const ghoul::Dictionary& dictionary) { bool success = dictionary.getValue(keyDetector, _type); ghoul_assert(success, "Instrument has not provided detector type"); - for_each(_type.begin(), _type.end(), [](char& in){ in = ::toupper(in); }); + std::for_each( + _type.begin(), + _type.end(), + [](char& in){ in = static_cast(toupper(in)); } + ); if (!dictionary.hasKeyAndValue(keyStopCommand) && _type == "SCANNER"){ LWARNING("Scanner must provide stop command, please check mod file."); - }else{ + } else { dictionary.getValue(keyStopCommand, _stopCommand); } diff --git a/modules/newhorizons/util/instrumentdecoder.h b/modules/newhorizons/util/instrumentdecoder.h index 14b3689706..c4852f7424 100644 --- a/modules/newhorizons/util/instrumentdecoder.h +++ b/modules/newhorizons/util/instrumentdecoder.h @@ -35,6 +35,7 @@ public: virtual std::string getDecoderType(); virtual std::vector getTranslation(); std::string getStopCommand(); + private: std::string _type; std::string _stopCommand; diff --git a/modules/newhorizons/util/projectioncomponent.cpp b/modules/newhorizons/util/projectioncomponent.cpp index e6e542c16a..68d4fb1313 100644 --- a/modules/newhorizons/util/projectioncomponent.cpp +++ b/modules/newhorizons/util/projectioncomponent.cpp @@ -196,8 +196,8 @@ void ProjectionComponent::initialize(const ghoul::Dictionary& dictionary) { _instrumentID = dictionary.value(keyInstrument); _projectorID = dictionary.value(keyProjObserver); _projecteeID = dictionary.value(keyProjTarget); - _fovy = dictionary.value(keyInstrumentFovy); - _aspectRatio = dictionary.value(keyInstrumentAspect); + _fovy = static_cast(dictionary.value(keyInstrumentFovy)); + _aspectRatio = static_cast(dictionary.value(keyInstrumentAspect)); _aberration = SpiceManager::AberrationCorrection( dictionary.value(keyProjAberration) diff --git a/modules/onscreengui/src/gui.cpp b/modules/onscreengui/src/gui.cpp index fa34ff997f..1b533dbf7a 100644 --- a/modules/onscreengui/src/gui.cpp +++ b/modules/onscreengui/src/gui.cpp @@ -592,7 +592,7 @@ void GUI::renderAndUpdatePropertyVisibility() { // Array is sorted by importance std::array items = { "None", "User", "Developer", "All"}; - ImGui::Combo("PropertyVisibility", &t, items.data(), items.size()); + ImGui::Combo("PropertyVisibility", &t, items.data(), static_cast(items.size())); _currentVisibility = static_cast(t); _globalProperty.setVisibility(_currentVisibility); diff --git a/modules/onscreengui/src/guiiswacomponent.cpp b/modules/onscreengui/src/guiiswacomponent.cpp index f21ab65189..870d854633 100644 --- a/modules/onscreengui/src/guiiswacomponent.cpp +++ b/modules/onscreengui/src/guiiswacomponent.cpp @@ -39,7 +39,6 @@ namespace { using json = nlohmann::json; const std::string _loggerCat = "iSWAComponent"; - const ImVec2 size = ImVec2(350, 500); } namespace openspace { diff --git a/modules/onscreengui/src/guiperformancecomponent.cpp b/modules/onscreengui/src/guiperformancecomponent.cpp index 864c76c65e..93be7203c5 100644 --- a/modules/onscreengui/src/guiperformancecomponent.cpp +++ b/modules/onscreengui/src/guiperformancecomponent.cpp @@ -89,9 +89,9 @@ void GuiPerformanceComponent::render() { } if (_sceneGraphIsEnabled) { - bool v = _sceneGraphIsEnabled; - ImGui::Begin("SceneGraph", &v); - _sceneGraphIsEnabled = v; + bool sge = _sceneGraphIsEnabled; + ImGui::Begin("SceneGraph", &sge); + _sceneGraphIsEnabled = sge; // The indices correspond to the index into the average array further below ImGui::Text("Sorting"); @@ -399,9 +399,9 @@ void GuiPerformanceComponent::render() { } if (_functionsIsEnabled) { - bool v = _functionsIsEnabled; - ImGui::Begin("Functions", &v); - _functionsIsEnabled = v; + bool fe = _functionsIsEnabled; + ImGui::Begin("Functions", &fe); + _functionsIsEnabled = fe; using namespace performance; for (int i = 0; i < layout->nFunctionEntries; ++i) { @@ -422,9 +422,6 @@ void GuiPerformanceComponent::render() { std::end(layout->functionEntries[i].time) ); - const PerformanceLayout::FunctionPerformanceLayout& f = - layout->functionEntries[i]; - std::string renderTime = std::to_string( entry.time[PerformanceLayout::NumberValues - 1] ) + "us"; diff --git a/modules/onscreengui/src/guipropertycomponent.cpp b/modules/onscreengui/src/guipropertycomponent.cpp index 1730c48f55..a6946957d1 100644 --- a/modules/onscreengui/src/guipropertycomponent.cpp +++ b/modules/onscreengui/src/guipropertycomponent.cpp @@ -42,18 +42,18 @@ namespace { int nVisibleProperties(const std::vector& properties, properties::Property::Visibility visibility) { - return std::count_if( + return static_cast(std::count_if( properties.begin(), properties.end(), [visibility](properties::Property* p) { - using V = properties::Property::Visibility; - return - static_cast>(visibility) >= - static_cast>(p->visibility()); - } - ); -} + using V = properties::Property::Visibility; + return + static_cast>(visibility) >= + static_cast>(p->visibility()); + } + )); } +} // namespace namespace gui { diff --git a/modules/onscreengui/src/renderproperties.cpp b/modules/onscreengui/src/renderproperties.cpp index c0e714cf82..63693c1f77 100644 --- a/modules/onscreengui/src/renderproperties.cpp +++ b/modules/onscreengui/src/renderproperties.cpp @@ -172,9 +172,9 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa std::string name = p->guiName(); ImGui::PushID((ownerName + "." + name).c_str()); - float value = *p; - float min = p->minValue(); - float max = p->maxValue(); + float value = static_cast(*p); + float min = static_cast(p->minValue()); + float max = static_cast(p->maxValue()); ImGui::SliderFloat(name.c_str(), &value, min, max, "%.5f"); renderTooltip(prop); @@ -211,8 +211,8 @@ void renderIVec2Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); IVec2Property::ValueType value = *p; - float min = std::min(p->minValue().x, p->minValue().y); - float max = std::max(p->maxValue().x, p->maxValue().y); + int min = std::min(p->minValue().x, p->minValue().y); + int max = std::max(p->maxValue().x, p->maxValue().y); ImGui::SliderInt2( name.c_str(), &value.x, @@ -237,8 +237,8 @@ void renderIVec3Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); IVec3Property::ValueType value = *p; - float min = std::min(std::min(p->minValue().x, p->minValue().y), p->minValue().z); - float max = std::max(std::max(p->maxValue().x, p->maxValue().y), p->maxValue().z); + int min = std::min(std::min(p->minValue().x, p->minValue().y), p->minValue().z); + int max = std::max(std::max(p->maxValue().x, p->maxValue().y), p->maxValue().z); ImGui::SliderInt3( name.c_str(), @@ -264,10 +264,10 @@ void renderIVec4Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); IVec4Property::ValueType value = *p; - float min = std::min(std::min(std::min( + int min = std::min(std::min(std::min( p->minValue().x, p->minValue().y), p->minValue().z), p->minValue().w ); - float max = std::max(std::max(std::max( + int max = std::max(std::max(std::max( p->maxValue().x, p->maxValue().y), p->maxValue().z), p->maxValue().w ); @@ -406,8 +406,8 @@ void renderDVec2Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); glm::vec2 value = glm::dvec2(*p); - float min = std::min(p->minValue().x, p->minValue().y); - float max = std::max(p->maxValue().x, p->maxValue().y); + float min = static_cast(std::min(p->minValue().x, p->minValue().y)); + float max = static_cast(std::max(p->maxValue().x, p->maxValue().y)); ImGui::SliderFloat2( name.c_str(), &value.x, @@ -433,8 +433,12 @@ void renderDVec3Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); glm::vec3 value = glm::dvec3(*p); - float min = std::min(std::min(p->minValue().x, p->minValue().y), p->minValue().z); - float max = std::max(std::max(p->maxValue().x, p->maxValue().y), p->maxValue().z); + float min = static_cast( + std::min(std::min(p->minValue().x, p->minValue().y), p->minValue().z) + ); + float max = static_cast( + std::max(std::max(p->maxValue().x, p->maxValue().y), p->maxValue().z) + ); bool changed = ImGui::SliderFloat3( name.c_str(), @@ -463,10 +467,16 @@ void renderDVec4Property(Property* prop, const std::string& ownerName) { ImGui::PushID((ownerName + "." + name).c_str()); glm::vec4 value = glm::dvec4(*p); - float min = std::min(std::min(std::min( - p->minValue().x, p->minValue().y), p->minValue().z), p->minValue().w); - float max = std::max(std::max(std::max( - p->maxValue().x, p->maxValue().y), p->maxValue().z), p->maxValue().w); + float min = static_cast( + std::min(std::min(std::min( + p->minValue().x, p->minValue().y), p->minValue().z), p->minValue().w + ) + ); + float max = static_cast( + std::max(std::max(std::max( + p->maxValue().x, p->maxValue().y), p->maxValue().z), p->maxValue().w + ) + ); ImGui::SliderFloat4( name.c_str(),