gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, master, updated. gawk-4.1.0-3913-ge5e6f7a


From: Arnold Robbins
Subject: [SCM] gawk branch, master, updated. gawk-4.1.0-3913-ge5e6f7a
Date: Tue, 10 Mar 2020 03:57:30 -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, master has been updated
       via  e5e6f7aafa1409b39b6eb6759987813cd94e58ed (commit)
       via  c1596f94a5b3e26cc095f12c853dac83aad21420 (commit)
       via  0add33f3c3e8e8a5a735b6a1b779d91ee3884246 (commit)
      from  2f0eddafa9a66aebf2e2ed1c49a9e8ce9e892a8c (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=e5e6f7aafa1409b39b6eb6759987813cd94e58ed

commit e5e6f7aafa1409b39b6eb6759987813cd94e58ed
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 10 09:57:14 2020 +0200

    Final round (for now) of message fixes.

diff --git a/builtin.c b/builtin.c
index 4c3817b..dc8d1a8 100644
--- a/builtin.c
+++ b/builtin.c
@@ -160,7 +160,7 @@ do_exp(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("exp: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "exp");
        d = force_number(tmp)->numbr;
        DEREF(tmp);
        errno = 0;
@@ -375,9 +375,9 @@ do_index(int nargs)
 
        if (do_lint) {
                if ((fixtype(s1)->flags & STRING) == 0)
-                       lintwarn(_("index: received non-string first 
argument"));
+                       lintwarn(_("%s: received non-string first argument"), 
"index");
                if ((fixtype(s2)->flags & STRING) == 0)
-                       lintwarn(_("index: received non-string second 
argument"));
+                       lintwarn(_("%s: received non-string second argument"), 
"index");
        }
 
        s1 = force_string(s1);
@@ -490,7 +490,7 @@ do_int(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("int: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "int");
        d = force_number(tmp)->numbr;
        d = double_to_int(d);
        DEREF(tmp);
@@ -551,7 +551,7 @@ do_length(int nargs)
        assert(tmp->type == Node_val);
 
        if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
-               lintwarn(_("length: received non-string argument"));
+               lintwarn(_("%s: received non-string argument"), "length");
        tmp = force_string(tmp);
 
        if (gawk_mb_cur_max > 1) {
@@ -580,10 +580,10 @@ do_log(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("log: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "log");
        arg = force_number(tmp)->numbr;
        if (arg < 0.0)
-               warning(_("log: received negative argument %g"), arg);
+               warning(_("%s: received negative argument %g"), "log", arg);
        d = log(arg);
        DEREF(tmp);
        return make_number((AWKNUM) d);
@@ -1794,11 +1794,11 @@ do_sqrt(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("sqrt: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "sqrt");
        arg = (double) force_number(tmp)->numbr;
        DEREF(tmp);
        if (arg < 0.0)
-               warning(_("sqrt: called with negative argument %g"), arg);
+               warning(_("%s: received negative argument %g"), "sqrt", arg);
        return make_number((AWKNUM) sqrt(arg));
 }
 
@@ -2005,7 +2005,7 @@ do_strftime(int nargs)
                if (nargs >= 2) {
                        t2 = POP_SCALAR();
                        if (do_lint && (fixtype(t2)->flags & NUMBER) == 0)
-                               lintwarn(_("strftime: received non-numeric 
second argument"));
+                               lintwarn(_("%s: received non-numeric second 
argument"), "strftime");
                        (void) force_number(t2);
                        clock_val = get_number_d(t2);
                        fclock = (time_t) clock_val;
@@ -2031,7 +2031,7 @@ do_strftime(int nargs)
 
                tmp = POP_SCALAR();
                if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
-                       lintwarn(_("strftime: received non-string first 
argument"));
+                       lintwarn(_("%s: received non-string first argument"), 
"strftime");
 
                t1 = force_string(tmp);
                format = t1->stptr;
@@ -2121,7 +2121,7 @@ do_mktime(int nargs)
                do_gmt = false;
        t1 = POP_SCALAR();
        if (do_lint && (fixtype(t1)->flags & STRING) == 0)
-               lintwarn(_("mktime: received non-string argument"));
+               lintwarn(_("%s: received non-string argument"), "mktime");
        t1 = force_string(t1);
 
        save = t1->stptr[t1->stlen];
@@ -2179,7 +2179,7 @@ do_system(int nargs)
        (void) flush_io();     /* so output is synchronous with gawk's */
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
-               lintwarn(_("system: received non-string argument"));
+               lintwarn(_("%s: received non-string argument"), "system");
        cmd = force_string(tmp)->stptr;
 
        if (cmd && *cmd) {
@@ -2431,7 +2431,7 @@ do_tolower(int nargs)
 
        t1 = POP_SCALAR();
        if (do_lint && (fixtype(t1)->flags & STRING) == 0)
-               lintwarn(_("tolower: received non-string argument"));
+               lintwarn(_("%s: received non-string argument"), "tolower");
        t1 = force_string(t1);
        t2 = make_string(t1->stptr, t1->stlen);
 
@@ -2462,7 +2462,7 @@ do_toupper(int nargs)
 
        t1 = POP_SCALAR();
        if (do_lint && (fixtype(t1)->flags & STRING) == 0)
-               lintwarn(_("toupper: received non-string argument"));
+               lintwarn(_("%s: received non-string argument"), "toupper");
        t1 = force_string(t1);
        t2 = make_string(t1->stptr, t1->stlen);
 
@@ -2495,9 +2495,9 @@ do_atan2(int nargs)
        POP_TWO_SCALARS(t1, t2);
        if (do_lint) {
                if ((fixtype(t1)->flags & NUMBER) == 0)
-                       lintwarn(_("atan2: received non-numeric first 
argument"));
+                       lintwarn(_("%s: received non-numeric first argument"), 
"atan2");
                if ((fixtype(t2)->flags & NUMBER) == 0)
-                       lintwarn(_("atan2: received non-numeric second 
argument"));
+                       lintwarn(_("%s: received non-numeric second argument"), 
"atan2");
        }
        d1 = force_number(t1)->numbr;
        d2 = force_number(t2)->numbr;
@@ -2516,7 +2516,7 @@ do_sin(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("sin: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "sin");
        d = sin((double) force_number(tmp)->numbr);
        DEREF(tmp);
        return make_number((AWKNUM) d);
@@ -2532,7 +2532,7 @@ do_cos(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("cos: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "cos");
        d = cos((double) force_number(tmp)->numbr);
        DEREF(tmp);
        return make_number((AWKNUM) d);
@@ -2646,7 +2646,7 @@ do_srand(int nargs)
        else {
                tmp = POP_SCALAR();
                if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-                       lintwarn(_("srand: received non-numeric argument"));
+                       lintwarn(_("%s: received non-numeric argument"), 
"srand");
                srandom((unsigned int) (save_seed = (long) 
force_number(tmp)->numbr));
                DEREF(tmp);
        }
@@ -3433,9 +3433,9 @@ do_lshift(int nargs)
        POP_TWO_SCALARS(s1, s2);
        if (do_lint) {
                if ((fixtype(s1)->flags & NUMBER) == 0)
-                       lintwarn(_("lshift: received non-numeric first 
argument"));
+                       lintwarn(_("%s: received non-numeric first argument"), 
"lshift");
                if ((fixtype(s2)->flags & NUMBER) == 0)
-                       lintwarn(_("lshift: received non-numeric second 
argument"));
+                       lintwarn(_("%s: received non-numeric second argument"), 
"lshift");
        }
 
        val = force_number(s1)->numbr;
@@ -3472,9 +3472,9 @@ do_rshift(int nargs)
        POP_TWO_SCALARS(s1, s2);
        if (do_lint) {
                if ((fixtype(s1)->flags & NUMBER) == 0)
-                       lintwarn(_("rshift: received non-numeric first 
argument"));
+                       lintwarn(_("%s: received non-numeric first argument"), 
"rshift");
                if ((fixtype(s2)->flags & NUMBER) == 0)
-                       lintwarn(_("rshift: received non-numeric second 
argument"));
+                       lintwarn(_("%s: received non-numeric second argument"), 
"rshift");
        }
 
        val = force_number(s1)->numbr;
@@ -3510,16 +3510,16 @@ do_and(int nargs)
 
        res = ~(uintmax_t) 0;   /* start off with all ones */
        if (nargs < 2)
-               fatal(_("and: called with less than two arguments"));
+               fatal(_("%s: called with less than two arguments"), "and");
 
        for (; nargs > 0; nargs--) {
                s1 = POP_SCALAR();
                if (do_lint && (fixtype(s1)->flags & NUMBER) == 0)
-                       lintwarn(_("and: argument %d is non-numeric"), nargs);
+                       lintwarn(_("%s: argument %d is non-numeric"), "and", 
nargs);
 
                val = force_number(s1)->numbr;
                if (val < 0)
-                       fatal(_("and: argument %d negative value %g is not 
allowed"), nargs, val);
+                       fatal(_("%s: argument %d negative value %g is not 
allowed"), "and", nargs, val);
 
                uval = (uintmax_t) val;
                res &= uval;
@@ -3541,16 +3541,16 @@ do_or(int nargs)
 
        res = 0;
        if (nargs < 2)
-               fatal(_("or: called with less than two arguments"));
+               fatal(_("%s: called with less than two arguments"), "or");
 
        for (; nargs > 0; nargs--) {
                s1 = POP_SCALAR();
                if (do_lint && (fixtype(s1)->flags & NUMBER) == 0)
-                       lintwarn(_("or: argument %d is non-numeric"), nargs);
+                       lintwarn(_("%s: argument %d is non-numeric"), "or", 
nargs);
 
                val = force_number(s1)->numbr;
                if (val < 0)
-                       fatal(_("or: argument %d negative value %g is not 
allowed"), nargs, val);
+                       fatal(_("%s: argument %d negative value %g is not 
allowed"), "or", nargs, val);
 
                uval = (uintmax_t) val;
                res |= uval;
@@ -3571,17 +3571,17 @@ do_xor(int nargs)
        AWKNUM val;
 
        if (nargs < 2)
-               fatal(_("xor: called with less than two arguments"));
+               fatal(_("%s: called with less than two arguments"), "xor");
 
        res = 0;        /* start with all zeroes */
        for (; nargs > 0; nargs--) {
                s1 = POP_SCALAR();
                if (do_lint && (fixtype(s1)->flags & NUMBER) == 0)
-                       lintwarn(_("xor: argument %d is non-numeric"), nargs);
+                       lintwarn(_("%s: argument %d is non-numeric"), "xor", 
nargs);
 
                val = force_number(s1)->numbr;
                if (val < 0)
-                       fatal(_("xor: argument %d negative value %g is not 
allowed"), nargs, val);
+                       fatal(_("%s: argument %d negative value %g is not 
allowed"), "xor", nargs, val);
 
                uval = (uintmax_t) val;
                res ^= uval;
@@ -3603,7 +3603,7 @@ do_compl(int nargs)
 
        tmp = POP_SCALAR();
        if (do_lint && (fixtype(tmp)->flags & NUMBER) == 0)
-               lintwarn(_("compl: received non-numeric argument"));
+               lintwarn(_("%s: received non-numeric argument"), "compl");
        d = force_number(tmp)->numbr;
        DEREF(tmp);
 
@@ -4027,9 +4027,9 @@ do_intdiv(int nargs)
 
        if (do_lint) {
                if ((fixtype(numerator)->flags & NUMBER) == 0)
-                       lintwarn(_("intdiv: received non-numeric first 
argument"));
+                       lintwarn(_("%s: received non-numeric first argument"), 
"intdiv");
                if ((fixtype(denominator)->flags & NUMBER) == 0)
-                       lintwarn(_("intdiv: received non-numeric second 
argument"));
+                       lintwarn(_("%s: received non-numeric second argument"), 
"intdiv");
        }
 
        (void) force_number(numerator);

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

commit c1596f94a5b3e26cc095f12c853dac83aad21420
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 10 09:43:59 2020 +0200

    Update in TODO.

diff --git a/TODO b/TODO
index c6aae80..2ff4225 100644
--- a/TODO
+++ b/TODO
@@ -33,6 +33,12 @@ Minor Cleanups and Code Improvements
        See if something like  b = a "" can be optimized to not do
        a concatenation, but instead just set STRCUR on a.
 
+       Message cleanup:
+       * Messages in debug.c start with capital letters, but not in
+         other files.
+
+       * Messages are inconsistent about final punctuation (periods etc.)
+
 Minor New Features
 ------------------
 

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=0add33f3c3e8e8a5a735b6a1b779d91ee3884246

commit 0add33f3c3e8e8a5a735b6a1b779d91ee3884246
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Mar 10 09:42:23 2020 +0200

    Second round of message fixes.

diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 828f68a..c47a2d5 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -471,9 +471,13 @@ do_stat(int nargs, awk_value_t *result, struct 
awk_ext_func *unused)
        assert(result != NULL);
 
        /* file is first arg, array to hold results is second */
-       if (   ! get_argument(0, AWK_STRING, & file_param)
-           || ! get_argument(1, AWK_ARRAY, & array_param)) {
-               warning(ext_id, _("stat: bad parameters"));
+       if (! get_argument(0, AWK_STRING, & file_param)) {
+               warning(ext_id, _("stat: first argument is not a string"));
+               return make_number(-1, result);
+       }
+
+       if (! get_argument(1, AWK_ARRAY, & array_param)) {
+               warning(ext_id, _("stat: second argument is not an array"));
                return make_number(-1, result);
        }
 
@@ -622,7 +626,7 @@ fill_stat_element(awk_array_t element_array, const char 
*name, struct stat *sbuf
 
        stat_array = create_array();
        if (stat_array == NULL) {
-               warning(ext_id, _("fill_stat_element: could not create array"));
+               warning(ext_id, _("fill_stat_element: could not create array, 
out of memory"));
                fts_errors++;
                return;
        }
@@ -841,19 +845,19 @@ do_fts(int nargs, awk_value_t *result, struct 
awk_ext_func *unused)
                lintwarn(ext_id, _("fts: called with incorrect number of 
arguments, expecting 3"));
 
        if (! get_argument(0, AWK_ARRAY, & pathlist)) {
-               warning(ext_id, _("fts: bad first parameter"));
+               warning(ext_id, _("fts: first parameter is not an array"));
                update_ERRNO_int(EINVAL);
                goto out;
        }
 
        if (! get_argument(1, AWK_NUMBER, & flagval)) {
-               warning(ext_id, _("fts: bad second parameter"));
+               warning(ext_id, _("fts: second parameter is not a number"));
                update_ERRNO_int(EINVAL);
                goto out;
        }
 
        if (! get_argument(2, AWK_ARRAY, & dest)) {
-               warning(ext_id, _("fts: bad third parameter"));
+               warning(ext_id, _("fts: third parameter is not an array"));
                update_ERRNO_int(EINVAL);
                goto out;
        }
@@ -893,10 +897,7 @@ do_fts(int nargs, awk_value_t *result, struct awk_ext_func 
*unused)
 
 
        /* clear dest array */
-       if (! clear_array(dest.array_cookie)) {
-               warning(ext_id, _("fts: clear_array() failed\n"));
-               goto out;
-       }
+       assert(clear_array(dest.array_cookie));
 
        /* let's do it! */
        if ((hierarchy = fts_open(pathvector, flags, NULL)) != NULL) {
diff --git a/extension/ordchr.c b/extension/ordchr.c
index d954312..28d3e03 100644
--- a/extension/ordchr.c
+++ b/extension/ordchr.c
@@ -69,7 +69,7 @@ do_ord(int nargs, awk_value_t *result, struct awk_ext_func 
*unused)
        if (get_argument(0, AWK_STRING, & str)) {
                ret = str.str_value.str[0];
        } else if (do_lint)
-               lintwarn(ext_id, _("ord: called with inappropriate 
argument(s)"));
+               lintwarn(ext_id, _("ord: first argument is not a string"));
 
        /* Set the return value */
        return make_number(ret, result);
@@ -96,7 +96,7 @@ do_chr(int nargs, awk_value_t *result, struct awk_ext_func 
*unused)
                str[0] = ret;
                str[1] = '\0';
        } else if (do_lint)
-               lintwarn(ext_id, _("chr: called with inappropriate 
argument(s)"));
+               lintwarn(ext_id, _("chr: first argument is not a number"));
 
        /* Set the return value */
        return make_const_string(str, 1, result);
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 9ba2dca..0300dca 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -116,13 +116,13 @@ do_writea(int nargs, awk_value_t *result, struct 
awk_ext_func *unused)
 
        /* filename is first arg, array to dump is second */
        if (! get_argument(0, AWK_STRING, & filename)) {
-               fprintf(stderr, _("do_writea: argument 0 is not a string\n"));
+               fprintf(stderr, _("do_writea: first argument is not a 
string\n"));
                errno = EINVAL;
                goto done1;
        }
 
        if (! get_argument(1, AWK_ARRAY, & array)) {
-               fprintf(stderr, _("do_writea: argument 1 is not an array\n"));
+               fprintf(stderr, _("do_writea: second argument is not an 
array\n"));
                errno = EINVAL;
                goto done1;
        }
@@ -289,13 +289,13 @@ do_reada(int nargs, awk_value_t *result, struct 
awk_ext_func *unused)
 
        /* directory is first arg, array to read is second */
        if (! get_argument(0, AWK_STRING, & filename)) {
-               fprintf(stderr, _("do_reada: argument 0 is not a string\n"));
+               fprintf(stderr, _("do_reada: first argument is not a 
string\n"));
                errno = EINVAL;
                goto done1;
        }
 
        if (! get_argument(1, AWK_ARRAY, & array)) {
-               fprintf(stderr, _("do_reada: argument 1 is not an array\n"));
+               fprintf(stderr, _("do_reada: second argument is not an 
array\n"));
                errno = EINVAL;
                goto done1;
        }

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

Summary of changes:
 TODO                  |  6 +++++
 builtin.c             | 72 +++++++++++++++++++++++++--------------------------
 extension/filefuncs.c | 23 ++++++++--------
 extension/ordchr.c    |  4 +--
 extension/rwarray.c   |  8 +++---
 5 files changed, 60 insertions(+), 53 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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