Remove warnings on MSVC

This commit is contained in:
Alexander Bock
2023-04-26 23:51:16 +02:00
parent bba5fe6eaa
commit 6dfd0cd3a8
11 changed files with 23 additions and 21 deletions

View File

@@ -687,7 +687,7 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) {
return;
}
}
catch (const std::runtime_error& e) {
catch (const std::runtime_error&) {
// Ignore an exception here because clicking the edit button will
// bring up an explanatory error message
}

View File

@@ -241,8 +241,8 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary)
}
else {
// Recompute relative values to meters
_startOffset = _startOffset * startNode->boundingSphere();
_endOffset = _endOffset * endNode->boundingSphere();
_startOffset = static_cast<float>(_startOffset * startNode->boundingSphere());
_endOffset = static_cast<float>(_endOffset * endNode->boundingSphere());
}
});
}

View File

@@ -239,7 +239,7 @@ void RenderableTrailTrajectory::update(const UpdateData& data) {
unsigned int stopIndex = std::min(nextIndex, _numberOfVertices);
// Calculate all vertex positions
for (int i = startIndex; i < stopIndex; ++i) {
for (unsigned int i = startIndex; i < stopIndex; ++i) {
const glm::vec3 p = _translation->position({
{},
Time(_start + i * _totalSampleInterval),

View File

@@ -422,8 +422,12 @@ void GeoJsonProperties::createFromDictionary(const ghoul::Dictionary& dictionary
// Distances are computed based on a certain lat/long angle size
constexpr float DefaultAngle = glm::radians(1.f);
constexpr float MaxAngle = glm::radians(45.f);
float defaultDistance = globe.ellipsoid().longitudalDistance(0.f, 0.f, DefaultAngle);
float maxDistance = globe.ellipsoid().longitudalDistance(0.f, 0.f, MaxAngle);
float defaultDistance = static_cast<float>(
globe.ellipsoid().longitudalDistance(0.f, 0.f, DefaultAngle)
);
float maxDistance = static_cast<float>(
globe.ellipsoid().longitudalDistance(0.f, 0.f, MaxAngle)
);
tessellation.distance = defaultDistance;
tessellation.distance.setMaxValue(maxDistance);

View File

@@ -575,8 +575,6 @@ std::vector<std::vector<glm::vec3>> GlobeGeometryFeature::createLineGeometry() {
continue;
}
float length = static_cast<float>(glm::distance(lastPos, v));
if (_properties.tessellationEnabled()) {
// Tessellate.
// But first, determine the step size for the tessellation (larger

View File

@@ -112,7 +112,7 @@ nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const {
return phaseJson;
}
void MissionTopic::handleJson(const nlohmann::json& input) {
void MissionTopic::handleJson(const nlohmann::json&) {
nlohmann::json data = { {"missions", missionJson()} };
_connection->sendJson(wrappedPayload(data));
}

View File

@@ -328,7 +328,7 @@ TouchInteraction::TouchInteraction()
glm::vec4(0.2f)
)
, _constTimeDecay_secs(ConstantTimeDecaySecsInfo, 1.75f, 0.1f, 4.f)
, _pinchInputs({ TouchInput(0, 0, 0.0, 0.0, 0.0), TouchInput(0, 0, 0.0, 0.0, 0.0) })
, _pinchInputs({ TouchInput(0, 0, 0.f, 0.f, 0.0), TouchInput(0, 0, 0.f, 0.f, 0.0) })
, _vel{ glm::dvec2(0.0), 0.0, 0.0, glm::dvec2(0.0) }
, _sensitivity{ glm::dvec2(0.08, 0.045), 12.0, 2.75, glm::dvec2(0.08, 0.045) }
// Calculated with two vectors with known diff in length, then

View File

@@ -745,11 +745,11 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) {
break;
}
if (list->keys[i] == "w") {
if (std::string_view(list->keys[i]) == "w") {
width = list->values[i];
foundWidth = true;
}
else if (list->keys[i] == "h") {
else if (std::string_view(list->keys[i]) == "h") {
height = list->values[i];
foundHeight = true;
}
@@ -763,10 +763,10 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) {
int w = -1;
int h = -1;
if (width.format == MPV_FORMAT_INT64) {
w = width.u.int64;
w = static_cast<int>(width.u.int64);
}
if (height.format == MPV_FORMAT_INT64) {
h = height.u.int64;
h = static_cast<int>(height.u.int64);
}
if (w == -1 || h == -1) {

View File

@@ -112,8 +112,8 @@ void VideoTileProvider::reset() {
globebrowsing::ChunkTile VideoTileProvider::chunkTile(globebrowsing::TileIndex tileIndex,
int parents, int maxParents) {
using namespace globebrowsing;
std::function<void(TileIndex&, TileUvTransform&)> ascendToParent = []
(TileIndex& ti, TileUvTransform& uv) {
std::function<void(TileIndex&, TileUvTransform&)> ascendToParent =
[](TileIndex& ti, TileUvTransform&) {
ti.level--;
};

View File

@@ -435,9 +435,9 @@ OrbitalNavigator::LimitZoom::LimitZoom()
, enableZoomOutLimit(EnabledMaximumDistanceInfo, false)
, maximumAllowedDistance(
MaximumDistanceInfo,
4e+27,
4e+27f,
50.f,
4e+27
4e+27f
)
{
// Min
@@ -724,7 +724,7 @@ void OrbitalNavigator::updateStatesFromInput(const MouseInputState& mouseInputSt
_movementTimer = _idleBehavior.idleWaitTime;
}
else if (!cameraLocationChanged) {
tickMovementTimer(deltaTime);
tickMovementTimer(static_cast<float>(deltaTime));
}
}

View File

@@ -36,7 +36,7 @@ namespace {
double is = node->interactionSphere();
global::navigationHandler->orbitalNavigator().setMinimumAllowedDistance(
is * multiplier
static_cast<float>(is * multiplier)
);
}
@@ -52,7 +52,7 @@ namespace {
double is = node->interactionSphere();
global::navigationHandler->orbitalNavigator().setMaximumAllowedDistance(
is * multiplier
static_cast<float>(is * multiplier)
);
}