gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2426-g7b46fc


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, master, updated. gawk-4.1.0-2426-g7b46fc2
Date: Wed, 1 Feb 2017 19:17:57 +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, master has been updated
       via  7b46fc2f6243d91e01b6e74fd69b193b4eddb05b (commit)
       via  85e1012dab425dc50bc3faa2a3f28a9a47dac017 (commit)
       via  6e6ac2dccf7048f501e19490c90ea31c3f527633 (commit)
      from  ca900f23af26a5324e3519d1c99d0891cf00db46 (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=7b46fc2f6243d91e01b6e74fd69b193b4eddb05b

commit 7b46fc2f6243d91e01b6e74fd69b193b4eddb05b
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Feb 1 21:17:33 2017 +0200

    Improve making of profile number code and also MPFR case thereof.

diff --git a/ChangeLog b/ChangeLog
index 1d42e9e..8a0dfc3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,12 @@
        gawk_mb_cur_max. Thanks to Andrew Schorr for making me look
        at this code.
 
+       Unrelated:
+
+       * awkgram.y (make_profile_number): Renamed to ...
+       (set_profile_next): New function. All calls adjusted. Also improved
+       use at MPFR number case.
+
 2017-01-27         Andrew J. Schorr     <address@hidden>
 
        * interpret.h [UNFIELD]: Fix condition for assignment from
diff --git a/awkgram.c b/awkgram.c
index c6f47db..5b55cf5 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -97,7 +97,7 @@ static int include_source(INSTRUCTION *file);
 static int load_library(INSTRUCTION *file);
 static void next_sourcefile(void);
 static char *tokexpand(void);
-static NODE *make_profile_number(double d, const char *str, size_t len);
+static NODE *set_profile_text(NODE *n, const char *str, size_t len);
 
 #define instruction(t) bcalloc(t, 1, 0)
 
@@ -3810,7 +3810,7 @@ regular_print:
                if ((yyvsp[0])->opcode == Op_match_rec) {
                        (yyvsp[0])->opcode = Op_nomatch;
                        (yyvsp[-1])->opcode = Op_push_i;
-                       (yyvsp[-1])->memory = make_profile_number(0.0, "0", 1);
+                       (yyvsp[-1])->memory = 
set_profile_text(make_number(0.0), "0", 1);
                        (yyval) = 
list_append(list_append(list_create((yyvsp[-1])),
                                                instruction(Op_field_spec)), 
(yyvsp[0]));
                } else {
@@ -6440,12 +6440,7 @@ retry:
                                errno = 0;
                                IEEE_FMT(r->mpg_numbr, tval);
                        }
-                       yylval->memory = r;
-                       if (do_pretty_print) {
-                               yylval->memory->stptr = estrdup(tokstart, 
strlen(tokstart)-1);
-                               yylval->memory->stlen = strlen(tokstart)-1;
-                               yylval->memory->flags |= NUMCONSTSTR;
-                       }
+                       yylval->memory = set_profile_text(r, tokstart, 
strlen(tokstart)-1);
                        return lasttok = YNUMBER;
                }
 #endif
@@ -6453,7 +6448,7 @@ retry:
                        d = nondec2awknum(tokstart, strlen(tokstart), NULL);
                else
                        d = atof(tokstart);
-               yylval->memory = make_profile_number(d, tokstart, 
strlen(tokstart) - 1);
+               yylval->memory = set_profile_text(make_number(d), tokstart, 
strlen(tokstart) - 1);
                if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d)
                        yylval->memory->flags |= NUMINT;
                return lasttok = YNUMBER;
@@ -6763,7 +6758,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                                INSTRUCTION *expr;
 
                                expr = list_create(instruction(Op_push_i));
-                               expr->nexti->memory = make_profile_number(0.0, 
"0", 1);
+                               expr->nexti->memory = 
set_profile_text(make_number(0.0), "0", 1);
                                (void) mk_expression_list(subn,
                                                list_append(expr, 
instruction(Op_field_spec)));
                        }
@@ -6811,7 +6806,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                        r->sub_flags |= GENSUB;
                        if (nexp == 3) {
                                ip = instruction(Op_push_i);
-                               ip->memory = make_profile_number(0.0, "0", 1);
+                               ip->memory = set_profile_text(make_number(0.0), 
"0", 1);
                                (void) mk_expression_list(subn,
                                                list_append(list_create(ip), 
instruction(Op_field_spec)));
                        }
@@ -6840,7 +6835,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                        list = list_create(r);
                        (void) list_prepend(list, instruction(Op_field_spec));
                        (void) list_prepend(list, instruction(Op_push_i));
-                       list->nexti->memory = make_profile_number(0.0, "0", 1);
+                       list->nexti->memory = 
set_profile_text(make_number(0.0), "0", 1);
                        return list;
                } else {
                        arg = subn->nexti;
@@ -7647,7 +7642,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION 
*op)
                        }
 
                        op->opcode = Op_push_i;
-                       // We don't need to call make_profile_number() here 
since
+                       // We don't need to call set_profile_text() here since
                        // optimizing is disabled when doing pretty printing.
                        op->memory = make_number(res);
                        unref(n1);
@@ -8711,12 +8706,11 @@ is_identchar(int c)
        return (is_alnum(c) || c == '_');
 }
 
-/* make_profile_number --- make a number that can be printed when profiling */
+/* set_profile_text --- make a number that can be printed when profiling */
 
 static NODE *
-make_profile_number(double d, const char *str, size_t len)
+set_profile_text(NODE *n, const char *str, size_t len)
 {
-       NODE *n = make_number(d);
        if (do_pretty_print) {
                // extra byte in case need to add minus sign in negate_num
                n->stptr = estrdup(str, len + 1);
diff --git a/awkgram.y b/awkgram.y
index 8027881..541cebf 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -57,7 +57,7 @@ static int include_source(INSTRUCTION *file);
 static int load_library(INSTRUCTION *file);
 static void next_sourcefile(void);
 static char *tokexpand(void);
-static NODE *make_profile_number(double d, const char *str, size_t len);
+static NODE *set_profile_text(NODE *n, const char *str, size_t len);
 
 #define instruction(t) bcalloc(t, 1, 0)
 
@@ -1710,7 +1710,7 @@ non_post_simp_exp
                if ($2->opcode == Op_match_rec) {
                        $2->opcode = Op_nomatch;
                        $1->opcode = Op_push_i;
-                       $1->memory = make_profile_number(0.0, "0", 1);
+                       $1->memory = set_profile_text(make_number(0.0), "0", 1);
                        $$ = list_append(list_append(list_create($1),
                                                instruction(Op_field_spec)), 
$2);
                } else {
@@ -4020,12 +4020,7 @@ retry:
                                errno = 0;
                                IEEE_FMT(r->mpg_numbr, tval);
                        }
-                       yylval->memory = r;
-                       if (do_pretty_print) {
-                               yylval->memory->stptr = estrdup(tokstart, 
strlen(tokstart)-1);
-                               yylval->memory->stlen = strlen(tokstart)-1;
-                               yylval->memory->flags |= NUMCONSTSTR;
-                       }
+                       yylval->memory = set_profile_text(r, tokstart, 
strlen(tokstart)-1);
                        return lasttok = YNUMBER;
                }
 #endif
@@ -4033,7 +4028,7 @@ retry:
                        d = nondec2awknum(tokstart, strlen(tokstart), NULL);
                else
                        d = atof(tokstart);
-               yylval->memory = make_profile_number(d, tokstart, 
strlen(tokstart) - 1);
+               yylval->memory = set_profile_text(make_number(d), tokstart, 
strlen(tokstart) - 1);
                if (d <= INT32_MAX && d >= INT32_MIN && d == (int32_t) d)
                        yylval->memory->flags |= NUMINT;
                return lasttok = YNUMBER;
@@ -4343,7 +4338,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                                INSTRUCTION *expr;
 
                                expr = list_create(instruction(Op_push_i));
-                               expr->nexti->memory = make_profile_number(0.0, 
"0", 1);
+                               expr->nexti->memory = 
set_profile_text(make_number(0.0), "0", 1);
                                (void) mk_expression_list(subn,
                                                list_append(expr, 
instruction(Op_field_spec)));
                        }
@@ -4391,7 +4386,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                        r->sub_flags |= GENSUB;
                        if (nexp == 3) {
                                ip = instruction(Op_push_i);
-                               ip->memory = make_profile_number(0.0, "0", 1);
+                               ip->memory = set_profile_text(make_number(0.0), 
"0", 1);
                                (void) mk_expression_list(subn,
                                                list_append(list_create(ip), 
instruction(Op_field_spec)));
                        }
@@ -4420,7 +4415,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
                        list = list_create(r);
                        (void) list_prepend(list, instruction(Op_field_spec));
                        (void) list_prepend(list, instruction(Op_push_i));
-                       list->nexti->memory = make_profile_number(0.0, "0", 1);
+                       list->nexti->memory = 
set_profile_text(make_number(0.0), "0", 1);
                        return list;
                } else {
                        arg = subn->nexti;
@@ -5227,7 +5222,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION 
*op)
                        }
 
                        op->opcode = Op_push_i;
-                       // We don't need to call make_profile_number() here 
since
+                       // We don't need to call set_profile_text() here since
                        // optimizing is disabled when doing pretty printing.
                        op->memory = make_number(res);
                        unref(n1);
@@ -6291,12 +6286,11 @@ is_identchar(int c)
        return (is_alnum(c) || c == '_');
 }
 
-/* make_profile_number --- make a number that can be printed when profiling */
+/* set_profile_text --- make a number that can be printed when profiling */
 
 static NODE *
-make_profile_number(double d, const char *str, size_t len)
+set_profile_text(NODE *n, const char *str, size_t len)
 {
-       NODE *n = make_number(d);
        if (do_pretty_print) {
                // extra byte in case need to add minus sign in negate_num
                n->stptr = estrdup(str, len + 1);

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=85e1012dab425dc50bc3faa2a3f28a9a47dac017

commit 85e1012dab425dc50bc3faa2a3f28a9a47dac017
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Feb 1 21:13:33 2017 +0200

    Fix up mbc_char_count to be correct.

diff --git a/ChangeLog b/ChangeLog
index bbec422..1d42e9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-02-01         Arnold D. Robbins     <address@hidden>
+
+       * builtin.c (mbc_char_count): Remove spurious multiplies by
+       gawk_mb_cur_max. Thanks to Andrew Schorr for making me look
+       at this code.
+
 2017-01-27         Andrew J. Schorr     <address@hidden>
 
        * interpret.h [UNFIELD]: Fix condition for assignment from
diff --git a/builtin.c b/builtin.c
index f71d71d..f410476 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4076,12 +4076,12 @@ mbc_char_count(const char *ptr, size_t numbytes)
 
        memset(& cur_state, 0, sizeof(cur_state));
 
-       mb_len = mbrlen(ptr, numbytes * gawk_mb_cur_max, &cur_state);
+       mb_len = mbrlen(ptr, numbytes, &cur_state);
        if (mb_len <= 0)
                return numbytes;        /* no valid m.b. char */
 
        for (; numbytes > 0; numbytes--) {
-               mb_len = mbrlen(ptr, numbytes * gawk_mb_cur_max, &cur_state);
+               mb_len = mbrlen(ptr, numbytes, &cur_state);
                if (mb_len <= 0)
                        break;
                sum++;

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6e6ac2dccf7048f501e19490c90ea31c3f527633

commit 6e6ac2dccf7048f501e19490c90ea31c3f527633
Author: Arnold D. Robbins <address@hidden>
Date:   Wed Feb 1 21:10:44 2017 +0200

    Further revise po/POTFILES.in.

diff --git a/po/ChangeLog b/po/ChangeLog
index af68105..2db026b 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,7 @@
+2017-02-01         Arnold D. Robbins     <address@hidden>
+
+       * POTFILES.in: Update list of files and sort it.
+
 2017-01-27         Rafael Fontenelle     <address@hidden>
 
        * POTFILES.in: Fix path of some files listed there so that
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4ecb6c2..bc8c9c7 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,5 +1,5 @@
 # List of source files containing translatable strings.
-# Copyright (C) 1999, 2002, 2012 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2002, 2012, 2017 Free Software Foundation, Inc.
 
 array.c
 awkgram.c
@@ -7,7 +7,6 @@ builtin.c
 cint_array.c
 command.c
 debug.c
-support/dfa.c
 eval.c
 ext.c
 extension/filefuncs.c
@@ -29,8 +28,6 @@ field.c
 floatcomp.c
 gawkapi.c
 gawkmisc.c
-support/getopt.c
-support/getopt1.c
 int_array.c
 io.c
 main.c
@@ -39,13 +36,17 @@ msg.c
 node.c
 posix/gawkmisc.c
 profile.c
-support/random.c
 re.c
+replace.c
+str_array.c
+support/dfa.c
+support/getopt.c
+support/getopt1.c
+support/localeinfo.c
+support/random.c
 support/regcomp.c
 support/regex.c
 support/regex_internal.c
 support/regexec.c
-replace.c
-str_array.c
 symbol.c
 version.c

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

Summary of changes:
 ChangeLog      |   12 ++++++++++++
 awkgram.c      |   26 ++++++++++----------------
 awkgram.y      |   26 ++++++++++----------------
 builtin.c      |    4 ++--
 po/ChangeLog   |    4 ++++
 po/POTFILES.in |   15 ++++++++-------
 6 files changed, 46 insertions(+), 41 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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