Skip to content

Commit

Permalink
Fix a couple linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Apr 27, 2024
1 parent 03f642c commit ee13e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/supertux/statistics.cpp
Expand Up @@ -96,7 +96,7 @@ void
Statistics::serialize_to_squirrel(SquirrelVM& vm) const
{
if (m_status != FINAL) return;

vm.begin_table("statistics");
vm.store_int("coins-collected", m_coins);
vm.store_int("badguys-killed", m_badguys);
Expand Down Expand Up @@ -485,18 +485,17 @@ Statistics::frags_to_string(int badguys, int total_badguys)
std::string
Statistics::time_to_string(float time)
{
int time_csecs = static_cast<int>(time * 100);
int mins = (time_csecs / 6000);
int secs = (time_csecs % 6000) / 100;
int cscs = (time_csecs % 6000) % 100;

std::ostringstream os;
if (time == 0.0f)
{
os << "--:--:--";
}
else
{
int time_csecs = static_cast<int>(time * 100);
int mins = (time_csecs / 6000);
int secs = (time_csecs % 6000) / 100;
int cscs = (time_csecs % 6000) % 100;
os << std::setw(2) << std::setfill('0') << mins << ":" << std::setw(2) << std::setfill('0') << secs << "." << std::setw(2) << std::setfill('0') << cscs;
}

Expand Down
2 changes: 1 addition & 1 deletion src/video/bitmap_font.cpp
Expand Up @@ -38,7 +38,7 @@ namespace {

bool vline_empty(const SDLSurfacePtr& surface, int x, int start_y, int end_y, Uint8 threshold)
{
Uint8* pixels = static_cast<Uint8*>(surface->pixels);
const Uint8* pixels = static_cast<Uint8*>(surface->pixels);

for (int y = start_y; y < end_y; ++y)
{
Expand Down

0 comments on commit ee13e2d

Please sign in to comment.