[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gawk-diffs] [SCM] gawk branch, num-handler, updated. 21e6675c65899a92c8
From: |
John Haque |
Subject: |
[gawk-diffs] [SCM] gawk branch, num-handler, updated. 21e6675c65899a92c85c59da0711ec5375162dc7 |
Date: |
Sat, 02 Feb 2013 10:25: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, num-handler has been updated
via 21e6675c65899a92c85c59da0711ec5375162dc7 (commit)
from 2fec7545cd5e31c073d72caf69ac3507302c919b (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=21e6675c65899a92c85c59da0711ec5375162dc7
commit 21e6675c65899a92c85c59da0711ec5375162dc7
Author: John Haque <address@hidden>
Date: Thu Jan 31 13:27:59 2013 -0600
Set PREC and ROUNDMOE for double.
diff --git a/double.c b/double.c
index c75b07c..d777cfc 100644
--- a/double.c
+++ b/double.c
@@ -331,8 +331,12 @@ awknum_set_var(const NODE *var)
NR = val->numbr;
else if (var == FNR_node)
FNR = val->numbr;
-
- /* N.B: PREC and ROUNMODE -- not relevant */
+ else {
+ /* PREC and ROUNMODE */
+ if (do_lint)
+ lintwarn(_("setting `%s' has no effect"),
+ var == PREC_node ? "PREC" : "ROUNDMODE");
+ }
}
/* awknum_increment_var --- increment NR or FNR */
@@ -349,7 +353,11 @@ awknum_increment_var(const NODE *var ATTRIBUTE_UNUSED,
long nr)
static void
awknum_init_vars()
{
- /* dummy function */
+ unref(PREC_node->var_value);
+ PREC_node->var_value = make_awknum(DBL_MANT_DIG);
+ PREC_node->var_value->flags |= NUMINT;
+ unref(ROUNDMODE_node->var_value);
+ ROUNDMODE_node->var_value = make_string("N", 1);
}
/* make_awknum --- allocate a node with defined number */
diff --git a/test/dumpvars.ok b/test/dumpvars.ok
index 3670b7b..73d3d30 100644
--- a/test/dumpvars.ok
+++ b/test/dumpvars.ok
@@ -16,9 +16,9 @@ NR: 3
OFMT: "%.6g"
OFS: " "
ORS: "\n"
-PREC: 0
+PREC: 53
RLENGTH: 0
-ROUNDMODE: ""
+ROUNDMODE: "N"
RS: "\n"
RSTART: 0
RT: "\n"
diff --git a/test/symtab1.ok b/test/symtab1.ok
index dc6a1b7..04709e0 100644
--- a/test/symtab1.ok
+++ b/test/symtab1.ok
@@ -1,6 +1,6 @@
ARGV[0] = gawk
SYMTAB["i"] = "i"
-SYMTAB["ROUNDMODE"] = ""
+SYMTAB["ROUNDMODE"] = "N"
SYMTAB["ORS"] = "
"
SYMTAB["OFS"] = " "
@@ -18,7 +18,7 @@ SYMTAB["ARGC"] = "1"
SYMTAB["FIELDWIDTHS"] = ""
SYMTAB["CONVFMT"] = "%.6g"
SYMTAB["SUBSEP"] = ""
-SYMTAB["PREC"] = "0"
+SYMTAB["PREC"] = "53"
SYMTAB["RS"] = "
"
SYMTAB["FPAT"] = "[^[:space:]]+"
diff --git a/test/symtab6.ok b/test/symtab6.ok
index a1fcfb9..91f27e7 100644
--- a/test/symtab6.ok
+++ b/test/symtab6.ok
@@ -16,9 +16,9 @@ NR: 0
OFMT: "%.6g"
OFS: " "
ORS: "\n"
-PREC: 0
+PREC: 53
RLENGTH: 0
-ROUNDMODE: ""
+ROUNDMODE: "N"
RS: "\n"
RSTART: 0
RT: ""
diff --git a/test/symtab8.ok b/test/symtab8.ok
index f0adb1a..8560c75 100644
--- a/test/symtab8.ok
+++ b/test/symtab8.ok
@@ -17,9 +17,9 @@ NR: 1
OFMT: "%.6g"
OFS: " "
ORS: "\n"
-PREC: 0
+PREC: 53
RLENGTH: 0
-ROUNDMODE: ""
+ROUNDMODE: "N"
RS: "\n"
RSTART: 0
RT: "\n"
-----------------------------------------------------------------------
Summary of changes:
double.c | 14 +++++++++++---
test/dumpvars.ok | 4 ++--
test/symtab1.ok | 4 ++--
test/symtab6.ok | 4 ++--
test/symtab8.ok | 4 ++--
5 files changed, 19 insertions(+), 11 deletions(-)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gawk-diffs] [SCM] gawk branch, num-handler, updated. 21e6675c65899a92c85c59da0711ec5375162dc7,
John Haque <=