gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, feature/cpp-compile, updated. gawk-4.1.0-4185-g63c979


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/cpp-compile, updated. gawk-4.1.0-4185-g63c9794
Date: Mon, 9 Nov 2020 12:33:33 -0500 (EST)

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, feature/cpp-compile has been updated
       via  63c9794efe84424068b4a701e4b0b9f1d2b5fbcd (commit)
      from  28ae4e2418210522dc0fcde1cc89361c245e0ad7 (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=63c9794efe84424068b4a701e4b0b9f1d2b5fbcd

commit 63c9794efe84424068b4a701e4b0b9f1d2b5fbcd
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Mon Nov 9 19:33:20 2020 +0200

    Get rid of more warnings.

diff --git a/awk.h b/awk.h
index a0e17c6..596f6f2 100644
--- a/awk.h
+++ b/awk.h
@@ -1032,7 +1032,7 @@ typedef struct srcfile {
        char *buf;
        int *line_offset;       /* offset to the beginning of each line */
        int fd;
-       int maxlen;     /* size of the longest line */
+       size_t maxlen;  /* size of the longest line */
 
        void (*fini_func)();    /* dynamic extension of type SRC_EXTLIB */
 
diff --git a/awkgram.y b/awkgram.y
index 09bdbf6..8dc978d 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -3082,7 +3082,7 @@ get_src_buf()
        int n;
        char *scan;
        bool newfile;
-       int savelen;
+       size_t savelen;
        struct stat sbuf;
 
        /*
diff --git a/builtin.c b/builtin.c
index 2a8c19c..cd0d53c 100644
--- a/builtin.c
+++ b/builtin.c
@@ -640,7 +640,7 @@ format_tree(
 /* copy 'l' bytes from 's' to 'obufout' checking for space in the process */
 /* difference of pointers should be of ptrdiff_t type, but let us be kind */
 #define bchunk(s, l) if (l) { \
-       while ((l) > ofre) { \
+       while (((size_t)(l)) > ofre) { \
                size_t olen = obufout - obuf; \
                erealloc(obuf, char *, osiz * 2, "format_tree"); \
                ofre += osiz; \
@@ -666,7 +666,7 @@ format_tree(
 }
 
 /* Is there space for something L big in the buffer? */
-#define chksize(l)  if ((l) >= ofre) { \
+#define chksize(l)  if (((size_t)(l)) >= ofre) { \
        size_t olen = obufout - obuf; \
        size_t delta = osiz+l-ofre; \
        erealloc(obuf, char *, osiz + delta, "format_tree"); \
@@ -785,7 +785,7 @@ format_tree(
                msg(_("fatal: must use `count$' on all formats or none")); \
                arg = 0; /* shutup the compiler */ \
                goto out; \
-       } else if (cur_arg >= num_args) { \
+       } else if (cur_arg >= (size_t) num_args) { \
                arg = 0; /* shutup the compiler */ \
                toofew = true; \
                break; \
diff --git a/cint_array.c b/cint_array.c
index 6946f61..ea5b7e5 100644
--- a/cint_array.c
+++ b/cint_array.c
@@ -37,7 +37,7 @@ extern NODE **is_integer(NODE *symbol, NODE *subs);
  * THRESHOLD    ---  Maximum capacity waste; THRESHOLD >= 2^(NHAT + 1).
  */
 
-static int NHAT = 10;
+static size_t NHAT = 10;
 static long THRESHOLD;
 
 /*
@@ -203,7 +203,8 @@ cint_lookup(NODE *symbol, NODE *subs)
 {
        NODE **lhs;
        long k;
-       int h1 = -1, m, li;
+       int h1 = -1;
+       size_t m, li;
        NODE *tn, *xn;
        long cint_size, capacity;
 
@@ -440,7 +441,8 @@ cint_list(NODE *symbol, NODE *t)
 {
        NODE **list = NULL;
        NODE *tn, *xn;
-       unsigned long k = 0, num_elems, list_size;
+       unsigned long k = 0, list_size;
+       long num_elems;
        size_t j, ja, jd;
        int elem_size = 1;
        int assoc_kind;
@@ -742,8 +744,8 @@ tree_lookup(NODE *symbol, NODE *tree, long k, int m, long 
base)
 {
        NODE **lhs;
        NODE *tn;
-       int i, n;
-       size_t size;
+       int i;
+       size_t size, n;
        long num = k;
 
        /*
@@ -765,7 +767,7 @@ tree_lookup(NODE *symbol, NODE *tree, long k, int m, long 
base)
                tree->array_base = base;
                tree->array_size = size;
                tree->table_size = 0;   /* # of elements in the array */
-               if (n > m/2) {
+               if (n > ((unsigned)m)/2) {
                        /* only first half of the array used */
                        actual_size /= 2;
                        tree->flags |= HALFHAT;
diff --git a/debug.c b/debug.c
index 174d18e..eaa83eb 100644
--- a/debug.c
+++ b/debug.c
@@ -585,7 +585,8 @@ print_lines(char *src, int start_line, int nlines)
        }
 
        for (i = start_line; i < start_line + nlines; i++) {
-               int supposed_len, len;
+               int supposed_len;
+               size_t len;
                char *p;
 
                sprintf(linebuf, "%-8d", i);
@@ -1079,8 +1080,7 @@ print_array(volatile NODE *arr, char *arr_name)
 {
        NODE *subs;
        NODE **list;
-       int i;
-       size_t num_elems = 0;
+       size_t i, num_elems = 0;
        volatile NODE *r;
        volatile int ret = 0;
        volatile jmp_buf pager_quit_tag_stack;
@@ -4340,7 +4340,7 @@ gprintf(FILE *fp, const char *format, ...)
        static size_t buflen = 0;
        static int bl = 0;
        char *p, *q;
-       int nchar;
+       size_t nchar;
 
 #define GPRINTF_BUFSIZ 512
        if (buf == NULL) {
@@ -4372,11 +4372,11 @@ gprintf(FILE *fp, const char *format, ...)
 
        bl = 0;
        for (p = buf; (q = strchr(p, '\n')) != NULL; p = q + 1) {
-               int sz = (int) (q - p);
+               size_t sz = (q - p);
 
                while (sz > 0) {
-                       int cnt;
-                       cnt = sz > screen_width ? screen_width : sz;
+                       size_t cnt;
+                       cnt = sz > ((size_t) screen_width) ? screen_width : sz;
 
                        /* do not print partial line before scrolling */
                        if (cnt < sz && (pager_lines_printed == (screen_height 
- 2)))
diff --git a/eval.c b/eval.c
index 15adb52..51c3ecd 100644
--- a/eval.c
+++ b/eval.c
@@ -824,7 +824,7 @@ set_OFS()
 
        if (OFS == NULL)
                emalloc(OFS, char *, new_ofs_len + 1, "set_OFS");
-       else if (OFSlen < new_ofs_len)
+       else if ((size_t) OFSlen < new_ofs_len)
                erealloc(OFS, char *, new_ofs_len + 1, "set_OFS");
 
        memcpy(OFS, OFS_node->var_value->stptr, OFS_node->var_value->stlen);
diff --git a/field.c b/field.c
index c21046b..8f78a10 100644
--- a/field.c
+++ b/field.c
@@ -281,12 +281,12 @@ set_record(const char *buf, int cnt, const 
awk_fieldwidth_info_t *fw)
         * to place a sentinel at the end, we make sure
         * databuf_size is > cnt after allocation.
         */
-       if (cnt >= databuf_size) {
+       if ((unsigned long) cnt >= databuf_size) {
                do {
                        if (databuf_size > MAX_SIZE/2)
                                fatal(_("input record too large"));
                        databuf_size *= 2;
-               } while (cnt >= databuf_size);
+               } while ((unsigned long) cnt >= databuf_size);
                erealloc(databuf, char *, databuf_size, "set_record");
                memset(databuf, '\0', databuf_size);
        }
@@ -783,7 +783,7 @@ fw_parse_field(long up_to,  /* parse only up to this field 
number */
        bool in_middle ATTRIBUTE_UNUSED)
 {
        char *scan = *buf;
-       long nf = parse_high_water;
+       unsigned long nf = parse_high_water;
        char *end = scan + len;
        const awk_fieldwidth_info_t *fw;
        mbstate_t mbs;
@@ -804,7 +804,7 @@ fw_parse_field(long up_to,  /* parse only up to this field 
number */
                 * in practice.
                 */
                memset(&mbs, 0, sizeof(mbstate_t));
-               while (nf < up_to && scan < end) {
+               while (nf < (unsigned long) up_to && scan < end) {
                        if (nf >= fw->nf) {
                                *buf = end;
                                return nf;
@@ -815,17 +815,17 @@ fw_parse_field(long up_to,        /* parse only up to 
this field number */
                        scan += flen;
                }
        } else {
-               while (nf < up_to && scan < end) {
+               while (nf < (unsigned long) up_to && scan < end) {
                        if (nf >= fw->nf) {
                                *buf = end;
                                return nf;
                        }
                        skiplen = fw->fields[nf].skip;
-                       if (skiplen > end - scan)
+                       if (skiplen > (size_t) (end - scan))
                                skiplen = end - scan;
                        scan += skiplen;
                        flen = fw->fields[nf].len;
-                       if (flen > end - scan)
+                       if (flen > (size_t) (end - scan))
                                flen = end - scan;
                        (*set)(++nf, scan, (long) flen, n);
                        scan += flen;
diff --git a/gawkapi.c b/gawkapi.c
index 9463ff8..44f64be 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -1175,7 +1175,7 @@ api_flatten_array_typed(awk_ext_id_t id,
                awk_valtype_t index_type, awk_valtype_t value_type)
 {
        NODE **list;
-       size_t i, j;
+       int i, j;
        NODE *array = (NODE *) a_cookie;
        size_t alloc_size;
 
@@ -1237,7 +1237,7 @@ api_release_flattened_array(awk_ext_id_t id,
            || array->type != Node_var_array
            || data == NULL
            || array != (NODE *) data->opaque1
-           || data->count != array->table_size
+           || (int)data->count != array->table_size
            || data->opaque2 == NULL)
                return awk_false;
 
diff --git a/int_array.c b/int_array.c
index 26d63bf..6baf224 100644
--- a/int_array.c
+++ b/int_array.c
@@ -312,7 +312,7 @@ static NODE **
 int_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
 {
        unsigned long i;
-       int j;
+       size_t j;
        BUCKET *b, *next;
        NODE *r;
 
@@ -354,7 +354,7 @@ int_remove(NODE *symbol, NODE *subs)
        uint32_t hash1;
        BUCKET *b, *prev = NULL;
        long k;
-       int i;
+       size_t i;
        NODE *xn = symbol->xarray;
 
        if (symbol->table_size == 0 || symbol->buckets == NULL)
@@ -449,7 +449,7 @@ int_copy(NODE *symbol, NODE *newsymb)
 {
        BUCKET **old, **newtab, **pnew;
        BUCKET *chain, *newchain;
-       int j;
+       size_t j;
        unsigned long i, cursize;
 
        assert(symbol->buckets != NULL);
@@ -521,10 +521,12 @@ static NODE**
 int_list(NODE *symbol, NODE *t)
 {
        NODE **list = NULL;
-       unsigned long num_elems, list_size, i, k = 0;
+       unsigned long list_size, i, k = 0;
+       long num_elems;
        BUCKET *b;
        NODE *r, *subs, *xn;
-       int j, elem_size = 1;
+       int elem_size = 1;
+       size_t j;
        long num;
        static char buf[100];
        assoc_kind_t assoc_kind;
@@ -758,7 +760,7 @@ static inline NODE **
 int_find(NODE *symbol, long k, uint32_t hash1)
 {
        BUCKET *b;
-       int i;
+       size_t i;
 
        assert(symbol->buckets != NULL);
        for (b = symbol->buckets[hash1]; b != NULL; b = b->ainext) {
@@ -805,7 +807,7 @@ grow_int_table(NODE *symbol)
 {
        BUCKET **old, **newtab;
        BUCKET *chain, *next;
-       int i, j;
+       size_t i, j;
        unsigned long oldsize, newsize, k;
 
        /*

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

Summary of changes:
 awk.h        |  2 +-
 awkgram.y    |  2 +-
 builtin.c    |  6 +++---
 cint_array.c | 14 ++++++++------
 debug.c      | 14 +++++++-------
 eval.c       |  2 +-
 field.c      | 14 +++++++-------
 gawkapi.c    |  4 ++--
 int_array.c  | 16 +++++++++-------
 9 files changed, 39 insertions(+), 35 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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