mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
fopen does not take a "t" mode
"t" is a nonportable way of opening files in text mode. Windows opens files in text mode by default anyway, and in UNIX there is no text mode. (Passing "t" to fopen is undefined in standard C.)
This commit is contained in:
@@ -52,7 +52,7 @@ filesize(char *s)
|
|||||||
FILE *f;
|
FILE *f;
|
||||||
ULONG size = 0;
|
ULONG size = 0;
|
||||||
|
|
||||||
if ((f = fopen(s, "rt")) != NULL) {
|
if ((f = fopen(s, "r")) != NULL) {
|
||||||
fseek(f, 0, SEEK_END);
|
fseek(f, 0, SEEK_END);
|
||||||
size = ftell(f);
|
size = ftell(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
@@ -247,7 +247,7 @@ fstk_RunInclude(char *tzFileName)
|
|||||||
fstk_FindFile(tzFileName);
|
fstk_FindFile(tzFileName);
|
||||||
//printf("INCLUDING: %s\n", tzFileName);
|
//printf("INCLUDING: %s\n", tzFileName);
|
||||||
|
|
||||||
if ((f = fopen(tzFileName, "rt")) != NULL) {
|
if ((f = fopen(tzFileName, "r")) != NULL) {
|
||||||
pushcontext();
|
pushcontext();
|
||||||
nLineNo = 1;
|
nLineNo = 1;
|
||||||
nCurrentStatus = STAT_isInclude;
|
nCurrentStatus = STAT_isInclude;
|
||||||
@@ -383,7 +383,7 @@ fstk_Init(char *s)
|
|||||||
fstk_FindFile(tzFileName);
|
fstk_FindFile(tzFileName);
|
||||||
|
|
||||||
pFileStack = NULL;
|
pFileStack = NULL;
|
||||||
if ((pCurrentFile = fopen(tzFileName, "rt")) != NULL) {
|
if ((pCurrentFile = fopen(tzFileName, "r")) != NULL) {
|
||||||
nMacroCount = 0;
|
nMacroCount = 0;
|
||||||
nCurrentStatus = STAT_isInclude;
|
nCurrentStatus = STAT_isInclude;
|
||||||
strcpy(tzCurrentFileName, tzFileName);
|
strcpy(tzCurrentFileName, tzFileName);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ SLONG sfbank;
|
|||||||
void
|
void
|
||||||
SetMapfileName(char *name)
|
SetMapfileName(char *name)
|
||||||
{
|
{
|
||||||
mf = fopen(name, "wt");
|
mf = fopen(name, "w");
|
||||||
|
|
||||||
if (!mf)
|
if (!mf)
|
||||||
errx(5, "Unable to open mapfile for writing");
|
errx(5, "Unable to open mapfile for writing");
|
||||||
@@ -26,7 +26,7 @@ SetMapfileName(char *name)
|
|||||||
void
|
void
|
||||||
SetSymfileName(char *name)
|
SetSymfileName(char *name)
|
||||||
{
|
{
|
||||||
sf = fopen(name, "wt");
|
sf = fopen(name, "w");
|
||||||
|
|
||||||
if (!sf)
|
if (!sf)
|
||||||
errx(5, "Unable to open symfile for writing");
|
errx(5, "Unable to open symfile for writing");
|
||||||
|
|||||||
Reference in New Issue
Block a user