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
+7 -5
View File
@@ -3,6 +3,8 @@
#include "RageFile.h"
#include "RageUtil.h"
#include "RageUtil_FileDB.h"
#include <cstddef>
#include <errno.h>
struct RageFileObjMemFile
@@ -49,12 +51,12 @@ RageFileObjMem::~RageFileObjMem()
RageFileObjMemFile::ReleaseReference( m_pFile );
}
int RageFileObjMem::ReadInternal( void *buffer, size_t bytes )
int RageFileObjMem::ReadInternal( void *buffer, std::size_t bytes )
{
LockMut(m_pFile->m_Mutex);
m_iFilePos = std::min( m_iFilePos, GetFileSize() );
bytes = std::min( bytes, (size_t) GetFileSize() - m_iFilePos );
bytes = std::min( bytes, (std::size_t) GetFileSize() - m_iFilePos );
if( bytes == 0 )
return 0;
memcpy( buffer, &m_pFile->m_sBuf[m_iFilePos], bytes );
@@ -63,7 +65,7 @@ int RageFileObjMem::ReadInternal( void *buffer, size_t bytes )
return bytes;
}
int RageFileObjMem::WriteInternal( const void *buffer, size_t bytes )
int RageFileObjMem::WriteInternal( const void *buffer, std::size_t bytes )
{
m_pFile->m_Mutex.Lock();
m_pFile->m_sBuf.replace( m_iFilePos, bytes, (const char *) buffer, bytes );
@@ -184,7 +186,7 @@ static struct FileDriverEntry_MEM: public FileDriverEntry
/*
* (c) 2004 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
@@ -194,7 +196,7 @@ static struct FileDriverEntry_MEM: public FileDriverEntry
* 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