aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--awk.h11
-rw-r--r--doc/ChangeLog4
-rw-r--r--doc/gawk.texi7
-rw-r--r--doc/gawktexi.in7
-rw-r--r--main.c10
-rw-r--r--symbol.c12
7 files changed, 41 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 1dc4e10a..eab657c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-09-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h: Move libsigsegv stuff to ...
+ * main.c: here. Thanks to Yehezkel Bernat for motivating
+ the cleanup.
+ * symbol.c (make_symbol, install, install_symbol): Add const to
+ first parameter. Adjust decls and fix up uses.
+
2014-09-05 Arnold D. Robbins <arnold@skeeve.com>
Add builtin functions to FUNCTAB for consistency.
diff --git a/awk.h b/awk.h
index 24f96ebf..0b76aea2 100644
--- a/awk.h
+++ b/awk.h
@@ -193,15 +193,6 @@ extern void *memset_ulong(void *dest, int val, unsigned long l);
#define memset memset_ulong
#endif
-#ifdef HAVE_LIBSIGSEGV
-#include <sigsegv.h>
-#else
-typedef void *stackoverflow_context_t;
-#define sigsegv_install_handler(catchsegv) signal(SIGSEGV, catchsig)
-/* define as 0 rather than empty so that (void) cast on it works */
-#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0
-#endif
-
#if defined(__EMX__) || defined(__MINGW32__)
#include "nonposix.h"
#endif /* defined(__EMX__) || defined(__MINGW32__) */
@@ -1645,7 +1636,7 @@ extern void load_symbols();
extern void init_symbol_table();
extern NODE *symbol_table;
extern NODE *func_table;
-extern NODE *install_symbol(char *name, NODETYPE type);
+extern NODE *install_symbol(const char *name, NODETYPE type);
extern NODE *remove_symbol(NODE *r);
extern void destroy_symbol(NODE *r);
extern void release_symbols(NODE *symlist, int keep_globals);
diff --git a/doc/ChangeLog b/doc/ChangeLog
index e6ab67cb..226cd4da 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,7 @@
+2014-09-07 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Minor cleanups.
+
2014-09-05 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in: Document builtin functions in FUNCTAB and in
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 5e1dacf0..7e103443 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -1508,7 +1508,9 @@ There are sidebars
scattered throughout the @value{DOCUMENT}.
They add a more complete explanation of points that are relevant, but not likely
to be of interest on first reading.
+@ifclear FOR_PRINT
All appear in the index, under the heading ``sidebar.''
+@end ifclear
Most of the time, the examples use complete @command{awk} programs.
Some of the more advanced sections show only the part of the @command{awk}
@@ -1635,7 +1637,7 @@ available @command{awk} implementations.
@ifset FOR_PRINT
-@DBREF{Copying}
+@ref{Copying},
presents the license that covers the @command{gawk} source code.
The version of this @value{DOCUMENT} distributed with @command{gawk}
@@ -1663,6 +1665,9 @@ try looking them up here.
@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
The GNU FDL}
is the license that covers this @value{DOCUMENT}.
+
+Some of the chapters have exercise sections; these have also been
+omitted from the print edition.
@end ifset
@ifclear FOR_PRINT
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 423b82ed..d04cc8b3 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -1475,7 +1475,9 @@ There are sidebars
scattered throughout the @value{DOCUMENT}.
They add a more complete explanation of points that are relevant, but not likely
to be of interest on first reading.
+@ifclear FOR_PRINT
All appear in the index, under the heading ``sidebar.''
+@end ifclear
Most of the time, the examples use complete @command{awk} programs.
Some of the more advanced sections show only the part of the @command{awk}
@@ -1602,7 +1604,7 @@ available @command{awk} implementations.
@ifset FOR_PRINT
-@DBREF{Copying}
+@ref{Copying},
presents the license that covers the @command{gawk} source code.
The version of this @value{DOCUMENT} distributed with @command{gawk}
@@ -1630,6 +1632,9 @@ try looking them up here.
@uref{http://www.gnu.org/software/gawk/manual/html_node/GNU-Free-Documentation-License.html,
The GNU FDL}
is the license that covers this @value{DOCUMENT}.
+
+Some of the chapters have exercise sections; these have also been
+omitted from the print edition.
@end ifset
@ifclear FOR_PRINT
diff --git a/main.c b/main.c
index 291fa897..3da0703e 100644
--- a/main.c
+++ b/main.c
@@ -33,6 +33,16 @@
#include <mcheck.h>
#endif
+#ifdef HAVE_LIBSIGSEGV
+#include <sigsegv.h>
+#else
+typedef void *stackoverflow_context_t;
+/* the argument to this macro is purposely not used */
+#define sigsegv_install_handler(catchsegv) signal(SIGSEGV, catchsig)
+/* define as 0 rather than empty so that (void) cast on it works */
+#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0
+#endif
+
#define DEFAULT_PROFILE "awkprof.out" /* where to put profile */
#define DEFAULT_VARFILE "awkvars.out" /* where to put vars */
#define DEFAULT_PREC 53
diff --git a/symbol.c b/symbol.c
index 5add8968..e89214c0 100644
--- a/symbol.c
+++ b/symbol.c
@@ -35,8 +35,8 @@ static int var_count; /* total number of global variables and functions */
static NODE *symbol_list;
static void (*install_func)(NODE *) = NULL;
-static NODE *make_symbol(char *name, NODETYPE type);
-static NODE *install(char *name, NODE *parm, NODETYPE type);
+static NODE *make_symbol(const char *name, NODETYPE type);
+static NODE *install(const char *name, NODE *parm, NODETYPE type);
static void free_bcpool(INSTRUCTION *pl);
static AWK_CONTEXT *curr_ctxt = NULL;
@@ -75,7 +75,7 @@ init_symbol_table()
*/
NODE *
-install_symbol(char *name, NODETYPE type)
+install_symbol(const char *name, NODETYPE type)
{
return install(name, NULL, type);
}
@@ -275,7 +275,7 @@ destroy_symbol(NODE *r)
/* make_symbol --- allocates a global symbol for the symbol table. */
static NODE *
-make_symbol(char *name, NODETYPE type)
+make_symbol(const char *name, NODETYPE type)
{
NODE *r;
@@ -285,7 +285,7 @@ make_symbol(char *name, NODETYPE type)
null_array(r);
else if (type == Node_var)
r->var_value = dupnode(Nnull_string);
- r->vname = name;
+ r->vname = (char *) name;
r->type = type;
return r;
@@ -294,7 +294,7 @@ make_symbol(char *name, NODETYPE type)
/* install --- install a global name or function parameter in the symbol table */
static NODE *
-install(char *name, NODE *parm, NODETYPE type)
+install(const char *name, NODE *parm, NODETYPE type)
{
NODE *r;
NODE **aptr;