aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-03-05 19:29:54 +0200
committerArnold D. Robbins <arnold@skeeve.com>2018-03-05 19:29:54 +0200
commit97773a0db9bcbafa16afcd1461ed6eead7f192a8 (patch)
tree8aac8a228c54762b18391bc284de043eb67dee24
parent28e37a0dc466d96478c3e6a8f087b7be097ed318 (diff)
downloadegawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.tar.gz
egawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.tar.bz2
egawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.zip
Minor cleanups (bool to int, move a macro).
-rw-r--r--ChangeLog7
-rw-r--r--awk.h7
-rw-r--r--awkgram.c4
-rw-r--r--awkgram.y4
-rw-r--r--debug.c7
-rw-r--r--io.c4
6 files changed, 20 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index b31740b6..388a9eb3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-03-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * awk.h [PUSH_BINDING, POP_BINDING]: Moved to ...
+ * debug.c: here.
+ * awkgram.y (yylex): Make do_etoa_init into a boolean.
+ * io.c (rs1scan): Make found into a boolean.
+
2018-02-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.2.1: Release tar ball made.
diff --git a/awk.h b/awk.h
index 3b351c25..1e334bfa 100644
--- a/awk.h
+++ b/awk.h
@@ -1349,13 +1349,6 @@ DEREF(NODE *r)
extern jmp_buf fatal_tag;
extern int fatal_tag_valid;
-#define PUSH_BINDING(stack, tag, val) \
-if (val++) \
- memcpy((char *) (stack), (const char *) tag, sizeof(jmp_buf))
-#define POP_BINDING(stack, tag, val) \
-if (--val) \
- memcpy((char *) tag, (const char *) (stack), sizeof(jmp_buf))
-
#define assoc_length(a) ((*((a)->alength(a, NULL)))->table_size)
#define assoc_empty(a) (assoc_length(a) == 0)
#define assoc_lookup(a, s) ((a)->alookup(a, s))
diff --git a/awkgram.c b/awkgram.c
index 52821eab..c1a5ead4 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -6706,7 +6706,7 @@ static int
yylex(void)
{
static char etoa_xlate[256];
- static int do_etoa_init = 1;
+ static bool do_etoa_init = true;
int tok;
if (do_etoa_init)
@@ -6719,7 +6719,7 @@ yylex(void)
#else
# error "An EBCDIC-to-ASCII translation function is needed for this system"
#endif
- do_etoa_init = 0;
+ do_etoa_init = false;
}
tok = yylex_ebcdic();
diff --git a/awkgram.y b/awkgram.y
index ad830a5d..be1e495c 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -4286,7 +4286,7 @@ static int
yylex(void)
{
static char etoa_xlate[256];
- static int do_etoa_init = 1;
+ static bool do_etoa_init = true;
int tok;
if (do_etoa_init)
@@ -4299,7 +4299,7 @@ yylex(void)
#else
# error "An EBCDIC-to-ASCII translation function is needed for this system"
#endif
- do_etoa_init = 0;
+ do_etoa_init = false;
}
tok = yylex_ebcdic();
diff --git a/debug.c b/debug.c
index 3e76ae61..7a5ad21b 100644
--- a/debug.c
+++ b/debug.c
@@ -338,6 +338,13 @@ struct command_source
static struct command_source *cmd_src = NULL;
+#define PUSH_BINDING(stack, tag, val) \
+if (val++) \
+ memcpy((char *) (stack), (const char *) tag, sizeof(jmp_buf))
+#define POP_BINDING(stack, tag, val) \
+if (--val) \
+ memcpy((char *) tag, (const char *) (stack), sizeof(jmp_buf))
+
#define CHECK_PROG_RUNNING() \
do { \
diff --git a/io.c b/io.c
index 1a1d8cc2..9ca29dac 100644
--- a/io.c
+++ b/io.c
@@ -3535,12 +3535,12 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state)
/* Thus, the check for \n here; big speedup ! */
if (rs != '\n' && gawk_mb_cur_max > 1) {
int len = iop->dataend - bp;
- int found = 0;
+ bool found = false;
memset(& mbs, 0, sizeof(mbstate_t));
do {
if (*bp == rs)
- found = 1;
+ found = true;
if (is_valid_character(*bp))
mbclen = 1;
else