Decouple <cstddef>

This commit is contained in:
Martin Natano
2023-04-19 23:04:25 +02:00
parent 093675cdc3
commit 78fb2e9fc3
171 changed files with 2012 additions and 1786 deletions
+15 -14
View File
@@ -8,6 +8,7 @@
#include "RadarValues.h"
#include <algorithm>
#include <cstddef>
ThemeMetric<RString> EMPTY_NAME("HighScore","EmptyName");
@@ -41,7 +42,7 @@ struct HighScoreImpl
bool operator!=( const HighScoreImpl& other ) const { return !(*this == other); }
};
bool HighScoreImpl::operator==( const HighScoreImpl& other ) const
bool HighScoreImpl::operator==( const HighScoreImpl& other ) const
{
#define COMPARE(x) if( x!=other.x ) return false;
COMPARE( sName );
@@ -265,7 +266,7 @@ bool HighScore::operator>=( const HighScore& other ) const
return !operator<(other);
}
bool HighScore::operator==( const HighScore& other ) const
bool HighScore::operator==( const HighScore& other ) const
{
return *m_Impl == *other.m_Impl;
}
@@ -280,7 +281,7 @@ XNode* HighScore::CreateNode() const
return m_Impl->CreateNode();
}
void HighScore::LoadFromNode( const XNode* pNode )
void HighScore::LoadFromNode( const XNode* pNode )
{
m_Impl->LoadFromNode( pNode );
}
@@ -309,8 +310,8 @@ void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut, bool bIsMachine
if( hs >= vHighScores[i] )
break;
}
const int iMaxScores = bIsMachine ?
PREFSMAN->m_iMaxHighScoresPerListForMachine :
const int iMaxScores = bIsMachine ?
PREFSMAN->m_iMaxHighScoresPerListForMachine :
PREFSMAN->m_iMaxHighScoresPerListForPlayer;
if( i < iMaxScores )
{
@@ -318,7 +319,7 @@ void HighScoreList::AddHighScore( HighScore hs, int &iIndexOut, bool bIsMachine
iIndexOut = i;
// Delete extra machine high scores in RemoveAllButOneOfEachNameAndClampSize
// and not here so that we don't end up with less than iMaxScores after
// and not here so that we don't end up with less than iMaxScores after
// removing HighScores with duplicate names.
//
if( !bIsMachine )
@@ -420,8 +421,8 @@ void HighScoreList::RemoveAllButOneOfEachName()
void HighScoreList::ClampSize( bool bIsMachine )
{
const int iMaxScores = bIsMachine ?
PREFSMAN->m_iMaxHighScoresPerListForMachine :
const int iMaxScores = bIsMachine ?
PREFSMAN->m_iMaxHighScoresPerListForMachine :
PREFSMAN->m_iMaxHighScoresPerListForPlayer;
if( vHighScores.size() > unsigned(iMaxScores) )
vHighScores.erase( vHighScores.begin()+iMaxScores, vHighScores.end() );
@@ -457,7 +458,7 @@ XNode* Screenshot::CreateNode() const
return pNode;
}
void Screenshot::LoadFromNode( const XNode* pNode )
void Screenshot::LoadFromNode( const XNode* pNode )
{
ASSERT( pNode->GetName() == "Screenshot" );
@@ -542,7 +543,7 @@ public:
static int GetHighestScoreOfName( T* p, lua_State *L )
{
RString name= SArg(1);
for(size_t i= 0; i < p->vHighScores.size(); ++i)
for(std::size_t i= 0; i < p->vHighScores.size(); ++i)
{
if(name == p->vHighScores[i].GetName())
{
@@ -557,8 +558,8 @@ public:
static int GetRankOfName( T* p, lua_State *L )
{
RString name= SArg(1);
size_t rank= 0;
for(size_t i= 0; i < p->vHighScores.size(); ++i)
std::size_t rank= 0;
for(std::size_t i= 0; i < p->vHighScores.size(); ++i)
{
if(name == p->vHighScores[i].GetName())
{
@@ -586,7 +587,7 @@ LUA_REGISTER_CLASS( HighScoreList )
/*
* (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
@@ -596,7 +597,7 @@ LUA_REGISTER_CLASS( HighScoreList )
* 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