[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-942
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-942-g2a92e9d |
Date: |
Tue, 19 Jul 2016 02:48:10 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".
The branch, gawk-4.1-stable has been updated
via 2a92e9d3cb8ba907376837dadd03abc6ad09b741 (commit)
from 95b9f0c6c59cb4de1d7a65c3afe4d618a252de5a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=2a92e9d3cb8ba907376837dadd03abc6ad09b741
commit 2a92e9d3cb8ba907376837dadd03abc6ad09b741
Author: Arnold D. Robbins <address@hidden>
Date: Tue Jul 19 05:47:51 2016 +0300
Simplify set_LINT function.
diff --git a/ChangeLog b/ChangeLog
index 6aba67a..27711b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-19 Andrew J. Schorr <address@hidden>
+
+ * eval.c (set_LINT): Simplify the code considerably.
+
2016-07-19 Arnold D. Robbins <address@hidden>
* awkgram.y (shadow_funcs): Change test at end to be
diff --git a/eval.c b/eval.c
index b857ea4..48049ae 100644
--- a/eval.c
+++ b/eval.c
@@ -949,6 +949,10 @@ set_LINT()
int old_lint = do_lint;
NODE *n = LINT_node->var_value;
+ /* start with clean defaults */
+ lintfunc = r_warning;
+ do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
+
if ((n->flags & (STRING|STRCUR)) != 0) {
if ((n->flags & MAYBE_NUM) == 0) {
const char *lintval;
@@ -958,39 +962,24 @@ set_LINT()
lintval = n->stptr;
lintlen = n->stlen;
if (lintlen > 0) {
- do_flags |= DO_LINT_ALL;
- if (lintlen == 5 && strncmp(lintval, "fatal",
5) == 0)
- lintfunc = r_fatal;
- else if (lintlen == 7 && strncmp(lintval,
"invalid", 7) == 0) {
- do_flags &= ~ DO_LINT_ALL;
+ if (lintlen == 7 && strncmp(lintval, "invalid",
7) == 0)
do_flags |= DO_LINT_INVALID;
- lintfunc = warning;
- } else
- lintfunc = warning;
- } else {
- do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
- lintfunc = warning;
+ else {
+ do_flags |= DO_LINT_ALL;
+ if (lintlen == 5 && strncmp(lintval,
"fatal", 5) == 0)
+ lintfunc = r_fatal;
+ }
}
} else {
(void) force_number(n);
if (! iszero(n))
do_flags |= DO_LINT_ALL;
- else
- do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
- lintfunc = warning;
}
} else if ((n->flags & (NUMCUR|NUMBER)) != 0) {
(void) force_number(n);
if (! iszero(n))
do_flags |= DO_LINT_ALL;
- else
- do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID);
- lintfunc = warning;
- } else
- do_flags &= ~(DO_LINT_ALL|DO_LINT_INVALID); /* shouldn't
happen */
-
- if (! do_lint)
- lintfunc = warning;
+ }
/* explicitly use warning() here, in case lintfunc == r_fatal */
if (old_lint != do_lint && old_lint && ! do_lint)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 4 ++++
eval.c | 33 +++++++++++----------------------
2 files changed, 15 insertions(+), 22 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-942-g2a92e9d,
Arnold Robbins <=