aboutsummaryrefslogtreecommitdiffstats
path: root/awk.h
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2019-01-15 10:51:40 -0500
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2019-01-15 10:51:40 -0500
commit5812db74483bce781281422953d359fde5be6a99 (patch)
treef59305c62b826369d9893165cd64828a7ff1caf9 /awk.h
parent69b4c6e0b70f92e829848e21c4d8983fac904f30 (diff)
downloadegawk-5812db74483bce781281422953d359fde5be6a99.tar.gz
egawk-5812db74483bce781281422953d359fde5be6a99.tar.bz2
egawk-5812db74483bce781281422953d359fde5be6a99.zip
Fix location of assoc_set function in awk.h and start to use it.
Diffstat (limited to 'awk.h')
-rw-r--r--awk.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/awk.h b/awk.h
index 9b5d359c..d14eae20 100644
--- a/awk.h
+++ b/awk.h
@@ -1362,20 +1362,6 @@ extern int fatal_tag_valid;
/* assoc_remove --- remove an index from symbol[] */
#define assoc_remove(a, s) ((a)->aremove(a, s) != NULL)
-/* assoc_set -- set an element in an array */
-
-static inline void
-assoc_set(NODE *array, NODE *sub, NODE *value)
-{
-
- NODE **lhs = assoc_lookup(array, sub);
- unref(*lhs);
- *lhs = value;
- if (array->astore != NULL)
- (*array->astore)(array, sub);
- unref(sub);
-}
-
/* ------------- Function prototypes or defs (as appropriate) ------------- */
/* array.c */
@@ -2038,6 +2024,20 @@ make_number_node(unsigned int flags)
return r;
}
+/* assoc_set -- set an element in an array */
+
+static inline void
+assoc_set(NODE *array, NODE *sub, NODE *value)
+{
+
+ NODE **lhs = assoc_lookup(array, sub);
+ unref(*lhs);
+ *lhs = value;
+ if (array->astore != NULL)
+ (*array->astore)(array, sub);
+ unref(sub);
+}
+
/*
* str_terminate_f, str_terminate, str_restore: function and macros to
* reduce chances of typos when terminating and restoring strings.