Decouple <cstddef>

This commit is contained in:
Martin Natano
2023-04-20 11:21:29 +02:00
parent 093675cdc3
commit 78fb2e9fc3
171 changed files with 2012 additions and 1786 deletions
+15 -12
View File
@@ -6,6 +6,9 @@
#include "EnumHelper.h"
#include "LuaManager.h"
#include "RageUtil.h"
#include <cstddef>
class XNode;
enum class PreferenceType
@@ -14,7 +17,7 @@ enum class PreferenceType
// This is the default behavior.
Mutable,
// Mark the preference as read-only i.e. don't allow setting of the
// Mark the preference as read-only i.e. don't allow setting of the
// preference through Lua.
Immutable,
@@ -80,7 +83,7 @@ public:
{
if( !StringConversion::FromString<T>(s, m_currentValue) )
m_currentValue = m_defaultValue;
if( m_pfnValidate )
if( m_pfnValidate )
m_pfnValidate( m_currentValue );
}
void SetFromStack( lua_State *L )
@@ -109,7 +112,7 @@ public:
{
return m_currentValue;
}
const T &GetDefault() const
{
return m_defaultValue;
@@ -119,7 +122,7 @@ public:
{
return Get();
}
void Set( const T& other )
{
m_currentValue = other;
@@ -148,10 +151,10 @@ class Preference1D
public:
typedef Preference<T> PreferenceT;
std::vector<PreferenceT*> m_v;
Preference1D( void pfn(size_t i, RString &sNameOut, T &defaultValueOut ), size_t N, PreferenceType type = PreferenceType::Mutable )
Preference1D( void pfn(std::size_t i, RString &sNameOut, T &defaultValueOut ), std::size_t N, PreferenceType type = PreferenceType::Mutable )
{
for( size_t i=0; i<N; ++i )
for( std::size_t i=0; i<N; ++i )
{
RString sName;
T defaultValue;
@@ -162,14 +165,14 @@ public:
~Preference1D()
{
for( size_t i=0; i<m_v.size(); ++i )
for( std::size_t i=0; i<m_v.size(); ++i )
SAFE_DELETE( m_v[i] );
}
const Preference<T>& operator[]( size_t i ) const
const Preference<T>& operator[]( std::size_t i ) const
{
return *m_v[i];
}
Preference<T>& operator[]( size_t i )
Preference<T>& operator[]( std::size_t i )
{
return *m_v[i];
}
@@ -180,7 +183,7 @@ public:
/*
* (c) 2001-2004 Chris Danford, Chris Gomez
* 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
@@ -190,7 +193,7 @@ public:
* 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