aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-10-04 12:52:26 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-10-04 12:52:26 +0200
commite7bdf5ebd4162172e79c00196061af625bd729f2 (patch)
tree50f12a230167ee3c730bbf89ba419f2b9afc6a0f
parent82f91536607791340faab394432860f68f0b2787 (diff)
downloadegawk-e7bdf5ebd4162172e79c00196061af625bd729f2.tar.gz
egawk-e7bdf5ebd4162172e79c00196061af625bd729f2.tar.bz2
egawk-e7bdf5ebd4162172e79c00196061af625bd729f2.zip
Clean up make_str_node macro.
-rw-r--r--ChangeLog9
-rw-r--r--TODO.xgawk4
-rw-r--r--awk.h5
-rw-r--r--gawkapi.c4
-rw-r--r--node.c8
5 files changed, 19 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index bee035b4..6dc35701 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-10-04 Arnold D. Robbins <arnold@skeeve.com>
+
+ * TODO.xgawk: Update.
+ * awk.h (make_str_node): Removed macro.
+ (make_string): Modified to call make_str_node.
+ (r_make_str_node): Renamed to make_str_node.
+ * gawkapi.c: Changed r_make_str_node to make_str_node everywhere.
+ * node.c (make_str_node): Renamed from make_str_node.
+
2012-09-23 Arnold D. Robbins <arnold@skeeve.com>
`delete array' and `nextfile' are now in POSIX.
diff --git a/TODO.xgawk b/TODO.xgawk
index 78f26428..250031fe 100644
--- a/TODO.xgawk
+++ b/TODO.xgawk
@@ -4,8 +4,6 @@ To-do list for xgawk enhancements:
- In extensions/configure.ac - add compiler warnings if GCC.
-- Consider adding a way to access gawk special vars read only.
-
Low priority:
- Enhance extension/fork.c waitpid to allow the caller to specify the options.
@@ -146,3 +144,5 @@ Done:
- Attempting to load the same file with -f and -i (or @include) should
be a fatal error.
+
+- Consider adding a way to access gawk special vars read only.
diff --git a/awk.h b/awk.h
index bafb4b98..28ed92ce 100644
--- a/awk.h
+++ b/awk.h
@@ -1288,8 +1288,7 @@ extern STACK_ITEM *stack_top;
#define getbucket(b) getblock(b, BLOCK_BUCKET, BUCKET *)
#define freebucket(b) freeblock(b, BLOCK_BUCKET)
-#define make_string(s, l) r_make_str_node((s), (l), 0)
-#define make_str_node(s, l, f) r_make_str_node((s), (l), (f))
+#define make_string(s, l) make_str_node((s), (l), 0)
#define SCAN 1
#define ALREADY_MALLOCED 2
@@ -1636,7 +1635,7 @@ extern void pp_string_fp(Func_print print_func, FILE *fp, const char *str,
extern NODE *r_force_number(NODE *n);
extern NODE *r_format_val(const char *format, int index, NODE *s);
extern NODE *r_dupnode(NODE *n);
-extern NODE *r_make_str_node(const char *s, size_t len, int flags);
+extern NODE *make_str_node(const char *s, size_t len, int flags);
extern void *more_blocks(int id);
extern void r_unref(NODE *tmp);
extern int parse_escape(const char **string_ptr);
diff --git a/gawkapi.c b/gawkapi.c
index dbb8549b..3473a48c 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -634,7 +634,7 @@ api_sym_update_scalar(awk_ext_id_t id,
* a number, we can avoid calling unref and then making a new node
* by simply installing the new value. First, we follow the same
* recipe used by node.c:r_unref to wipe the current values, and then
- * we copy the logic from r_make_number or r_make_str_node to install
+ * we copy the logic from r_make_number or make_str_node to install
* the new value.
*/
switch (value->val_type) {
@@ -670,7 +670,7 @@ api_sym_update_scalar(awk_ext_id_t id,
#endif
free_wstr(r);
- /* r_make_str_node(ALREADY_MALLOCED): */
+ /* make_str_node(s, l, ALREADY_MALLOCED): */
r->numbr = 0;
r->flags = (MALLOC|STRING|STRCUR);
r->stfmt = -1;
diff --git a/node.c b/node.c
index c7316dcb..f8152bab 100644
--- a/node.c
+++ b/node.c
@@ -371,10 +371,10 @@ cmp_awknums(const NODE *t1, const NODE *t2)
}
-/* r_make_str_node --- make a string node */
+/* make_str_node --- make a string node */
NODE *
-r_make_str_node(const char *s, size_t len, int flags)
+make_str_node(const char *s, size_t len, int flags)
{
NODE *r;
getnode(r);
@@ -392,7 +392,7 @@ r_make_str_node(const char *s, size_t len, int flags)
if (flags & ALREADY_MALLOCED)
r->stptr = (char *) s;
else {
- emalloc(r->stptr, char *, len + 2, "r_make_str_node");
+ emalloc(r->stptr, char *, len + 2, "make_str_node");
memcpy(r->stptr, s, len);
}
r->stptr[len] = '\0';
@@ -441,7 +441,7 @@ r_make_str_node(const char *s, size_t len, int flags)
*ptm++ = c;
}
len = ptm - r->stptr;
- erealloc(r->stptr, char *, len + 1, "r_make_str_node");
+ erealloc(r->stptr, char *, len + 1, "make_str_node");
r->stptr[len] = '\0';
}
r->stlen = len;