From 463be4aa241f9c9b8453ba46a89ce5d67995c55b Mon Sep 17 00:00:00 2001 From: Ting-Wei Lan Date: Wed, 30 Dec 2015 15:33:33 +0800 Subject: Drop any_error from state and add asm_output to state --- src/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 5f6c169..0ae48e4 100644 --- a/src/main.c +++ b/src/main.c @@ -96,13 +96,12 @@ int main (int argc, char **argv) else exit(1); - FILE *asm_output = fopen("output.s", "w"); - if (asm_output == NULL) { + state->asm_output = fopen("output.s", "w"); + if (state->asm_output == NULL) { fprintf(stderr, "%s: output.s: %s\n", prog_name, ERR_MSG); exit(1); } - ccmmc_code_generation(state->ast, state->table, asm_output); - fclose(asm_output); + ccmmc_code_generation(state); ccmmc_state_fini(state); fclose(source_handle); -- cgit v1.2.3