Remove warnings

- Unit tests
  - core
  - onscreengui
  - debugging
  - newhorizons
Update Ghoul
This commit is contained in:
Alexander Bock
2017-04-10 14:33:45 -04:00
parent fabe6dafd9
commit 51b420f2c4
13 changed files with 60 additions and 48 deletions
@@ -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<GLsizei>(clippingSpacePoints.size()));
// Check for errors
GLenum error = glGetError();
@@ -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;
}
@@ -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)
+4 -2
View File
@@ -333,7 +333,9 @@ bool ImageSequencer::getImagePaths(std::vector<Image>& captures,
}
if (beforeDist < 1.0 || nextDist < 1.0) {
toDelete.push_back(std::distance(captures.begin(), it));
toDelete.push_back(
static_cast<int>(std::distance(captures.begin(), it))
);
}
}
}
@@ -341,7 +343,7 @@ bool ImageSequencer::getImagePaths(std::vector<Image>& 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<int>(i);
captures.erase(captures.begin() + v);
}
@@ -27,6 +27,7 @@
#include <ghoul/misc/assert.h>
#include <ghoul/logging/logmanager.h>
#include <ghoul/misc/dictionary.h>
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<char>(toupper(in)); }
);
if (!dictionary.hasKeyAndValue<std::string>(keyStopCommand) && _type == "SCANNER"){
LWARNING("Scanner must provide stop command, please check mod file.");
}else{
} else {
dictionary.getValue(keyStopCommand, _stopCommand);
}
@@ -35,6 +35,7 @@ public:
virtual std::string getDecoderType();
virtual std::vector<std::string> getTranslation();
std::string getStopCommand();
private:
std::string _type;
std::string _stopCommand;
@@ -196,8 +196,8 @@ void ProjectionComponent::initialize(const ghoul::Dictionary& dictionary) {
_instrumentID = dictionary.value<std::string>(keyInstrument);
_projectorID = dictionary.value<std::string>(keyProjObserver);
_projecteeID = dictionary.value<std::string>(keyProjTarget);
_fovy = dictionary.value<double>(keyInstrumentFovy);
_aspectRatio = dictionary.value<double>(keyInstrumentAspect);
_fovy = static_cast<float>(dictionary.value<double>(keyInstrumentFovy));
_aspectRatio = static_cast<float>(dictionary.value<double>(keyInstrumentAspect));
_aberration = SpiceManager::AberrationCorrection(
dictionary.value<std::string>(keyProjAberration)
+1 -1
View File
@@ -592,7 +592,7 @@ void GUI::renderAndUpdatePropertyVisibility() {
// Array is sorted by importance
std::array<const char*, 4> items = { "None", "User", "Developer", "All"};
ImGui::Combo("PropertyVisibility", &t, items.data(), items.size());
ImGui::Combo("PropertyVisibility", &t, items.data(), static_cast<int>(items.size()));
_currentVisibility = static_cast<V>(t);
_globalProperty.setVisibility(_currentVisibility);
@@ -39,7 +39,6 @@
namespace {
using json = nlohmann::json;
const std::string _loggerCat = "iSWAComponent";
const ImVec2 size = ImVec2(350, 500);
}
namespace openspace {
@@ -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";
@@ -42,18 +42,18 @@ namespace {
int nVisibleProperties(const std::vector<properties::Property*>& properties,
properties::Property::Visibility visibility)
{
return std::count_if(
return static_cast<int>(std::count_if(
properties.begin(),
properties.end(),
[visibility](properties::Property* p) {
using V = properties::Property::Visibility;
return
static_cast<std::underlying_type_t<V>>(visibility) >=
static_cast<std::underlying_type_t<V>>(p->visibility());
}
);
}
using V = properties::Property::Visibility;
return
static_cast<std::underlying_type_t<V>>(visibility) >=
static_cast<std::underlying_type_t<V>>(p->visibility());
}
));
}
} // namespace
namespace gui {
+27 -17
View File
@@ -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<float>(*p);
float min = static_cast<float>(p->minValue());
float max = static_cast<float>(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<float>(std::min(p->minValue().x, p->minValue().y));
float max = static_cast<float>(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<float>(
std::min(std::min(p->minValue().x, p->minValue().y), p->minValue().z)
);
float max = static_cast<float>(
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<float>(
std::min(std::min(std::min(
p->minValue().x, p->minValue().y), p->minValue().z), p->minValue().w
)
);
float max = static_cast<float>(
std::max(std::max(std::max(
p->maxValue().x, p->maxValue().y), p->maxValue().z), p->maxValue().w
)
);
ImGui::SliderFloat4(
name.c_str(),