gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-184


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1847-gdb16a61
Date: Thu, 16 Jun 2016 19:31:18 +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, feature/fixtype has been updated
       via  db16a6179a87af037966e5192146ba908f4c9ba8 (commit)
       via  b5c92588dc5972fab63ee2b2b8983a74e6fa5872 (commit)
       via  e48a5f8c731e44fa71e8a53d57a4a47c2b8b3dc0 (commit)
      from  f4bbf63a287cd73f4eb989539e4813a428bf05ad (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=db16a6179a87af037966e5192146ba908f4c9ba8

commit db16a6179a87af037966e5192146ba908f4c9ba8
Merge: f4bbf63 b5c9258
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Jun 16 22:31:10 2016 +0300

    Merge branch 'master' into feature/fixtype

diff --cc awk.h
index 0a7059b,bee0e12..8b899b8
--- a/awk.h
+++ b/awk.h
@@@ -1818,44 -1820,8 +1824,47 @@@ force_number(NODE *n
  
  #endif /* GAWKDEBUG */
  
++
 +/*
 + * In certain contexts, the true type of a scalar value matters, and we
 + * must ascertain whether it is a a NUMBER or a STRING. In such situations,
 + * please use this function to resolve the type.
 + *
 + * It is safe to assume that the return value will be the same NODE,
 + * since force_number on a MAYBE_NUM should always returns the same NODE,
 + * and force_string on an INTIND should as well.
 + *
 + * There is no way to handle a Node_typedregex correctly, so we ignore
 + * that case.
 + */
 +static inline NODE *
 +fixtype(NODE *n)
 +{
 +      assert((n->type == Node_val) || (n->type == Node_typedregex));
 +      if (n->type == Node_val) {
 +              if ((n->flags & MAYBE_NUM) != 0)
 +                      return force_number(n);
 +              if ((n->flags & INTIND) != 0)
 +                      return force_string(n);
 +      }
 +      return n;
 +}
 +
 +/*
 + * In `awk', a value is considered to be true if it is nonzero _or_
 + * non-null. Otherwise, the value is false.
 + */
 +static inline int
 +boolval(NODE *t)
 +{
 +      (void) fixtype(t);
 +      if ((t->flags & NUMBER) != 0)
 +              return ! iszero(t);
 +      return (t->stlen > 0);
 +}
 +
+ /* emalloc_real --- malloc with error checking */
+ 
  static inline void *
  emalloc_real(size_t count, const char *where, const char *var, const char 
*file, int line)
  {

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

Summary of changes:
 ChangeLog |    6 ++++++
 awk.h     |   11 +++++++++++
 2 files changed, 17 insertions(+)


hooks/post-receive
-- 
gawk



reply via email to

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