gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, gawk_mpfr, updated. 1673eabb64f93c4d24b0


From: John Haque
Subject: [gawk-diffs] [SCM] gawk branch, gawk_mpfr, updated. 1673eabb64f93c4d24b0ef7d9d0d8444d6ad5056
Date: Thu, 12 Apr 2012 11:37:07 +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_mpfr has been updated
       via  1673eabb64f93c4d24b0ef7d9d0d8444d6ad5056 (commit)
      from  98c342179faae6afd0341e5ca65eae00a79c86b7 (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=1673eabb64f93c4d24b0ef7d9d0d8444d6ad5056

commit 1673eabb64f93c4d24b0ef7d9d0d8444d6ad5056
Author: john haque <address@hidden>
Date:   Thu Apr 12 06:17:30 2012 -0500

    Change MPFR variable RND_MODE to ROUND_MODE.

diff --git a/array.c b/array.c
index 384d147..c8e230f 100644
--- a/array.c
+++ b/array.c
@@ -680,7 +680,7 @@ value_info(NODE *n)
 #ifdef HAVE_MPFR
                        if (is_mpg_float(n))
                                fprintf(output_fp, ":%s",
-                                       mpg_fmt("%.*R*g", PREC_NUM, RND_MODE, 
n->mpg_numbr));
+                                       mpg_fmt("%.*R*g", PREC_NUM, ROUND_MODE, 
n->mpg_numbr));
                        else if (is_mpg_integer(n))
                                fprintf(output_fp, ":%s", mpg_fmt("%Zd", 
n->mpg_i));
                        else
@@ -692,7 +692,7 @@ value_info(NODE *n)
 #ifdef HAVE_MPFR
                if (is_mpg_float(n))
                        fprintf(output_fp, "<%s>",
-                               mpg_fmt("%.*R*g", PREC_NUM, RND_MODE, 
n->mpg_numbr));
+                               mpg_fmt("%.*R*g", PREC_NUM, ROUND_MODE, 
n->mpg_numbr));
                else if (is_mpg_integer(n))
                        fprintf(output_fp, "<%s>", mpg_fmt("%Zd", n->mpg_i));
                else
diff --git a/awk.h b/awk.h
index ff436cc..a4b8761 100644
--- a/awk.h
+++ b/awk.h
@@ -1115,7 +1115,7 @@ extern struct lconv loc;
 
 #ifdef HAVE_MPFR
 extern mpfr_prec_t PRECISION;
-extern mpfr_rnd_t RND_MODE;
+extern mpfr_rnd_t ROUND_MODE;
 extern mpz_t MNR;
 extern mpz_t MFNR;
 extern mpz_t mpzval;
@@ -1212,16 +1212,16 @@ extern STACK_ITEM *stack_top;
 /* ------------------------- Pseudo-functions ------------------------- */
 #ifdef HAVE_MPFR
 /* conversion to C types */
-#define get_number_ui(n)       (((n)->flags & MPFN) ? 
mpfr_get_ui((n)->mpg_numbr, RND_MODE) \
+#define get_number_ui(n)       (((n)->flags & MPFN) ? 
mpfr_get_ui((n)->mpg_numbr, ROUND_MODE) \
                                : ((n)->flags & MPZN) ? mpz_get_ui((n)->mpg_i) \
                                : (unsigned long) (n)->numbr)
-#define get_number_si(n)       (((n)->flags & MPFN) ? 
mpfr_get_si((n)->mpg_numbr, RND_MODE) \
+#define get_number_si(n)       (((n)->flags & MPFN) ? 
mpfr_get_si((n)->mpg_numbr, ROUND_MODE) \
                                : ((n)->flags & MPZN) ? mpz_get_si((n)->mpg_i) \
                                : (long) (n)->numbr)
-#define get_number_d(n)                (((n)->flags & MPFN) ? 
mpfr_get_d((n)->mpg_numbr, RND_MODE) \
+#define get_number_d(n)                (((n)->flags & MPFN) ? 
mpfr_get_d((n)->mpg_numbr, ROUND_MODE) \
                                : ((n)->flags & MPZN) ? mpz_get_d((n)->mpg_i) \
                                : (double) (n)->numbr)
-#define get_number_uj(n)       (((n)->flags & MPFN) ? 
mpfr_get_uj((n)->mpg_numbr, RND_MODE) \
+#define get_number_uj(n)       (((n)->flags & MPFN) ? 
mpfr_get_uj((n)->mpg_numbr, ROUND_MODE) \
                                : ((n)->flags & MPZN) ? (uintmax_t) 
mpz_get_d((n)->mpg_i) \
                                : (uintmax_t) (n)->numbr)
 
diff --git a/awkgram.c b/awkgram.c
index c2fcb03..8858e77 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -4606,7 +4606,7 @@ negate_num(NODE *n)
 #ifdef HAVE_MPFR
        if (is_mpg_float(n)) {
                int tval;
-               tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, RND_MODE);
+               tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, ROUND_MODE);
                IEEE_FMT(n->mpg_numbr, tval);
        } else if (is_mpg_integer(n)) {
                mpz_neg(n->mpg_i, n->mpg_i);
@@ -6092,7 +6092,7 @@ retry:
                        } else {
                                int tval;
                                r = mpg_float();
-                               tval = mpfr_strtofr(r->mpg_numbr, tokstart, 
NULL, base, RND_MODE);
+                               tval = mpfr_strtofr(r->mpg_numbr, tokstart, 
NULL, base, ROUND_MODE);
                                errno = 0;
                                IEEE_FMT(r->mpg_numbr, tval);
                        }
@@ -6603,7 +6603,7 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
        } else if (n->flags & NUMBER) {
 #ifdef HAVE_MPFR
                if (is_mpg_float(n))
-                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", RND_MODE, 
n->mpg_numbr));
+                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, 
n->mpg_numbr));
                else if (is_mpg_integer(n))
                        print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
                else
@@ -6615,7 +6615,7 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
        } else if (n->flags & NUMCUR) {
 #ifdef HAVE_MPFR
                if (is_mpg_float(n))
-                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", RND_MODE, 
n->mpg_numbr));
+                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, 
n->mpg_numbr));
                else if (is_mpg_integer(n))
                        print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
                else
diff --git a/awkgram.y b/awkgram.y
index 03d93ae..1c487bf 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -1909,7 +1909,7 @@ negate_num(NODE *n)
 #ifdef HAVE_MPFR
        if (is_mpg_float(n)) {
                int tval;
-               tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, RND_MODE);
+               tval = mpfr_neg(n->mpg_numbr, n->mpg_numbr, ROUND_MODE);
                IEEE_FMT(n->mpg_numbr, tval);
        } else if (is_mpg_integer(n)) {
                mpz_neg(n->mpg_i, n->mpg_i);
@@ -3395,7 +3395,7 @@ retry:
                        } else {
                                int tval;
                                r = mpg_float();
-                               tval = mpfr_strtofr(r->mpg_numbr, tokstart, 
NULL, base, RND_MODE);
+                               tval = mpfr_strtofr(r->mpg_numbr, tokstart, 
NULL, base, ROUND_MODE);
                                errno = 0;
                                IEEE_FMT(r->mpg_numbr, tval);
                        }
@@ -3906,7 +3906,7 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
        } else if (n->flags & NUMBER) {
 #ifdef HAVE_MPFR
                if (is_mpg_float(n))
-                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", RND_MODE, 
n->mpg_numbr));
+                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, 
n->mpg_numbr));
                else if (is_mpg_integer(n))
                        print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
                else
@@ -3918,7 +3918,7 @@ valinfo(NODE *n, Func_print print_func, FILE *fp)
        } else if (n->flags & NUMCUR) {
 #ifdef HAVE_MPFR
                if (is_mpg_float(n))
-                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", RND_MODE, 
n->mpg_numbr));
+                       print_func(fp, "%s\n", mpg_fmt("%.17R*g", ROUND_MODE, 
n->mpg_numbr));
                else if (is_mpg_integer(n))
                        print_func(fp, "%s\n", mpg_fmt("%Zd", n->mpg_i));
                else
diff --git a/builtin.c b/builtin.c
index 3045858..b17cea9 100644
--- a/builtin.c
+++ b/builtin.c
@@ -576,7 +576,7 @@ mpz2mpfr(mpz_ptr zi)
                inited = TRUE;
        } else
                mpfr_set_prec(mpfrval, prec);
-       tval = mpfr_set_z(mpfrval, zi, RND_MODE);
+       tval = mpfr_set_z(mpfrval, zi, ROUND_MODE);
        IEEE_FMT(mpfrval, tval);
        return mpfrval;
 }
@@ -1270,14 +1270,14 @@ mpf1:
                                         * the comparison below.
                                         */
                                        if (mpfr_sgn(mf) <= 0) {
-                                               if (! mpfr_fits_intmax_p(mf, 
RND_MODE)) {
+                                               if (! mpfr_fits_intmax_p(mf, 
ROUND_MODE)) {
                                                        /* -ve number is too 
large */
                                                        cs1 = 'g';
                                                        fmt_type = MP_FLOAT;
                                                        goto fmt1;
                                                }
 
-                                               tmpval = uval = (uintmax_t) 
mpfr_get_sj(mf, RND_MODE);
+                                               tmpval = uval = (uintmax_t) 
mpfr_get_sj(mf, ROUND_MODE);
                                                if (! alt && have_prec && prec 
== 0 && tmpval == 0)
                                                        goto pr_tail;   /* 
printf("%.0x", 0) is no characters */
                                                goto int0;
@@ -1478,7 +1478,7 @@ mpf1:
                        case MP_FLOAT:
                                sprintf(cp, "*.*R*%c", cs1);
                                while ((nc = mpfr_snprintf(obufout, ofre, cpbuf,
-                                            (int) fw, (int) prec, RND_MODE, 
mf)) >= ofre)
+                                            (int) fw, (int) prec, ROUND_MODE, 
mf)) >= ofre)
                                        chksize(nc)
                                break;
 #endif
diff --git a/command.c b/command.c
index fb6abf8..2572677 100644
--- a/command.c
+++ b/command.c
@@ -1713,7 +1713,7 @@ yyreduce:
     {
         case 3:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 109 "command.y"
     {
                cmd_idx = -1;
@@ -1733,7 +1733,7 @@ yyreduce:
 
   case 5:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 128 "command.y"
     {
                if (errcount == 0 && cmd_idx >= 0) {
@@ -1788,7 +1788,7 @@ yyreduce:
 
   case 6:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 178 "command.y"
     {
                yyerrok;
@@ -1797,14 +1797,14 @@ yyreduce:
 
   case 22:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 212 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 23:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 217 "command.y"
     {
                if (errcount == 0) {
@@ -1824,7 +1824,7 @@ yyreduce:
 
   case 24:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 235 "command.y"
     {
                (yyval) = append_statement(arg_list, (char *) start_EVAL);
@@ -1837,14 +1837,14 @@ yyreduce:
 
   case 25:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 242 "command.y"
     { (yyval) = append_statement((yyvsp[(1) - (2)]), lexptr_begin); }
     break;
 
   case 26:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 243 "command.y"
     {
                (yyval) = (yyvsp[(3) - (4)]);
@@ -1853,7 +1853,7 @@ yyreduce:
 
   case 27:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 250 "command.y"
     {
                arg_list = append_statement((yyvsp[(2) - (3)]), (char *) 
end_EVAL);
@@ -1874,7 +1874,7 @@ yyreduce:
 
   case 28:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 266 "command.y"
     {
                NODE *n;
@@ -1890,7 +1890,7 @@ yyreduce:
 
   case 34:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 285 "command.y"
     {
                if (cmdtab[cmd_idx].class == D_FRAME
@@ -1901,7 +1901,7 @@ yyreduce:
 
   case 35:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 291 "command.y"
     {
                int idx = find_argument((yyvsp[(2) - (2)]));
@@ -1918,49 +1918,49 @@ yyreduce:
 
   case 38:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 304 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 40:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 305 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 46:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 310 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 49:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 312 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 51:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 313 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 53:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 314 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 57:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 318 "command.y"
     {
                if (in_cmd_src((yyvsp[(2) - (2)])->a_string))
@@ -1970,7 +1970,7 @@ yyreduce:
 
   case 58:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 323 "command.y"
     {
                if (! input_from_tty)
@@ -1980,7 +1980,7 @@ yyreduce:
 
   case 59:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 328 "command.y"
     {
                int type = 0;
@@ -2011,7 +2011,7 @@ yyreduce:
 
   case 60:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 354 "command.y"
     {
                if (! in_commands)
@@ -2026,7 +2026,7 @@ yyreduce:
 
   case 61:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 364 "command.y"
     {
                if (! in_commands)
@@ -2036,7 +2036,7 @@ yyreduce:
 
   case 62:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 369 "command.y"
     {
                int idx = find_argument((yyvsp[(2) - (2)]));
@@ -2053,14 +2053,14 @@ yyreduce:
 
   case 63:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 380 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 64:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 381 "command.y"
     {
                int type;
@@ -2073,7 +2073,7 @@ yyreduce:
 
   case 65:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 389 "command.y"
     {
                if (in_commands) {
@@ -2089,7 +2089,7 @@ yyreduce:
 
   case 66:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 403 "command.y"
     {
                if ((yyvsp[(1) - (1)]) != NULL) {
@@ -2104,42 +2104,42 @@ yyreduce:
 
   case 68:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 417 "command.y"
     {  (yyval) = NULL; }
     break;
 
   case 69:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 422 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 74:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 431 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 75:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 436 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 77:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 439 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 78:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 444 "command.y"
     {
                NODE *n;
@@ -2151,14 +2151,14 @@ yyreduce:
 
   case 79:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 454 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 80:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 456 "command.y"
     {
                if (find_option((yyvsp[(1) - (1)])->a_string) < 0)
@@ -2168,7 +2168,7 @@ yyreduce:
 
   case 81:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 461 "command.y"
     {
                if (find_option((yyvsp[(1) - (3)])->a_string) < 0)
@@ -2178,7 +2178,7 @@ yyreduce:
 
   case 82:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 469 "command.y"
     {
                NODE *n;
@@ -2196,56 +2196,56 @@ yyreduce:
 
   case 83:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 485 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 88:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 494 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 89:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 495 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 92:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 497 "command.y"
     { want_nodeval = TRUE; }
     break;
 
   case 95:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 503 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 97:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 509 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 99:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 515 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 104:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 527 "command.y"
     {
                int idx = find_argument((yyvsp[(1) - (2)]));
@@ -2262,7 +2262,7 @@ yyreduce:
 
   case 106:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 543 "command.y"
     {
                (yyvsp[(2) - (2)])->type = D_array;     /* dump all items */
@@ -2272,7 +2272,7 @@ yyreduce:
 
   case 107:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 548 "command.y"
     {
                (yyvsp[(2) - (3)])->type = D_array;
@@ -2282,21 +2282,21 @@ yyreduce:
 
   case 117:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 574 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 118:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 576 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 119:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 578 "command.y"
     {
                CMDARG *a;
@@ -2308,7 +2308,7 @@ yyreduce:
 
   case 126:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 594 "command.y"
     {
                if ((yyvsp[(1) - (3)])->a_int > (yyvsp[(3) - (3)])->a_int)
@@ -2322,28 +2322,28 @@ yyreduce:
 
   case 127:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 606 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 134:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 620 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 135:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 622 "command.y"
     { (yyval) = (yyvsp[(1) - (3)]); }
     break;
 
   case 137:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 628 "command.y"
     {
                CMDARG *a;
@@ -2363,21 +2363,21 @@ yyreduce:
 
   case 139:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 647 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); num_dim = 1; }
     break;
 
   case 140:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 649 "command.y"
     {  (yyval) = (yyvsp[(1) - (2)]); num_dim++; }
     break;
 
   case 142:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 655 "command.y"
     {
                NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2391,7 +2391,7 @@ yyreduce:
 
   case 143:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 664 "command.y"
     {
                /* a_string is array name, a_count is dimension count */
@@ -2403,14 +2403,14 @@ yyreduce:
 
   case 144:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 674 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 145:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 676 "command.y"
     { 
                NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2422,7 +2422,7 @@ yyreduce:
 
   case 146:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 683 "command.y"
     { 
                NODE *n = (yyvsp[(2) - (2)])->a_node;
@@ -2436,35 +2436,35 @@ yyreduce:
 
   case 147:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 695 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 148:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 697 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 149:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 702 "command.y"
     { (yyval) = NULL; }
     break;
 
   case 150:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 704 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 151:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 709 "command.y"
     {
                if ((yyvsp[(1) - (1)])->a_int == 0)
@@ -2475,7 +2475,7 @@ yyreduce:
 
   case 152:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 715 "command.y"
     {
                if ((yyvsp[(2) - (2)])->a_int == 0)
@@ -2486,21 +2486,21 @@ yyreduce:
 
   case 153:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 724 "command.y"
     { (yyval) = (yyvsp[(1) - (1)]); }
     break;
 
   case 154:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 726 "command.y"
     { (yyval) = (yyvsp[(2) - (2)]); }
     break;
 
   case 155:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 728 "command.y"
     {
                (yyvsp[(2) - (2)])->a_int = - (yyvsp[(2) - (2)])->a_int;
@@ -2510,7 +2510,7 @@ yyreduce:
 
   case 156:
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 736 "command.y"
     {
                if (lexptr_begin != NULL) {
@@ -2524,7 +2524,7 @@ yyreduce:
 
 
 
-/* Line 1806 of yacc.c  */
+/* Line 1821 of yacc.c  */
 #line 2541 "command.c"
       default: break;
     }
@@ -3262,7 +3262,7 @@ err:
                if (do_mpfr) {
                        int tval;
                        r = mpg_float();
-                       tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 
0, RND_MODE);
+                       tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 
0, ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                        if (mpfr_integer_p(r->mpg_numbr)) {
                                /* integral value, convert to a GMP type. */
diff --git a/command.y b/command.y
index cb5707c..f603a61 100644
--- a/command.y
+++ b/command.y
@@ -1248,7 +1248,7 @@ err:
                if (do_mpfr) {
                        int tval;
                        r = mpg_float();
-                       tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 
0, RND_MODE);
+                       tval = mpfr_strtofr(r->mpg_numbr, tokstart, & lexptr, 
0, ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                        if (mpfr_integer_p(r->mpg_numbr)) {
                                /* integral value, convert to a GMP type. */
diff --git a/debug.c b/debug.c
index 03fbf47..30d040b 100644
--- a/debug.c
+++ b/debug.c
@@ -3658,7 +3658,7 @@ print_memory(NODE *m, NODE *func, Func_print print_func, 
FILE *fp)
                        else if ((m->flags & NUMBER) != 0) {
 #ifdef HAVE_MPFR
                                if (m->flags & MPFN)
-                                       print_func(fp, "%s", mpg_fmt("%R*g", 
RND_MODE, m->mpg_numbr));
+                                       print_func(fp, "%s", mpg_fmt("%R*g", 
ROUND_MODE, m->mpg_numbr));
                                else if (m->flags & MPZN)
                                        print_func(fp, "%s", mpg_fmt("%Zd", 
m->mpg_i));
                                else
@@ -3669,7 +3669,7 @@ print_memory(NODE *m, NODE *func, Func_print print_func, 
FILE *fp)
                        else if ((m->flags & NUMCUR) != 0) {
 #ifdef HAVE_MPFR
                                if (m->flags & MPFN)
-                                       print_func(fp, "%s", mpg_fmt("%R*g", 
RND_MODE, m->mpg_numbr));
+                                       print_func(fp, "%s", mpg_fmt("%R*g", 
ROUND_MODE, m->mpg_numbr));
                                else if (m->flags & MPZN)
                                        print_func(fp, "%s", mpg_fmt("%Zd", 
m->mpg_i));
                                else
diff --git a/field.c b/field.c
index 26ece84..68bd699 100644
--- a/field.c
+++ b/field.c
@@ -207,7 +207,7 @@ rebuild_record()
 #ifdef HAVE_MPFR
                                        if (is_mpg_float(r)) {
                                                mpfr_init(n->mpg_numbr);
-                                               mpfr_set(n->mpg_numbr, 
r->mpg_numbr, RND_MODE);
+                                               mpfr_set(n->mpg_numbr, 
r->mpg_numbr, ROUND_MODE);
                                        } else if (is_mpg_integer(r)) {
                                                mpz_init(n->mpg_i);
                                                mpz_set(n->mpg_i, r->mpg_i);
diff --git a/mpfr.c b/mpfr.c
index c42a663..07f96ff 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -37,7 +37,7 @@ mpz_t mpzval; /* GMP integer type, used as temporary in few 
places */
 mpz_t MNR;
 mpz_t MFNR;
 int do_ieee_fmt;       /* IEEE-754 floating-point emulation */
-mpfr_rnd_t RND_MODE;
+mpfr_rnd_t ROUND_MODE;
 
 static mpfr_rnd_t get_rnd_mode(const char rmode);
 static NODE *mpg_force_number(NODE *n);
@@ -82,8 +82,8 @@ void
 init_mpfr(mpfr_prec_t prec, const char *rmode)
 {
        mpfr_set_default_prec(prec);
-       RND_MODE = get_rnd_mode(rmode[0]);
-       mpfr_set_default_rounding_mode(RND_MODE);
+       ROUND_MODE = get_rnd_mode(rmode[0]);
+       mpfr_set_default_rounding_mode(ROUND_MODE);
        make_number = mpg_make_number;
        str2number = mpg_force_number;
        format_val = mpg_format_val;
@@ -146,7 +146,7 @@ mpg_make_number(double x)
        if ((ival = double_to_int(x)) != x) {
                int tval;
                r = mpg_float();
-               tval = mpfr_set_d(r->mpg_numbr, x, RND_MODE);
+               tval = mpfr_set_d(r->mpg_numbr, x, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        } else {
                r = mpg_integer();
@@ -329,7 +329,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
        }
 
        errno = 0;
-       tval = mpfr_strtofr(n->mpg_numbr, cp, & ptr, base, RND_MODE);
+       tval = mpfr_strtofr(n->mpg_numbr, cp, & ptr, base, ROUND_MODE);
        IEEE_FMT(n->mpg_numbr, tval);
 done:
        /* trailing space is OK for NUMBER */
@@ -616,7 +616,7 @@ set_ROUNDMODE()
                        rndm = get_rnd_mode(n->stptr[0]);
                if (rndm != -1) {
                        mpfr_set_default_rounding_mode(rndm);
-                       RND_MODE = rndm;
+                       ROUND_MODE = rndm;
                } else
                        warning(_("RNDMODE value `%.*s' is invalid"), (int) 
n->stlen, n->stptr);
        }
@@ -660,8 +660,8 @@ format_ieee(mpfr_ptr x, int tval)
 
        (void) mpfr_set_emin(min_exp);
        (void) mpfr_set_emax(max_exp);
-       tval = mpfr_check_range(x, tval, RND_MODE);
-       tval = mpfr_subnormalize(x, tval, RND_MODE);
+       tval = mpfr_check_range(x, tval, ROUND_MODE);
+       tval = mpfr_subnormalize(x, tval, ROUND_MODE);
        (void) mpfr_set_emin(MPFR_EMIN_DEFAULT);
        (void) mpfr_set_emax(MPFR_EMAX_DEFAULT);
        return tval;
@@ -693,7 +693,7 @@ do_mpfr_atan2(int nargs)
        p2 = MP_FLOAT(t2);
        res = mpg_float();
        /* See MPFR documentation for handling of special values like +inf as 
an argument */ 
-       tval = mpfr_atan2(res->mpg_numbr, p1, p2, RND_MODE);
+       tval = mpfr_atan2(res->mpg_numbr, p1, p2, ROUND_MODE);
        IEEE_FMT(res->mpg_numbr, tval);
 
        DEREF(t1);
@@ -712,7 +712,7 @@ if (do_lint && (t1->flags & (NUMCUR|NUMBER)) == 0)          
\
 force_number(t1);                                              \
 p1 = MP_FLOAT(t1);                                             \
 res = mpg_float();                                             \
-tval = mpfr_##X(res->mpg_numbr, p1, RND_MODE);                 \
+tval = mpfr_##X(res->mpg_numbr, p1, ROUND_MODE);                       \
 IEEE_FMT(res->mpg_numbr, tval);                                        \
 DEREF(t1);                                                     \
 return res
@@ -867,7 +867,7 @@ get_bit_ops(const char *op)
                        /* inf or NaN */
                        NODE *res;
                        res = mpg_float();
-                       mpfr_set(res->mpg_numbr, _tz1->mpg_numbr, RND_MODE);
+                       mpfr_set(res->mpg_numbr, _tz1->mpg_numbr, ROUND_MODE);
                        return res;
                }
 
@@ -904,7 +904,7 @@ get_bit_ops(const char *op)
                        /* inf or NaN */
                        NODE *res;
                        res = mpg_float();
-                       mpfr_set(res->mpg_numbr, _tz2->mpg_numbr, RND_MODE);
+                       mpfr_set(res->mpg_numbr, _tz2->mpg_numbr, ROUND_MODE);
                        return res;
                }
 
@@ -1035,7 +1035,7 @@ do_mpfr_strtonum(int nargs)
                if (is_mpg_float(tmp)) {
                        int tval;
                        r = mpg_float();
-                       tval = mpfr_set(r->mpg_numbr, tmp->mpg_numbr, RND_MODE);
+                       tval = mpfr_set(r->mpg_numbr, tmp->mpg_numbr, 
ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                } else {
                        r = mpg_integer();
@@ -1179,7 +1179,7 @@ mpg_tofloat(mpfr_ptr mf, mpz_ptr mz)
                        mpfr_set_prec(mf, prec);
        }
 
-       mpfr_set_z(mf, mz, RND_MODE);
+       mpfr_set_z(mf, mz, ROUND_MODE);
        return mf;
 }
 
@@ -1198,11 +1198,11 @@ mpg_add(NODE *t1, NODE *t2)
        } else {
                r = mpg_float();
                if (is_mpg_integer(t2))
-                       tval = mpfr_add_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, RND_MODE);
+                       tval = mpfr_add_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, ROUND_MODE);
                else if (is_mpg_integer(t1))
-                       tval = mpfr_add_z(r->mpg_numbr, t2->mpg_numbr, 
t1->mpg_i, RND_MODE);
+                       tval = mpfr_add_z(r->mpg_numbr, t2->mpg_numbr, 
t1->mpg_i, ROUND_MODE);
                else
-                       tval = mpfr_add(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, RND_MODE);
+                       tval = mpfr_add(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        }
        return r;
@@ -1222,21 +1222,21 @@ mpg_sub(NODE *t1, NODE *t2)
        } else {
                r = mpg_float();
                if (is_mpg_integer(t2))
-                       tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, RND_MODE);
+                       tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, ROUND_MODE);
                else if (is_mpg_integer(t1)) {
 #if (!defined(MPFR_VERSION) || (MPFR_VERSION < MPFR_VERSION_NUM(3,1,0)))
                        NODE *tmp = t1;
                        t1 = t2;
                        t2 = tmp;
-                       tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, RND_MODE);
-                       tval = mpfr_neg(r->mpg_numbr, r->mpg_numbr, RND_MODE);
+                       tval = mpfr_sub_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, ROUND_MODE);
+                       tval = mpfr_neg(r->mpg_numbr, r->mpg_numbr, ROUND_MODE);
                        t2 = t1;
                        t1 = tmp;
 #else
-                       tval = mpfr_z_sub(r->mpg_numbr, t1->mpg_i, 
t2->mpg_numbr, RND_MODE);
+                       tval = mpfr_z_sub(r->mpg_numbr, t1->mpg_i, 
t2->mpg_numbr, ROUND_MODE);
 #endif
                } else
-                       tval = mpfr_sub(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, RND_MODE);
+                       tval = mpfr_sub(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        }
        return r;
@@ -1256,11 +1256,11 @@ mpg_mul(NODE *t1, NODE *t2)
        } else {
                r = mpg_float();
                if (is_mpg_integer(t2))
-                       tval = mpfr_mul_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, RND_MODE);
+                       tval = mpfr_mul_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, ROUND_MODE);
                else if (is_mpg_integer(t1))
-                       tval = mpfr_mul_z(r->mpg_numbr, t2->mpg_numbr, 
t1->mpg_i, RND_MODE);
+                       tval = mpfr_mul_z(r->mpg_numbr, t2->mpg_numbr, 
t1->mpg_i, ROUND_MODE);
                else
-                       tval = mpfr_mul(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, RND_MODE);
+                       tval = mpfr_mul(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_numbr, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        }
        return r;
@@ -1284,17 +1284,17 @@ mpg_pow(NODE *t1, NODE *t2)
                        p1 = MP_FLOAT(t1);
                        p2 = MP_FLOAT(t2);
                        r = mpg_float();
-                       tval = mpfr_pow(r->mpg_numbr, p1, p2, RND_MODE);
+                       tval = mpfr_pow(r->mpg_numbr, p1, p2, ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                }
        } else {
                r = mpg_float();
                if (is_mpg_integer(t2))
-                       tval = mpfr_pow_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, RND_MODE);
+                       tval = mpfr_pow_z(r->mpg_numbr, t1->mpg_numbr, 
t2->mpg_i, ROUND_MODE);
                else {
                        mpfr_ptr p1;
                        p1 = MP_FLOAT(t1);
-                       tval = mpfr_pow(r->mpg_numbr, p1, t2->mpg_numbr, 
RND_MODE);
+                       tval = mpfr_pow(r->mpg_numbr, p1, t2->mpg_numbr, 
ROUND_MODE);
                }
                IEEE_FMT(r->mpg_numbr, tval);
        }
@@ -1320,7 +1320,7 @@ mpg_div(NODE *t1, NODE *t2)
                p1 = MP_FLOAT(t1);
                p2 = MP_FLOAT(t2);
                r = mpg_float();
-               tval = mpfr_div(r->mpg_numbr, p1, p2, RND_MODE);
+               tval = mpfr_div(r->mpg_numbr, p1, p2, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        }
        return r;
@@ -1342,7 +1342,7 @@ mpg_mod(NODE *t1, NODE *t2)
                p1 = MP_FLOAT(t1);
                p2 = MP_FLOAT(t2);
                r = mpg_float();
-               tval = mpfr_fmod(r->mpg_numbr, p1, p2, RND_MODE);
+               tval = mpfr_fmod(r->mpg_numbr, p1, p2, ROUND_MODE);
                IEEE_FMT(r->mpg_numbr, tval);
        }
        return r;
@@ -1476,7 +1476,7 @@ mod:
                        r = *lhs = mpg_float();
                        tval = mpfr_add_si(r->mpg_numbr, t1->mpg_numbr,
                                        op == Op_preincrement ? 1 : -1,
-                                       RND_MODE);
+                                       ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                }
                if (r != t1)
@@ -1505,12 +1505,12 @@ mod:
                                mpz_sub_ui(t2->mpg_i, t1->mpg_i, 1);
                } else {
                        r = mpg_float();
-                       tval = mpfr_set(r->mpg_numbr, t1->mpg_numbr, RND_MODE);
+                       tval = mpfr_set(r->mpg_numbr, t1->mpg_numbr, 
ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                        t2 = *lhs = mpg_float();
                        tval = mpfr_add_si(t2->mpg_numbr, t1->mpg_numbr,
                                        op == Op_postincrement ? 1 : -1,
-                                       RND_MODE);
+                                       ROUND_MODE);
                        IEEE_FMT(t2->mpg_numbr, tval);
                }
                if (t2 != t1)
@@ -1522,7 +1522,7 @@ mod:
                t1 = TOP_NUMBER();
                if (is_mpg_float(t1)) {
                        r = mpg_float();
-                       tval = mpfr_neg(r->mpg_numbr, t1->mpg_numbr, RND_MODE);
+                       tval = mpfr_neg(r->mpg_numbr, t1->mpg_numbr, 
ROUND_MODE);
                        IEEE_FMT(r->mpg_numbr, tval);
                } else {
                        r = mpg_integer();
diff --git a/profile.c b/profile.c
index 7d5c07b..181395d 100644
--- a/profile.c
+++ b/profile.c
@@ -1210,7 +1210,7 @@ pp_number(NODE *n)
        emalloc(str, char *, PP_PRECISION + 10, "pp_number");
 #ifdef HAVE_MPFR
        if (is_mpg_float(n))
-               mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, RND_MODE, 
n->mpg_numbr);
+               mpfr_sprintf(str, "%0.*R*g", PP_PRECISION, ROUND_MODE, 
n->mpg_numbr);
        else if (is_mpg_integer(n))
                mpfr_sprintf(str, "%Zd", n->mpg_i);
        else

-----------------------------------------------------------------------

Summary of changes:
 array.c   |    4 +-
 awk.h     |   10 ++--
 awkgram.c |    8 ++--
 awkgram.y |    8 ++--
 builtin.c |    8 ++--
 command.c |  150 ++++++++++++++++++++++++++++++------------------------------
 command.y |    2 +-
 debug.c   |    4 +-
 field.c   |    2 +-
 mpfr.c    |   68 ++++++++++++++--------------
 profile.c |    2 +-
 11 files changed, 133 insertions(+), 133 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]