From 8362f2fc7ace2779b927573599c818401e828ed2 Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Fri, 25 Oct 2024 08:55:58 +0200 Subject: [PATCH] fixes for mingw --- cobc/cobc.c | 2 +- cobc/dump_ast.c | 1 - cobc/dump_ast_gen.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cobc/cobc.c b/cobc/cobc.c index 90d09ece..86cb3038 100644 --- a/cobc/cobc.c +++ b/cobc/cobc.c @@ -1118,7 +1118,7 @@ cobc_main_strdup (const char *dupstr) } /* returns a fresh allocated copy of the concatenation from str1 + str2 */ -char * +static char * cobc_main_stradd_dup (const char *str1, const char *str2) { char *p; diff --git a/cobc/dump_ast.c b/cobc/dump_ast.c index 1e10802d..35637019 100644 --- a/cobc/dump_ast.c +++ b/cobc/dump_ast.c @@ -237,7 +237,6 @@ void cb_dump_ast_to_file (struct cb_program *prog, const char *filename, const c close_fd = 0; fd = stdout; } else { - int len = strlen (filename); struct stat st; if (!stat (filename, &st)) unlink(filename); fd = fopen (filename, "w"); diff --git a/cobc/dump_ast_gen.c b/cobc/dump_ast_gen.c index d2581b7b..26298077 100644 --- a/cobc/dump_ast_gen.c +++ b/cobc/dump_ast_gen.c @@ -36,8 +36,8 @@ static void init_ptr_table () ptr_table = (void**) calloc (ptr_table_size, sizeof (void*) ); num_table = (int*) calloc (ptr_table_size, sizeof (int) ); } else { - bzero (ptr_table, ptr_table_size * sizeof(void*) ); - bzero (num_table, ptr_table_size * sizeof(int) ); + memset (ptr_table, 0, ptr_table_size * sizeof(void*) ); + memset (num_table, 0, ptr_table_size * sizeof(int) ); ptr_table_used = 0; } }