From: Nick Bowler Date: Fri, 25 Feb 2022 04:06:09 +0000 (-0500) Subject: Rename "prealloc" global variable. X-Git-Url: https://git.draconx.ca/gitweb/gob-dx.git/commitdiff_plain/86d4727e727a55648196205cff450c96569ec4a6 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. --- 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;