From 86d4727e727a55648196205cff450c96569ec4a6 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 24 Feb 2022 23:06:09 -0500 Subject: [PATCH] Rename "prealloc" global variable. HP-UX 11 has a function called "prealloc" in its C library which causes conflicts with this global variable. Let's pick a different name. --- src/lexer.l | 2 +- src/main.c | 8 ++------ src/main.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lexer.l b/src/lexer.l index 3e57e8a..d33965d 100644 --- a/src/lexer.l +++ b/src/lexer.l @@ -660,7 +660,7 @@ flags { return FLAGS; } p = strchr (yytext,'p'); g_assert (p); /* we MUST have found it */ sscanf (p, "prealloc %d", &t); - prealloc=t; + npreallocs=t; } %% diff --git a/src/main.c b/src/main.c index 4aea007..73920ae 100644 --- a/src/main.c +++ b/src/main.c @@ -133,11 +133,7 @@ gboolean no_lines = FALSE; gboolean no_self_alias = FALSE; gboolean always_private_struct = FALSE; gboolean gtk3_ok = FALSE; - -gint prealloc = 0; - - - +gint npreallocs = 0; gboolean use_m4 = FALSE; /* preprocess sources with m4 */ char *m4_commandline = NULL; #define M4_INCLUDE_DIR PKGDATADIR "/m4" @@ -1269,7 +1265,7 @@ static void add_type_info(void) "\t\t(GInstanceInitFunc) %s_init,\n" "\t\tNULL\n" "\t};\n\n", - typebase, funcbase, typebase, prealloc, funcbase); + typebase, funcbase, typebase, npreallocs, funcbase); } static void diff --git a/src/main.h b/src/main.h index 6c90250..66197dc 100644 --- a/src/main.h +++ b/src/main.h @@ -43,7 +43,7 @@ extern gboolean no_self_alias; extern gboolean no_kill_underscores; extern gboolean always_private_struct; extern gboolean gtk3_ok; -extern gint prealloc; +extern gint npreallocs; extern char *filename; extern char *filebase; -- 2.43.2