[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4017-gf34e5c8
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4017-gf34e5c8 |
Date: |
Wed, 8 Jul 2020 11:36:55 -0400 (EDT) |
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-5.1-stable has been updated
via f34e5c8c66202a4bf58a86799d4efd438ffa1284 (commit)
from eead4c7f6e29955a1a9578904a95c6291e8057b5 (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=f34e5c8c66202a4bf58a86799d4efd438ffa1284
commit f34e5c8c66202a4bf58a86799d4efd438ffa1284
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Jul 8 18:36:19 2020 +0300
Fix typedregex2 and typedregex3 tesets for MPFR.
diff --git a/ChangeLog b/ChangeLog
index 1ac0efb..45c2de2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,15 @@
2020-07-08 Arnold D. Robbins <arnold@skeeve.com>
* str_array.c (str_lookup): If a pure number, copy to a string. Fixes
- at least printfchar test for MPFR, possibly some others.
+ at printfchar test for MPFR.
+
+ Fix typeregex2 and typedregex3 tests for MPFR:
+
+ * mpfr.c (mpg_zero): No longer static inline.
+ (force_mpnum): Handle the case of a strongly typed regex.
+ (mpg_interpret): Add tracing for do_itrace.
+ * awk.h (mpg_zero): Add declaration.
+ * node.c (make_typed_regex): Init to zero for MPFR via mpg_zero.
2020-07-07 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/awk.h b/awk.h
index 0dc3d3e..4ff1141 100644
--- a/awk.h
+++ b/awk.h
@@ -1673,6 +1673,7 @@ extern void cleanup_mpfr(void);
extern NODE *mpg_node(unsigned int);
extern const char *mpg_fmt(const char *, ...);
extern int mpg_strtoui(mpz_ptr, char *, size_t, char **, int);
+extern void mpg_zero(NODE *n);
#endif
/* msg.c */
extern void gawk_exit(int status);
diff --git a/mpfr.c b/mpfr.c
index 3b4258c..3ffcba1 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -247,7 +247,7 @@ mpg_maybe_float(const char *str, int use_locale)
/* mpg_zero --- initialize with arbitrary-precision integer(GMP) and set value
to zero */
-static inline void
+void
mpg_zero(NODE *n)
{
if (is_mpg_float(n)) {
@@ -271,7 +271,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
char save;
int tval, base = 10;
- if (n->stlen == 0) {
+ if (n->stlen == 0 || (n->flags & REGEX) != 0) {
mpg_zero(n);
return false;
}
@@ -1525,7 +1525,13 @@ mpg_interpret(INSTRUCTION **cp)
NODE **lhs;
int tval; /* the ternary value returned by a MPFR function */
- switch ((op = pc->opcode)) {
+ op = pc->opcode;
+ if (do_itrace) {
+ fprintf(stderr, "+ mpg_interpret: %s: ", opcode2str(op));
+ fflush(stderr);
+ }
+
+ switch (op) {
case Op_plus_i:
t2 = force_number(pc->memory);
goto plus;
@@ -1750,10 +1756,18 @@ mod:
break;
default:
+ if (do_itrace) {
+ fprintf(stderr, "unhandled\n", opcode2str(op));
+ fflush(stderr);
+ }
return true; /* unhandled */
}
*cp = pc->nexti; /* next instruction to execute */
+ if (do_itrace) {
+ fprintf(stderr, "handled\n", opcode2str(op));
+ fflush(stderr);
+ }
return false;
}
diff --git a/node.c b/node.c
index 2db6a1e..ecb9ad0 100644
--- a/node.c
+++ b/node.c
@@ -479,6 +479,11 @@ make_typed_regex(const char *re, size_t len)
n2 = make_string(re, len);
n2->typed_re = n;
+#if HAVE_MPFR
+ if (do_mpfr)
+ mpg_zero(n2);
+ else
+#endif
n2->numbr = 0;
n2->flags |= NUMCUR|STRCUR|REGEX;
n2->flags &= ~(STRING|NUMBER);
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 10 +++++++++-
awk.h | 1 +
mpfr.c | 20 +++++++++++++++++---
node.c | 5 +++++
4 files changed, 32 insertions(+), 4 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4017-gf34e5c8,
Arnold Robbins <=