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
+24 -23
View File
@@ -4,7 +4,8 @@
#define GAME_CONSTANTS_AND_TYPES_H
#include "EnumHelper.h"
#include <float.h> // need the max for default.
#include <cfloat>
// Note definitions
/** @brief Define the mininum difficulty value allowed. */
@@ -149,12 +150,12 @@ const RString& PlayModeToLocalizedString( PlayMode pm );
PlayMode StringToPlayMode( const RString& s );
LuaDeclareType( PlayMode );
/**
/**
* @brief The list of ways to sort songs and courses.
*
* All song sorts should be listed before course sorts.
*/
enum SortOrder
enum SortOrder
{
// song sorts
SORT_PREFERRED, /**< Sort by the user's preferred settings. */
@@ -216,7 +217,7 @@ LuaDeclareType( SortOrder );
inline bool IsSongSort( SortOrder so ) { return (so >= SORT_PREFERRED && so <= SORT_DOUBLE_CHALLENGE_METER) || so == SORT_LENGTH; }
/** @brief The list of tap note scores available during play. */
enum TapNoteScore {
enum TapNoteScore {
TNS_None, /**< There is no score involved with this one. */
TNS_HitMine, /**< A mine was hit successfully. */
TNS_AvoidMine, /**< A mine was avoided successfully. */
@@ -252,8 +253,8 @@ TapNoteScore StringToTapNoteScore( const RString& str );
LuaDeclareType( TapNoteScore );
/** @brief The list of hold note scores available during play. */
enum HoldNoteScore
{
enum HoldNoteScore
{
HNS_None, /**< The HoldNote was not scored yet. */
HNS_LetGo, /**< The HoldNote has passed, but the player missed it. */
HNS_Held, /**< The HoldNote has passed, and was successfully held all the way. */
@@ -352,11 +353,11 @@ LuaDeclareType( ProfileSlot );
/** @brief The states of the memory card during play. */
enum MemoryCardState
{
MemoryCardState_Ready,
MemoryCardState_Checking,
MemoryCardState_TooLate,
MemoryCardState_Error,
{
MemoryCardState_Ready,
MemoryCardState_Checking,
MemoryCardState_TooLate,
MemoryCardState_Error,
MemoryCardState_Removed,
MemoryCardState_NoCard,
NUM_MemoryCardState,
@@ -489,8 +490,8 @@ StageAward StringToStageAward( const RString& pma );
LuaDeclareType( StageAward );
/** @brief The various peak combo awards should such a combo be attained during play. */
enum PeakComboAward
{
enum PeakComboAward
{
PeakComboAward_1000,
PeakComboAward_2000,
PeakComboAward_3000,
@@ -565,10 +566,10 @@ StyleType StringToStyleType( const RString& s );
LuaDeclareType( StyleType );
/** @brief The different goal types, mainly meant for fitness modes. */
enum GoalType
enum GoalType
{
GoalType_Calories,
GoalType_Time,
GoalType_Calories,
GoalType_Time,
GoalType_None,
NUM_GoalType,
GoalType_Invalid,
@@ -606,8 +607,8 @@ LuaDeclareType( EditMode );
enum SampleMusicPreviewMode
{
SampleMusicPreviewMode_Normal, /**< Music is played as the song is highlighted. */
SampleMusicPreviewMode_StartToPreview,
SampleMusicPreviewMode_ScreenMusic, /**< No music plays. Select it once to preview the music,
SampleMusicPreviewMode_StartToPreview,
SampleMusicPreviewMode_ScreenMusic, /**< No music plays. Select it once to preview the music,
* then once more to select the song. */
SampleMusicPreviewMode_LastSong, /**< continue playing the last song */
NUM_SampleMusicPreviewMode,
@@ -630,7 +631,7 @@ enum Stage
Stage_4th, /**< The fourth stage. */
Stage_5th, /**< The fifth stage. */
Stage_6th, /**< The sixth stage. */
Stage_Next, /**< Somewhere between the sixth and final stage.
Stage_Next, /**< Somewhere between the sixth and final stage.
* This won't normally happen because 7 stages is the max in the UI. */
Stage_Final, /**< The last stage. */
Stage_Extra1, /**< The first bonus stage, AKA the extra stage. */
@@ -662,8 +663,8 @@ LuaDeclareType( EarnedExtraStage );
/** @brief The different results of loading a profile. */
enum ProfileLoadResult
{
ProfileLoadResult_Success,
ProfileLoadResult_FailedNoProfile,
ProfileLoadResult_Success,
ProfileLoadResult_FailedNoProfile,
ProfileLoadResult_FailedTampered
};
@@ -718,7 +719,7 @@ LuaDeclareType( FailType );
* @author Chris Danford, Chris Gomez (c) 2001-2004
* @section LICENSE
* 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
@@ -728,7 +729,7 @@ LuaDeclareType( FailType );
* 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