[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-879
From: |
Arnold Robbins |
Subject: |
[gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-879-g1cf371d |
Date: |
Mon, 02 May 2016 03:51:12 +0000 |
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 1cf371db5f30bc9f40a4840f1d1d276ee46619a0 (commit)
via b2ba5a19509b72c0c3b26b6f0978e645da1769eb (commit)
from af997f680093d97448f4e5c18623154ffaa8968d (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=1cf371db5f30bc9f40a4840f1d1d276ee46619a0
commit 1cf371db5f30bc9f40a4840f1d1d276ee46619a0
Author: Arnold D. Robbins <address@hidden>
Date: Mon May 2 06:50:36 2016 +0300
Replace `! NULL' with `& success_node' in array routines.
diff --git a/ChangeLog b/ChangeLog
index 16e4409..75e92be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-05-02 Arnold D. Robbins <address@hidden>
+
+ * awk.h (success_node): Declare.
+ * array.c (success_node): Define.
+ * cint_array.c, int_array.c, str_array.c: Use `& success_node'
+ instead of `(NODE **) ! NULL' to indicate success throughout.
+ Thanks to Pat Rankin for the cleanup suggestion.
+
2016-04-27 Arnold D. Robbins <address@hidden>
* io.c (set_RS): Use rs1scan if do_traditional, even if length
diff --git a/array.c b/array.c
index f799362..164d6f9 100644
--- a/array.c
+++ b/array.c
@@ -28,6 +28,8 @@
extern FILE *output_fp;
extern NODE **fmt_list; /* declared in eval.c */
+NODE *success_node;
+
static size_t SUBSEPlen;
static char *SUBSEP;
static char indent_char[] = " ";
diff --git a/awk.h b/awk.h
index 86c8883..925a9d6 100644
--- a/awk.h
+++ b/awk.h
@@ -1069,6 +1069,9 @@ extern afunc_t str_array_func[];
extern afunc_t cint_array_func[];
extern afunc_t int_array_func[];
+/* special node used to indicate success in array routines (not NULL) */
+extern NODE *success_node;
+
extern BLOCK nextfree[];
extern bool field0_valid;
diff --git a/cint_array.c b/cint_array.c
index 3945e6e..e74e279 100644
--- a/cint_array.c
+++ b/cint_array.c
@@ -162,7 +162,7 @@ cint_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs
ATTRIBUTE_UNUSED)
} else
null_array(symbol);
- return (NODE **) ! NULL;
+ return & success_node;
}
@@ -172,7 +172,7 @@ NODE **
is_uinteger(NODE *symbol, NODE *subs)
{
if (is_integer(symbol, subs) != NULL && subs->numbr >= 0)
- return (NODE **) ! NULL;
+ return & success_node;
return NULL;
}
@@ -358,7 +358,7 @@ cint_remove(NODE *symbol, NODE *subs)
freenode(xn);
}
- return (NODE **) ! NULL;
+ return & success_node;
xremove:
xn = symbol->xarray;
@@ -371,7 +371,7 @@ xremove:
symbol->table_size--;
assert(symbol->table_size > 0);
- return (NODE **) ! NULL;
+ return & success_node;
}
diff --git a/int_array.c b/int_array.c
index c2bf37b..8e6af03 100644
--- a/int_array.c
+++ b/int_array.c
@@ -74,7 +74,7 @@ int_array_init(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
} else
null_array(symbol);
- return (NODE **) ! NULL;
+ return & success_node;
}
/* is_integer --- check if subscript is an integer */
@@ -89,13 +89,13 @@ is_integer(NODE *symbol, NODE *subs)
return NULL;
if ((subs->flags & NUMINT) != 0)
- return (NODE **) ! NULL;
+ return & success_node;
if ((subs->flags & NUMBER) != 0) {
d = subs->numbr;
if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d) {
subs->flags |= NUMINT;
- return (NODE **) ! NULL;
+ return & success_node;
}
return NULL;
}
@@ -126,7 +126,7 @@ is_integer(NODE *symbol, NODE *subs)
subs->flags |= NUMBER;
}
subs->flags |= (NUMCUR|NUMINT);
- return (NODE **) ! NULL;
+ return & success_node;
}
cpend = cp + len;
@@ -146,7 +146,7 @@ is_integer(NODE *symbol, NODE *subs)
subs->flags |= NUMCUR;
if (l <= INT32_MAX && l >= INT32_MIN) {
subs->flags |= NUMINT;
- return (NODE **) ! NULL;
+ return & success_node;
}
}
return NULL;
@@ -303,7 +303,7 @@ int_remove(NODE *symbol, NODE *subs)
}
symbol->table_size--;
assert(symbol->table_size > 0);
- return (NODE **) ! NULL;
+ return & success_node;
}
k = subs->numbr;
@@ -372,7 +372,7 @@ removed:
freenode(xn);
}
- return (NODE **) ! NULL; /* return success */
+ return & success_node; /* return success */
}
diff --git a/str_array.c b/str_array.c
index aa82d71..db24980 100644
--- a/str_array.c
+++ b/str_array.c
@@ -96,7 +96,7 @@ str_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs
ATTRIBUTE_UNUSED)
} else
null_array(symbol);
- return (NODE **) ! NULL;
+ return & success_node;
}
@@ -273,7 +273,7 @@ str_remove(NODE *symbol, NODE *subs)
symbol->ainit(symbol, NULL); /*
re-initialize symbol */
}
- return (NODE **) ! NULL; /* return success */
+ return & success_node; /* return success */
}
}
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=b2ba5a19509b72c0c3b26b6f0978e645da1769eb
commit b2ba5a19509b72c0c3b26b6f0978e645da1769eb
Author: Arnold D. Robbins <address@hidden>
Date: Mon May 2 06:48:04 2016 +0300
Update credit for most recent bug fix.
diff --git a/ChangeLog b/ChangeLog
index ab7e735..16e4409 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
2016-04-27 Arnold D. Robbins <address@hidden>
* io.c (set_RS): Use rs1scan if do_traditional, even if length
- of RS is > 1.
+ of RS is > 1. Bug reported by Glauco Ciullini
+ <address@hidden>.
2016-04-24 Arnold D. Robbins <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 ++++++++++-
array.c | 2 ++
awk.h | 3 +++
cint_array.c | 8 ++++----
int_array.c | 14 +++++++-------
str_array.c | 4 ++--
6 files changed, 28 insertions(+), 14 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-879-g1cf371d,
Arnold Robbins <=