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
+14 -12
View File
@@ -2,7 +2,7 @@
* This provides an interface to open files in RageFileManager's namespace
* This is just a simple RageFileBasic wrapper on top of another RageFileBasic;
* when a file is open, is acts like the underlying RageFileBasic, except that
* a few extra sanity checks are made to check file modes.
* a few extra sanity checks are made to check file modes.
*/
#include "global.h"
@@ -12,11 +12,13 @@
#include "RageUtil.h"
#include "RageFileDriver.h"
#include <cstddef>
RageFile::RageFile()
{
m_File = nullptr;
}
RageFile::RageFile( const RageFile &cpy ):
RageFileBasic( cpy )
{
@@ -143,7 +145,7 @@ void RageFile::SetError( const RString &err )
m_sError = err;
}
int RageFile::Read( void *pBuffer, size_t iBytes )
int RageFile::Read( void *pBuffer, std::size_t iBytes )
{
ASSERT_READ;
return m_File->Read( pBuffer, iBytes );
@@ -179,14 +181,14 @@ int RageFile::Read( RString &buffer, int bytes )
return m_File->Read( buffer, bytes );
}
int RageFile::Write( const void *buffer, size_t bytes )
int RageFile::Write( const void *buffer, std::size_t bytes )
{
ASSERT_WRITE;
return m_File->Write( buffer, bytes );
}
int RageFile::Write( const void *buffer, size_t bytes, int nmemb )
int RageFile::Write( const void *buffer, std::size_t bytes, int nmemb )
{
ASSERT_WRITE;
return m_File->Write( buffer, bytes, nmemb );
@@ -203,7 +205,7 @@ int RageFile::Flush()
return m_File->Flush();
}
int RageFile::Read( void *buffer, size_t bytes, int nmemb )
int RageFile::Read( void *buffer, std::size_t bytes, int nmemb )
{
ASSERT_READ;
return m_File->Read( buffer, bytes, nmemb );
@@ -317,7 +319,7 @@ int32_t FileReading::read_32_le( RageFileBasic &f, RString &sError )
// lua start
#include "LuaBinding.h"
/** @brief Allow Lua to have access to the RageFile. */
/** @brief Allow Lua to have access to the RageFile. */
class LunaRageFile: public Luna<RageFile>
{
public:
@@ -393,7 +395,7 @@ public:
lua_pushstring( L, string );
return 1;
}
static int ReadBytes( T* p, lua_State *L )
{
can_safely_read(p, L);
@@ -432,7 +434,7 @@ public:
lua_pushinteger( L, p->PutLine( SArg(1) ) );
return 1;
}
static int GetError( T* p, lua_State *L )
{
RString error;
@@ -440,13 +442,13 @@ public:
lua_pushstring( L, error );
return 1;
}
static int ClearError( T* p, lua_State *L )
{
p->ClearError();
return 1;
}
static int AtEOF( T* p, lua_State *L )
{
can_safely_read(p, L);
@@ -454,7 +456,7 @@ public:
return 1;
}
LunaRageFile()
LunaRageFile()
{
ADD_METHOD( Open );
ADD_METHOD( Close );