mirror of
https://github.com/dborth/vbagx.git
synced 2025-01-14 03:29:06 +01:00
switch to size_t
This commit is contained in:
parent
b042913f10
commit
47bb000985
@ -504,7 +504,7 @@ int BrowserLoadSz()
|
||||
int BrowserLoadFile()
|
||||
{
|
||||
int device;
|
||||
|
||||
|
||||
if(!FindDevice(browser.dir, &device))
|
||||
return 0;
|
||||
|
||||
@ -544,7 +544,7 @@ int BrowserChangeFolder()
|
||||
{
|
||||
int device = 0;
|
||||
FindDevice(browser.dir, &device);
|
||||
|
||||
|
||||
if(inSz && browser.selIndex == 0) // inside a 7z, requesting to leave
|
||||
{
|
||||
inSz = false;
|
||||
|
@ -648,10 +648,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
|
||||
@ -680,12 +680,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;
|
||||
|
||||
@ -736,8 +736,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;
|
||||
@ -782,7 +782,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);
|
||||
}
|
||||
@ -791,10 +791,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;
|
||||
|
||||
@ -823,7 +823,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;
|
||||
@ -854,7 +854,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);
|
||||
}
|
||||
|
@ -34,11 +34,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[];
|
||||
extern FILE * file;
|
||||
|
Loading…
x
Reference in New Issue
Block a user