Fixes for warnings from clang.

This commit is contained in:
Stephen Anthony 2023-08-26 12:23:06 -02:30
parent df34de46ab
commit 1c126218b6
4 changed files with 8 additions and 7 deletions

View File

@ -46,7 +46,7 @@ const VideoModeHandler::Mode&
{ {
if(windowedRequested) if(windowedRequested)
{ {
const double zoom = settings.getFloat("tia.zoom"); const double zoom = static_cast<double>(settings.getFloat("tia.zoom"));
ostringstream desc; ostringstream desc;
desc << (zoom * 100) << "%"; desc << (zoom * 100) << "%";

View File

@ -204,7 +204,7 @@ void FrameBuffer::setupFonts()
const int zoom_h = (fd.height * 4 * 2) / GUI::stellaMediumDesc.height; const int zoom_h = (fd.height * 4 * 2) / GUI::stellaMediumDesc.height;
const int zoom_w = (fd.maxwidth * 4 * 2) / GUI::stellaMediumDesc.maxwidth; const int zoom_w = (fd.maxwidth * 4 * 2) / GUI::stellaMediumDesc.maxwidth;
// round to 25% steps, >= 200% // 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 // The font used by the ROM launcher
@ -284,7 +284,8 @@ FBInitStatus FrameBuffer::createDisplay(string_view title, BufferType type,
myBezel->load(); myBezel->load();
// Determine possible TIA windowed zoom levels // Determine possible TIA windowed zoom levels
const double currentTIAZoom = myOSystem.settings().getFloat("tia.zoom"); const double currentTIAZoom =
static_cast<double>(myOSystem.settings().getFloat("tia.zoom"));
myOSystem.settings().setValue("tia.zoom", myOSystem.settings().setValue("tia.zoom",
BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom())); BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
} }
@ -1233,7 +1234,7 @@ void FrameBuffer::switchVideoMode(int direction)
if(!fullScreen()) if(!fullScreen())
{ {
// Windowed TIA modes support variable zoom levels // Windowed TIA modes support variable zoom levels
double zoom = myOSystem.settings().getFloat("tia.zoom"); double zoom = static_cast<double>(myOSystem.settings().getFloat("tia.zoom"));
if(direction == +1) zoom += ZOOM_STEPS; if(direction == +1) zoom += ZOOM_STEPS;
else if(direction == -1) zoom -= ZOOM_STEPS; else if(direction == -1) zoom -= ZOOM_STEPS;

View File

@ -575,7 +575,7 @@ class FrameBuffer
bool enabled{false}; bool enabled{false};
bool dirty{false}; bool dirty{false};
bool showGauge{false}; bool showGauge{false};
float value{0.0F}; float value{0.F};
string valueText; string valueText;
}; };
Message myMsg; Message myMsg;
@ -588,7 +588,7 @@ class FrameBuffer
vector<bool> myHiDPIEnabled; vector<bool> myHiDPIEnabled;
// Minimum TIA zoom level that can be used for this framebuffer // 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 // Holds a reference to all the surfaces that have been created
std::list<shared_ptr<FBSurface>> mySurfaceList; std::list<shared_ptr<FBSurface>> mySurfaceList;

View File

@ -1410,7 +1410,7 @@ void DeveloperDialog::handleDebugColours(int idx, int color)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::handleDebugColours(string_view colors) 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<int>(colors.length()); ++i)
{ {
switch(colors[i]) switch(colors[i])
{ {