From: Dale Weiler Date: Sun, 14 Apr 2013 01:32:29 +0000 (+0000) Subject: Fet rid of explicit file stream flushes, streams are flushed on exit, which we can... X-Git-Tag: before-library~65 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7ba7fd5968e9cc143f106739d42a3aad71b25713;p=xonotic%2Fgmqcc.git Fet rid of explicit file stream flushes, streams are flushed on exit, which we can always gurantee. --- diff --git a/exec.c b/exec.c index d9ced65..8b0ee5e 100644 --- a/exec.c +++ b/exec.c @@ -455,7 +455,6 @@ static void prog_print_statement(qc_program *prog, prog_section_statement *st) else printf("(none)"); printf("\n"); } - fflush(stdout); } static qcint prog_enterfunction(qc_program *prog, prog_section_function *func) diff --git a/fs.c b/fs.c index e39858a..997b368 100644 --- a/fs.c +++ b/fs.c @@ -165,11 +165,6 @@ int fs_file_seek(FILE *fp, long int off, int whence) { return fseek(fp, off, whence); } -int fs_file_flush(FILE *fp) { - /* Invokes file_exception on windows if fp is null */ - return fflush(fp); -} - long int fs_file_tell(FILE *fp) { /* Invokes file_exception on windows if fp is null */ return ftell(fp); diff --git a/gmqcc.h b/gmqcc.h index 6d4d971..fbddf15 100644 --- a/gmqcc.h +++ b/gmqcc.h @@ -466,7 +466,6 @@ void util_hsdel(hash_set_t *); void fs_file_close (FILE *); int fs_file_error (FILE *); int fs_file_getc (FILE *); -int fs_file_flush (FILE *); int fs_file_printf (FILE *, const char *, ...); int fs_file_puts (FILE *, const char *); int fs_file_seek (FILE *, long int, int); diff --git a/test.c b/test.c index 2310633..ebd7bfa 100644 --- a/test.c +++ b/test.c @@ -985,8 +985,6 @@ void task_schedualize(size_t *pad) { task_tasks[i].compiled = false; execute = false; } - - fs_file_flush(task_tasks[i].stdoutlog); } while (fs_file_getline(&data, &size, task_tasks[i].runhandles[2]) != EOF) { /* @@ -1003,7 +1001,6 @@ void task_schedualize(size_t *pad) { } fs_file_puts (task_tasks[i].stderrlog, data); - fs_file_flush(task_tasks[i].stdoutlog); } if (!task_tasks[i].compiled && strcmp(task_tasks[i].tmpl->proceduretype, "-fail")) {