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 19:31:40 +02:00
parent f39ed52dbf
commit b68ca517e6
111 changed files with 1831 additions and 1785 deletions
+6 -4
View File
@@ -14,6 +14,8 @@
#include "CommonMetrics.h"
#include "Style.h"
#include <cmath>
const RString DEFAULT_LIGHTS_DRIVER = "SystemMessage,Export";
static Preference<RString> g_sLightsDriver( "LightsDriver", "" ); // "" == DEFAULT_LIGHTS_DRIVER
Preference<float> g_fLightsFalloffSeconds( "LightsFalloffSeconds", 0.1f );
@@ -129,7 +131,7 @@ LightsManager::~LightsManager()
// XXX: Allow themer to change these. (rewritten; who wrote original? -aj)
static const float g_fLightEffectRiseSeconds = 0.075f;
static const float g_fLightEffectFalloffSeconds = 0.35f;
static const float g_fCoinPulseTime = 0.100f;
static const float g_fCoinPulseTime = 0.100f;
void LightsManager::BlinkActorLight( CabinetLight cl )
{
m_fSecsLeftInActorLightBlink[cl] = g_fLightEffectRiseSeconds;
@@ -203,7 +205,7 @@ void LightsManager::Update( float fDeltaTime )
if( m_LightsMode == LIGHTSMODE_TEST_AUTO_CYCLE )
{
m_fTestAutoCycleCurrentIndex += fDeltaTime;
m_fTestAutoCycleCurrentIndex = fmodf( m_fTestAutoCycleCurrentIndex, NUM_CabinetLight*100 );
m_fTestAutoCycleCurrentIndex = std::fmod( m_fTestAutoCycleCurrentIndex, NUM_CabinetLight*100 );
}
switch( m_LightsMode )
@@ -533,7 +535,7 @@ void LightsManager::TurnOffAllLights()
/*
* (c) 2003-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
@@ -543,7 +545,7 @@ void LightsManager::TurnOffAllLights()
* 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