From 1c126218b68794d58cdc4d399a189da70c75e5ac Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sat, 26 Aug 2023 12:23:06 -0230 Subject: [PATCH] Fixes for warnings from clang. --- src/common/VideoModeHandler.cxx | 2 +- src/emucore/FrameBuffer.cxx | 7 ++++--- src/emucore/FrameBuffer.hxx | 4 ++-- src/gui/DeveloperDialog.cxx | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/common/VideoModeHandler.cxx b/src/common/VideoModeHandler.cxx index 8ef42324f..d220dcb18 100644 --- a/src/common/VideoModeHandler.cxx +++ b/src/common/VideoModeHandler.cxx @@ -46,7 +46,7 @@ const VideoModeHandler::Mode& { if(windowedRequested) { - const double zoom = settings.getFloat("tia.zoom"); + const double zoom = static_cast(settings.getFloat("tia.zoom")); ostringstream desc; desc << (zoom * 100) << "%"; diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 9237ba122..c78184c9d 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -204,7 +204,7 @@ void FrameBuffer::setupFonts() const int zoom_h = (fd.height * 4 * 2) / GUI::stellaMediumDesc.height; const int zoom_w = (fd.maxwidth * 4 * 2) / GUI::stellaMediumDesc.maxwidth; // round to 25% steps, >= 200% - myTIAMinZoom = std::max(std::max(zoom_w, zoom_h) / 4.F, 2.F); + myTIAMinZoom = std::max(std::max(zoom_w, zoom_h) / 4., 2.); } // The font used by the ROM launcher @@ -284,7 +284,8 @@ FBInitStatus FrameBuffer::createDisplay(string_view title, BufferType type, myBezel->load(); // Determine possible TIA windowed zoom levels - const double currentTIAZoom = myOSystem.settings().getFloat("tia.zoom"); + const double currentTIAZoom = + static_cast(myOSystem.settings().getFloat("tia.zoom")); myOSystem.settings().setValue("tia.zoom", BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom())); } @@ -1233,7 +1234,7 @@ void FrameBuffer::switchVideoMode(int direction) if(!fullScreen()) { // Windowed TIA modes support variable zoom levels - double zoom = myOSystem.settings().getFloat("tia.zoom"); + double zoom = static_cast(myOSystem.settings().getFloat("tia.zoom")); if(direction == +1) zoom += ZOOM_STEPS; else if(direction == -1) zoom -= ZOOM_STEPS; diff --git a/src/emucore/FrameBuffer.hxx b/src/emucore/FrameBuffer.hxx index cd65c7977..26ebc5335 100644 --- a/src/emucore/FrameBuffer.hxx +++ b/src/emucore/FrameBuffer.hxx @@ -575,7 +575,7 @@ class FrameBuffer bool enabled{false}; bool dirty{false}; bool showGauge{false}; - float value{0.0F}; + float value{0.F}; string valueText; }; Message myMsg; @@ -588,7 +588,7 @@ class FrameBuffer vector myHiDPIEnabled; // Minimum TIA zoom level that can be used for this framebuffer - double myTIAMinZoom{2.F}; + double myTIAMinZoom{2.}; // Holds a reference to all the surfaces that have been created std::list> mySurfaceList; diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index f162447cc..ae384995c 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -1410,7 +1410,7 @@ void DeveloperDialog::handleDebugColours(int idx, int color) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DeveloperDialog::handleDebugColours(string_view colors) { - for(int i = 0; i < DEBUG_COLORS && i < colors.length(); ++i) + for(int i = 0; i < DEBUG_COLORS && i < static_cast(colors.length()); ++i) { switch(colors[i]) {