mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 08:25:18 +01:00
switch to size_t
This commit is contained in:
parent
e36d4f5db0
commit
c18b452a00
@ -650,10 +650,10 @@ FreeSaveBuffer ()
|
||||
* Loads the selected file # from the specified 7z into rbuffer
|
||||
* Returns file size
|
||||
***************************************************************************/
|
||||
u32
|
||||
size_t
|
||||
LoadSzFile(char * filepath, unsigned char * rbuffer)
|
||||
{
|
||||
u32 size = 0;
|
||||
size_t size = 0;
|
||||
|
||||
// stop checking if devices were removed/inserted
|
||||
// since we're loading a file
|
||||
@ -682,12 +682,12 @@ LoadSzFile(char * filepath, unsigned char * rbuffer)
|
||||
/****************************************************************************
|
||||
* LoadFile
|
||||
***************************************************************************/
|
||||
u32
|
||||
LoadFile (char * rbuffer, char *filepath, u32 length, bool silent)
|
||||
size_t
|
||||
LoadFile (char * rbuffer, char *filepath, size_t length, bool silent)
|
||||
{
|
||||
char zipbuffer[2048];
|
||||
u32 size = 0;
|
||||
u32 readsize = 0;
|
||||
size_t size = 0;
|
||||
size_t readsize = 0;
|
||||
int retry = 1;
|
||||
int device;
|
||||
|
||||
@ -738,8 +738,8 @@ LoadFile (char * rbuffer, char *filepath, u32 length, bool silent)
|
||||
|
||||
memcpy (rbuffer, zipbuffer, readsize); // copy what we already read
|
||||
|
||||
u32 offset = readsize;
|
||||
u32 nextread = 0;
|
||||
size_t offset = readsize;
|
||||
size_t nextread = 0;
|
||||
while(offset < size)
|
||||
{
|
||||
if(size - offset > 4*1024) nextread = 4*1024;
|
||||
@ -784,7 +784,7 @@ LoadFile (char * rbuffer, char *filepath, u32 length, bool silent)
|
||||
return size;
|
||||
}
|
||||
|
||||
u32 LoadFile(char * filepath, bool silent)
|
||||
size_t LoadFile(char * filepath, bool silent)
|
||||
{
|
||||
return LoadFile((char *)savebuffer, filepath, 0, silent);
|
||||
}
|
||||
@ -793,10 +793,10 @@ u32 LoadFile(char * filepath, bool silent)
|
||||
* SaveFile
|
||||
* Write buffer to file
|
||||
***************************************************************************/
|
||||
u32
|
||||
SaveFile (char * buffer, char *filepath, u32 datasize, bool silent)
|
||||
size_t
|
||||
SaveFile (char * buffer, char *filepath, size_t datasize, bool silent)
|
||||
{
|
||||
u32 written = 0;
|
||||
size_t written = 0;
|
||||
int retry = 1;
|
||||
int device;
|
||||
|
||||
@ -825,7 +825,7 @@ SaveFile (char * buffer, char *filepath, u32 datasize, bool silent)
|
||||
|
||||
if (file > 0)
|
||||
{
|
||||
u32 writesize, nextwrite;
|
||||
size_t writesize, nextwrite;
|
||||
while(written < datasize)
|
||||
{
|
||||
if(datasize - written > 4*1024) nextwrite=4*1024;
|
||||
@ -856,7 +856,7 @@ SaveFile (char * buffer, char *filepath, u32 datasize, bool silent)
|
||||
return written;
|
||||
}
|
||||
|
||||
u32 SaveFile(char * filepath, u32 datasize, bool silent)
|
||||
size_t SaveFile(char * filepath, size_t datasize, bool silent)
|
||||
{
|
||||
return SaveFile((char *)savebuffer, filepath, datasize, silent);
|
||||
}
|
||||
|
@ -37,11 +37,11 @@ void CreateAppPath(char * origpath);
|
||||
int ParseDirectory(bool waitParse = false);
|
||||
void AllocSaveBuffer();
|
||||
void FreeSaveBuffer();
|
||||
u32 LoadFile(char * rbuffer, char *filepath, u32 length, bool silent);
|
||||
u32 LoadFile(char * filepath, bool silent);
|
||||
u32 LoadSzFile(char * filepath, unsigned char * rbuffer);
|
||||
u32 SaveFile(char * buffer, char *filepath, u32 datasize, bool silent);
|
||||
u32 SaveFile(char * filepath, u32 datasize, bool silent);
|
||||
size_t LoadFile(char * rbuffer, char *filepath, size_t length, bool silent);
|
||||
size_t LoadFile(char * filepath, bool silent);
|
||||
size_t LoadSzFile(char * filepath, unsigned char * rbuffer);
|
||||
size_t SaveFile(char * buffer, char *filepath, size_t datasize, bool silent);
|
||||
size_t SaveFile(char * filepath, size_t datasize, bool silent);
|
||||
|
||||
extern unsigned char savebuffer[SAVEBUFFERSIZE];
|
||||
extern FILE * file;
|
||||
|
Loading…
Reference in New Issue
Block a user