diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-03-05 19:29:54 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-03-05 19:29:54 +0200 |
commit | 97773a0db9bcbafa16afcd1461ed6eead7f192a8 (patch) | |
tree | 8aac8a228c54762b18391bc284de043eb67dee24 | |
parent | 28e37a0dc466d96478c3e6a8f087b7be097ed318 (diff) | |
download | egawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.tar.gz egawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.tar.bz2 egawk-97773a0db9bcbafa16afcd1461ed6eead7f192a8.zip |
Minor cleanups (bool to int, move a macro).
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | awk.h | 7 | ||||
-rw-r--r-- | awkgram.c | 4 | ||||
-rw-r--r-- | awkgram.y | 4 | ||||
-rw-r--r-- | debug.c | 7 | ||||
-rw-r--r-- | io.c | 4 |
6 files changed, 20 insertions, 13 deletions
@@ -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. @@ -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)) @@ -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(); @@ -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(); @@ -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 { \ @@ -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 |