From c96ab29e957a035d57ff4093bf28e87bcd130665 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 27 Feb 2022 15:23:33 +0100 Subject: [PATCH] Fixed a few GCC compiler warnings. --- es-app/src/views/SystemView.cpp | 2 -- es-core/src/components/CarouselComponent.cpp | 10 +++++----- es-core/src/components/VideoComponent.cpp | 3 --- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index d0a14fcd1..05b6bf38a 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -531,7 +531,6 @@ void SystemView::updateGameCount() std::stringstream ssGames; std::stringstream ssFavorites; bool games {false}; - bool favorites {false}; if (!mCarousel->getSelected()->isGameSystem()) { ss << "Configuration"; @@ -553,7 +552,6 @@ void SystemView::updateGameCount() ssGames << gameCount.first << " Game" << (gameCount.first == 1 ? " " : "s "); ssFavorites << gameCount.second << " Favorite" << (gameCount.second == 1 ? "" : "s"); games = true; - favorites = true; } if (mLegacyMode) { diff --git a/es-core/src/components/CarouselComponent.cpp b/es-core/src/components/CarouselComponent.cpp index 6226722c8..b4b6d9e03 100644 --- a/es-core/src/components/CarouselComponent.cpp +++ b/es-core/src/components/CarouselComponent.cpp @@ -264,12 +264,12 @@ void CarouselComponent::render(const glm::mat4& parentTrans) float distance = i - mCamOffset; - float scale {1.0f + ((mLogoScale - 1.0f) * (1.0f - fabs(distance)))}; + float scale {1.0f + ((mLogoScale - 1.0f) * (1.0f - fabsf(distance)))}; scale = std::min(mLogoScale, std::max(1.0f, scale)); scale /= mLogoScale; int opacity { - static_cast(std::round(0x80 + ((0xFF - 0x80) * (1.0f - fabs(distance)))))}; + static_cast(std::round(0x80 + ((0xFF - 0x80) * (1.0f - fabsf(distance)))))}; opacity = std::max(static_cast(0x80), opacity); const std::shared_ptr& comp = mEntries.at(index).data.logo; @@ -504,11 +504,11 @@ void CarouselComponent::onCursorChanged(const CursorState& state) // Find the shortest path to the target. float endPos {target}; // Directly. - float dist {fabs(endPos - startPos)}; + float dist {fabsf(endPos - startPos)}; - if (fabs(target + posMax - startPos - mScrollVelocity) < dist) + if (fabsf(target + posMax - startPos - mScrollVelocity) < dist) endPos = target + posMax; // Loop around the end (0 -> max). - if (fabs(target - posMax - startPos - mScrollVelocity) < dist) + if (fabsf(target - posMax - startPos - mScrollVelocity) < dist) endPos = target - posMax; // Loop around the start (max - 1 -> -1). // Make sure there are no reverse jumps between logos. diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index ab7123a4d..29ba4a38b 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -223,14 +223,11 @@ void VideoComponent::update(int deltaTime) if (mWindow->getGameLaunchedState()) return; - bool playVideo {false}; - if (!mIsPlaying && mConfig.startDelay == 0) { startVideoStream(); } else if (mStartTime == 0 || SDL_GetTicks() > mStartTime) { mStartTime = 0; - playVideo = true; startVideoStream(); }