gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/api-parser, updated. gawk-4.1.0-


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, feature/api-parser, updated. gawk-4.1.0-2444-g54efcb6
Date: Mon, 6 Mar 2017 14:17:27 -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/api-parser has been updated
       via  54efcb6f4ce81ed0ad2f90e27252f1d8532dd0b5 (commit)
      from  d6406b66add5652130385942a7e05ebc9ea799ce (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=54efcb6f4ce81ed0ad2f90e27252f1d8532dd0b5

commit 54efcb6f4ce81ed0ad2f90e27252f1d8532dd0b5
Author: Andrew J. Schorr <address@hidden>
Date:   Mon Mar 6 14:16:51 2017 -0500

    Rename variable in field.c and added a comment for improved clarity.

diff --git a/ChangeLog b/ChangeLog
index 223d6fb..e8bd1f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-03-06         Andrew J. Schorr     <address@hidden>
 
+       * field.c (normal_parse_field): Renamed from save_parse_field to reflect
+       better its purpose. Added a comment to explain more clearly what's
+       going on.
+       (set_record, set_parser): Rename save_parse_field to normal_parse_field.
+
+2017-03-06         Andrew J. Schorr     <address@hidden>
+
        * gawkapi.h (awk_input_buf_t): Remove field_width array and instead
        add it as a 6th argument to the get_record function. This should
        not break existing code, since it's fine to ignore the additional
diff --git a/field.c b/field.c
index 4a5884a..276669f 100644
--- a/field.c
+++ b/field.c
@@ -40,7 +40,12 @@ typedef void (* Setfunc)(long, char *, long, NODE *);
 
 static long (*parse_field)(long, char **, int, NODE *,
                             Regexp *, Setfunc, NODE *, NODE *, bool);
-static long (*save_parse_field)(long, char **, int, NODE *,
+/*
+ * N.B. The normal_parse_field function pointer contains the parse_field value
+ * that should be used except when API field parsing is overriding the default
+ * field parsing mechanism.
+ */
+static long (*normal_parse_field)(long, char **, int, NODE *,
                             Regexp *, Setfunc, NODE *, NODE *, bool);
 static long re_parse_field(long, char **, int, NODE *,
                             Regexp *, Setfunc, NODE *, NODE *, bool);
@@ -319,8 +324,8 @@ set_record(const char *buf, int cnt, const int *fw)
                        }
                }
                else {
-                       if (parse_field != save_parse_field) {
-                               parse_field = save_parse_field;
+                       if (parse_field != normal_parse_field) {
+                               parse_field = normal_parse_field;
                                update_PROCINFO_str("FS", 
current_field_sep_str());
                        }
                }
@@ -1124,7 +1129,7 @@ do_patsplit(int nargs)
 static void
 set_parser(long (*func)(long, char **, int, NODE *, Regexp *, Setfunc, NODE *, 
NODE *, bool))
 {
-       save_parse_field = func;
+       normal_parse_field = func;
        if (parse_field != api_parse_field && parse_field != func) {
                parse_field = func;
                update_PROCINFO_str("FS", current_field_sep_str());

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

Summary of changes:
 ChangeLog |  7 +++++++
 field.c   | 13 +++++++++----
 2 files changed, 16 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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