Clean up math functions

- Remove checking for standard functions from the build system
- Prefix all invocations with std::
- Replace suffixed functions with unprefixed versions
- Include <cmath> in all files that use it and remove the global include

e.g. floorf(x) -> std::floor(x)
This commit is contained in:
Martin Natano
2023-04-19 14:22:59 +02:00
parent f39ed52dbf
commit b68ca517e6
111 changed files with 1831 additions and 1785 deletions
+6 -4
View File
@@ -8,6 +8,8 @@
#include "MenuTimer.h"
#include "MemoryCardManager.h"
#include <cmath>
REGISTER_SCREEN_CLASS( ScreenContinue );
@@ -25,7 +27,7 @@ void ScreenContinue::BeginScreen()
GAMESTATE->SetCurrentStyle( nullptr, PLAYER_INVALID );
// Unjoin human players with 0 stages left and reset non-human players.
// We need to reset non-human players because data in non-human (CPU)
// We need to reset non-human players because data in non-human (CPU)
// players will be filled, and there may be stale pointers to things like
// edit Steps.
FOREACH_ENUM( PlayerNumber, p )
@@ -69,7 +71,7 @@ bool ScreenContinue::Input( const InputEventPlus &input )
case GAME_BUTTON_LEFT:
case GAME_BUTTON_RIGHT:
{
float fSeconds = floorf(m_MenuTimer->GetSeconds()) - 0.0001f;
float fSeconds = std::floor(m_MenuTimer->GetSeconds()) - 0.0001f;
fSeconds = std::max( fSeconds, 0.0001f ); // don't set to 0
m_MenuTimer->SetSeconds( fSeconds );
Message msg("HurryTimer");
@@ -123,7 +125,7 @@ void ScreenContinue::HandleMessage( const Message &msg )
/*
* (c) 2004 Chris Danford
* All rights reserved.
*
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
@@ -133,7 +135,7 @@ void ScreenContinue::HandleMessage( const Message &msg )
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF