gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, feature/readall, updated. gawk-4.1.0-4606-g4d85efd


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/readall, updated. gawk-4.1.0-4606-g4d85efd
Date: Fri, 10 Dec 2021 05:25:08 -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/readall has been updated
       via  4d85efd9d7e125b64df9a1fb3cf8ee695fd42fd3 (commit)
       via  913cb119902f0de1caf93e9c1031255849b48499 (commit)
       via  ff3c50b94116b5a2a819883a4e9e0ba9ef83fdf7 (commit)
       via  6e872ca782a6fa480aedbef8205bba6b7ccaf307 (commit)
       via  c85634612d741e496eea8619bf75d40a68f2a53b (commit)
       via  cfa3ac1c6a0fcbe794df853f25c757e4acd5fcc0 (commit)
      from  ab614c88e23d7df619e53d4b99a5fdea111ccefa (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=4d85efd9d7e125b64df9a1fb3cf8ee695fd42fd3

commit 4d85efd9d7e125b64df9a1fb3cf8ee695fd42fd3
Merge: ab614c8 913cb11
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Fri Dec 10 12:24:59 2021 +0200

    Merge branch 'master' into feature/readall

diff --cc doc/ChangeLog
index 6c5439b,690427c..88cf9f0
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@@ -1,8 -1,7 +1,12 @@@
+ 2021-12-10         Arnold D. Robbins     <arnold@skeeve.com>
+ 
+       * texinfo.tex: Updated from GNULIB.
+ 
 +2021-12-08         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 +
 +      * gawktexi.in: Document new rwarray functions writeall and readall.
 +      * wordlist: Add readall and writeall.
 +
  2021-11-25         Arnold D. Robbins     <arnold@skeeve.com>
  
        * gawktexi.in: Add missing @item for AWKgo. Thanks to Antonio
diff --cc extension/ChangeLog
index a4b2a81,5ce63c6..8872ec7
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@@ -1,74 -1,7 +1,78 @@@
+ 2021-12-10         Arnold D. Robbins     <arnold@skeeve.com>
+ 
+       * rwarray.c (write_number, read_number): Reformat comments a bit.
+ 
 +2021-12-09         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 +
 +      * rwarray.c (write_number, read_number): Use
 +      mpfr_get_default_rounding_mode() instead of arbitrarily choosing
 +      MPFR_RNDN, taking advantage of the fact that core gawk maintains
 +      this using the ROUNDMODE global variable.
 +
 +2021-12-08         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 +
 +      * rwarray.c: Fix valgrind complaints related to creating mpz and mpfr
 +      values on the stack in read_number by passing down storage from
 +      the calling function that loads the data into gawk.
 +      (value_storage): New union type to contain mpz_t or mpfr_t data.
 +      (read_global): Allocate value_storage on the stack and pass a pointer
 +      to read_elem.
 +      (read_array): Ditto.
 +      (read_elem): Receive new arg pointing to value_storage, and pass it
 +      down to read_value.
 +      (read_value): Receive new arg pointing to value_storage, and pass it
 +      down to read_number.
 +      (read_number): Receive new arg pointing to value_storage, and create
 +      mpz and mpfr variables using that storage instead of in the local
 +      scope.
 +
 +2021-12-08         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 +
 +      * rwarray.c: Add new functions writeall and readall to implement
 +      persistent state.
 +      (write_backend): New helper function containing most of the logic
 +      from do_writea. Note that we do not need to check nargs < 2 because
 +      gawk will issue a fatal error if a function is called with fewer
 +      than min_required_args. Clean up some minor issues with error
 +      handling.
 +      (do_writea): Grab the array argument and use write_backend to
 +      do the rest of the work.
 +      (do_writeall): Lookup SYMTAB and invoke write_backend.
 +      (free_value): New function to free memory for data we end up ignoring
 +      because the variables exist already.
 +      (do_poke): Attempt to create variables that don't exist already or
 +      are undefined.
 +      (regular_array_handle): Wrapper around create_array.
 +      (global_array_handle): Call create_array unless the variable exists
 +      already and is an array with zero elements.
 +      (read_global): New function used by readall to load global variables
 +      from a file.
 +      (read_one): New function to read a single array from a file.
 +      (read_backend): New helper function containing most of the logic
 +      from do_reada. Remove the superfluous nargs check. Read the file
 +      prologue and then call read_global or read_one as appropriate to load
 +      the data.
 +      (do_reada): Grab the array argument and call read_backend with
 +      read_one to load the data.
 +      (do_readall): Call read_backend with read_global to load the data.
 +      (read_array): Call read_elem with additional arg regular_array_handle.
 +      (read_elem): Add a function argument controlling array creation to
 +      pass down to read_value.
 +      (read_value): Add a function argument to call for array creation
 +      instead of calling create_array directly, since we may need to use
 +      an existing array when populating global arrays in readall.
 +      (func_table): Add writeall and readall.
 +      * rwarray.3am: Document new functions writeall and readall.
 +
 +2021-12-08         Andrew J. Schorr      <aschorr@telemetry-investments.com>
 +
 +      * testext.c (test_array_create): New function to create an array
 +      by name that enables testing whether an undefined variable can
 +      be converted by the API into an array.
 +      (populate_array): New helper function.
 +      (fill_in_array): Use populate_array to fill in the elements.
 +      (func_table): Add test_array_create.
 +
  2021-12-08         Andrew J. Schorr      <aschorr@telemetry-investments.com>
  
        * rwarray.c (write_number): Since mpfr_fpif_export is experimental
diff --cc extension/rwarray.c
index 3c74e60,532a8da..af6f1cd
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@@ -369,12 -340,14 +371,14 @@@ write_number(FILE *fp, awk_value_t *val
                        if (mpfr_fpif_export(fp, val->num_ptr) != 0)
  #else
  #define MPFR_STR_BASE 62         /* maximize base to minimize string len */
 -#define MPFR_STR_ROUND        MPFR_RNDN
 +#define MPFR_STR_ROUND        mpfr_get_default_rounding_mode()
-                       /* Does the choice of rounding mode matter, given
+                       /*
+                        * XXX does the choice of MPFR_RNDN matter, given
                         * that the precision is 0, so we should be rendering
-                        * in full precision? */
-                       /* We need to write a terminating space, since
-                        * mpfr_inp_str reads until it hits a space or EOF */
+                        * in full precision?
+                        */
+                       // We need to write a terminating space, since
+                       // mpfr_inp_str reads until it hits a space or EOF
                        if ((mpfr_out_str(fp, MPFR_STR_BASE, 0, val->num_ptr, 
MPFR_STR_ROUND) == 0) || (putc(' ', fp) == EOF))
  #endif
                                return awk_false;
@@@ -796,20 -632,24 +800,20 @@@ read_number(FILE *fp, awk_value_t *valu
        } else {
  #ifdef HAVE_MPFR
                if (code == VT_GMP) {
 -                      mpz_t mp_ptr;
 -
 -                      mpz_init(mp_ptr);
 -                      if (mpz_inp_raw(mp_ptr, fp) == 0)
 +                      mpz_init(vs->mpz_val);
 +                      if (mpz_inp_raw(vs->mpz_val, fp) == 0)
                                return awk_false;
  
 -                      value = make_number_mpz(mp_ptr, value);
 +                      value = make_number_mpz(vs->mpz_val, value);
                } else {
 -                      mpfr_t mpfr_val;
 -                      mpfr_init(mpfr_val);
 -
 +                      mpfr_init(vs->mpfr_val);
  #ifdef USE_MPFR_FPIF
                        /* preferable if widely available and stable */
 -                      if (mpfr_fpif_import(mpfr_val, fp) != 0)
 +                      if (mpfr_fpif_import(vs->mpfr_val, fp) != 0)
  #else
-                       /* N.B. need to consume the terminating space we wrote
-                        * after mpfr_out_str */
+                       // N.B. need to consume the terminating space we wrote
+                       // after mpfr_out_str
 -                      if ((mpfr_inp_str(mpfr_val, fp, MPFR_STR_BASE, 
MPFR_STR_ROUND) == 0) || (getc(fp) != ' '))
 +                      if ((mpfr_inp_str(vs->mpfr_val, fp, MPFR_STR_BASE, 
MPFR_STR_ROUND) == 0) || (getc(fp) != ' '))
  #endif
                                return awk_false;
  

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

Summary of changes:
 build-aux/ChangeLog      |   4 +
 build-aux/texinfo.tex    |  14 +-
 doc/ChangeLog            |   4 +
 doc/texinfo.tex          |  14 +-
 extension/ChangeLog      |   4 +
 extension/rwarray.c      |  20 +-
 support/ChangeLog        |   5 +
 support/intprops.h       |  15 +-
 support/regcomp.c        | 813 ++++++++++++++++++++---------------------------
 support/regex_internal.c |  40 ---
 support/regex_internal.h |  49 ++-
 support/regexec.c        |  77 +----
 12 files changed, 425 insertions(+), 634 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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