Skip to content

Commit

Permalink
Fixes for warnings from clang.
Browse files Browse the repository at this point in the history
  • Loading branch information
sa666666 committed Aug 26, 2023
1 parent df34de4 commit 1c12621
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/common/VideoModeHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const VideoModeHandler::Mode&
{
if(windowedRequested)
{
const double zoom = settings.getFloat("tia.zoom");
const double zoom = static_cast<double>(settings.getFloat("tia.zoom"));
ostringstream desc;
desc << (zoom * 100) << "%";

Expand Down
7 changes: 4 additions & 3 deletions src/emucore/FrameBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<double>(myOSystem.settings().getFloat("tia.zoom"));
myOSystem.settings().setValue("tia.zoom",
BSPF::clampw(currentTIAZoom, supportedTIAMinZoom(), supportedTIAMaxZoom()));
}
Expand Down Expand Up @@ -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<double>(myOSystem.settings().getFloat("tia.zoom"));
if(direction == +1) zoom += ZOOM_STEPS;
else if(direction == -1) zoom -= ZOOM_STEPS;

Expand Down
4 changes: 2 additions & 2 deletions src/emucore/FrameBuffer.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -588,7 +588,7 @@ class FrameBuffer
vector<bool> 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<shared_ptr<FBSurface>> mySurfaceList;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/DeveloperDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(colors.length()); ++i)
{
switch(colors[i])
{
Expand Down

0 comments on commit 1c12621

Please sign in to comment.