Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Soloud_Filehack_fopen causing compile errors in strict mode #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/soloud_file_hack_on.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ extern int Soloud_Filehack_fread(void *dst, int s, int c, Soloud_Filehack *f);
extern int Soloud_Filehack_fseek(Soloud_Filehack *f, int idx, int base);
extern int Soloud_Filehack_ftell(Soloud_Filehack *f);
extern int Soloud_Filehack_fclose(Soloud_Filehack *f);
extern Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, char *aMode);
extern int Soloud_Filehack_fopen_s(Soloud_Filehack **f, const char* aFilename, char* aMode);
extern Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, const char *aMode);
extern int Soloud_Filehack_fopen_s(Soloud_Filehack **f, const char* aFilename, const char* aMode);

#ifdef __cplusplus
}
Expand Down
16 changes: 8 additions & 8 deletions src/core/soloud_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ namespace SoLoud
return d;
}

DiskFile::DiskFile(FILE *fp):
mFileHandle(fp)
{
}
DiskFile::DiskFile(FILE *fp):
mFileHandle(fp)
{

}

unsigned int DiskFile::read(unsigned char *aDst, unsigned int aBytes)
{
Expand Down Expand Up @@ -291,7 +291,7 @@ extern "C"
return 0;
}

Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, char * /*aMode*/)
Soloud_Filehack * Soloud_Filehack_fopen(const char *aFilename, const char * /*aMode*/)
{
SoLoud::DiskFile *df = new SoLoud::DiskFile();
int res = df->open(aFilename);
Expand All @@ -303,9 +303,9 @@ extern "C"
return (Soloud_Filehack*)df;
}

int Soloud_Filehack_fopen_s(Soloud_Filehack** f, const char* aFilename, char* /*aMode*/)
int Soloud_Filehack_fopen_s(Soloud_Filehack** f, const char* aFilename, const char* /*aMode*/)
{
*f = Soloud_Filehack_fopen(aFilename, 0);
return 1;
}
}
}