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 -13
View File
@@ -12,6 +12,8 @@
#include "GameState.h" // blame radar calculations.
#include "RageUtil_AutoPtr.h"
#include <cstddef>
REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) )
void NoteData::Init()
@@ -407,7 +409,7 @@ bool NoteData::IsHoldNoteAtRow( int iTrack, int iRow, int *pHeadRow ) const
}
bool NoteData::IsEmpty() const
{
{
for( int t=0; t < GetNumTracks(); t++ )
{
int iRow = -1;
@@ -421,7 +423,7 @@ bool NoteData::IsEmpty() const
}
int NoteData::GetFirstRow() const
{
{
int iEarliestRowFoundSoFar = -1;
for( int t=0; t < GetNumTracks(); t++ )
@@ -443,7 +445,7 @@ int NoteData::GetFirstRow() const
}
int NoteData::GetLastRow() const
{
{
int iOldestRowFoundSoFar = 0;
for( int t=0; t < GetNumTracks(); t++ )
@@ -702,14 +704,14 @@ int NoteData::GetNumLifts( int iStartIndex, int iEndIndex ) const
int NoteData::GetNumFakes( int iStartIndex, int iEndIndex ) const
{
int iNumFakes = 0;
for( int t=0; t<GetNumTracks(); t++ )
{
FOREACH_NONEMPTY_ROW_IN_TRACK_RANGE( *this, t, r, iStartIndex, iEndIndex )
if( this->IsFake(GetTapNote(t, r), r))
iNumFakes++;
}
return iNumFakes;
}
@@ -922,7 +924,7 @@ void NoteData::LoadTransformed( const NoteData& in, int iNewNumTracks, const int
for( int t=0; t<GetNumTracks(); t++ )
{
const int iOriginalTrack = iOriginalTrackToTakeFrom[t];
ASSERT_M( iOriginalTrack < in.GetNumTracks(), ssprintf("from OriginalTrack %i >= %i (#tracks) (taking from %i)",
ASSERT_M( iOriginalTrack < in.GetNumTracks(), ssprintf("from OriginalTrack %i >= %i (#tracks) (taking from %i)",
iOriginalTrack, in.GetNumTracks(), iOriginalTrackToTakeFrom[t]));
if( iOriginalTrack == -1 )
@@ -981,7 +983,7 @@ bool NoteData::GetNextTapNoteRowForTrack( int track, int &rowInOut, bool ignoreA
{
const TrackMap &mapTrack = m_TapNotes[track];
// lower_bound and upper_bound have the same effect here because duplicate
// lower_bound and upper_bound have the same effect here because duplicate
// keys aren't allowed.
// lower_bound "finds the first element whose key is not less than k" (>=);
@@ -1016,7 +1018,7 @@ bool NoteData::GetPrevTapNoteRowForTrack( int track, int &rowInOut ) const
return false;
// Move back by one.
--iter;
--iter;
ASSERT( iter->first < rowInOut );
rowInOut = iter->first;
return true;
@@ -1407,12 +1409,12 @@ template<typename ND, typename iter, typename TN>
if(added)
{
int avg_row= 0;
for(size_t p= 0; p < m_PrevCurrentRows.size(); ++p)
for(std::size_t p= 0; p < m_PrevCurrentRows.size(); ++p)
{
avg_row+= m_PrevCurrentRows[p];
}
avg_row/= m_PrevCurrentRows.size();
for(size_t a= 0; a < added_or_removed_tracks.size(); ++a)
for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a)
{
int track_id= added_or_removed_tracks[a];
m_PrevCurrentRows.insert(m_PrevCurrentRows.begin()+track_id, avg_row);
@@ -1423,7 +1425,7 @@ template<typename ND, typename iter, typename TN>
}
else
{
for(size_t a= 0; a < added_or_removed_tracks.size(); ++a)
for(std::size_t a= 0; a < added_or_removed_tracks.size(); ++a)
{
int track_id= added_or_removed_tracks[a];
m_PrevCurrentRows.erase(m_PrevCurrentRows.begin()+track_id);
@@ -1496,7 +1498,7 @@ template class NoteData::_all_tracks_iterator<const NoteData, NoteData::const_it
/*
* (c) 2001-2004 Chris Danford, Glenn Maynard
* 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
@@ -1506,7 +1508,7 @@ template class NoteData::_all_tracks_iterator<const NoteData, NoteData::const_it
* 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