mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
in and out file marked as static
This commit is contained in:
@@ -792,12 +792,14 @@ int Toy_hookFileIO(Toy_Interpreter* interpreter, Toy_Literal identifier, Toy_Lit
|
||||
createToyVariableInt(&variables[1], "MAX_FILES_OPEN", FOPEN_MAX);
|
||||
createToyVariableInt(&variables[2], "END_OF_FILE", EOF);
|
||||
|
||||
Toy_File* outFile = createToyFile("w", "output");
|
||||
static Toy_File* outFile;
|
||||
outFile = createToyFile("w", "output");
|
||||
outFile->fp = stdout;
|
||||
|
||||
createToyVariableFile(&variables[3], "output", outFile);
|
||||
|
||||
Toy_File* inFile = createToyFile("r", "input");
|
||||
static Toy_File* inFile;
|
||||
inFile = createToyFile("r", "input");
|
||||
inFile->fp = stdin;
|
||||
|
||||
createToyVariableFile(&variables[4], "input", inFile);
|
||||
|
||||
@@ -144,8 +144,4 @@ fn reset() {
|
||||
reader.close();
|
||||
}
|
||||
|
||||
// standard in/out are closed to prevent memory leaks
|
||||
input.close();
|
||||
output.close();
|
||||
|
||||
print "All good";
|
||||
Reference in New Issue
Block a user