summaryrefslogtreecommitdiff
path: root/cint_array.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2012-11-25 21:54:48 +0200
committerArnold D. Robbins <arnold@skeeve.com>2012-11-25 21:54:48 +0200
commit9a9ff61bbd952c1263b55f82a269da5b09289a6b (patch)
tree4bc31b31d0bec6d27f77e55f1a88f50534fa6ed4 /cint_array.c
parentdbabe5a569ad82a9faeb2f121e387ec6399f9dcb (diff)
parent7af1da783175273a26609911c3a95975ed0f5c13 (diff)
downloadgawk-9a9ff61bbd952c1263b55f82a269da5b09289a6b.tar.gz
Merge branch 'master' into array-iface
Diffstat (limited to 'cint_array.c')
-rw-r--r--cint_array.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/cint_array.c b/cint_array.c
index 9bf4987b..d30f0d01 100644
--- a/cint_array.c
+++ b/cint_array.c
@@ -25,6 +25,8 @@
#include "awk.h"
+#define INT32_BIT 32
+
extern FILE *output_fp;
extern void indent(int indent_level);
extern NODE **is_integer(NODE *symbol, NODE *subs);
@@ -836,14 +838,14 @@ tree_remove(NODE *symbol, NODE *tree, long k)
assert(i >= 0);
tn = tree->nodes[i];
if (tn == NULL)
- return FALSE;
+ return false;
if (tn->type == Node_array_tree
&& ! tree_remove(symbol, tn, k))
- return FALSE;
+ return false;
else if (tn->type == Node_array_leaf
&& ! leaf_remove(symbol, tn, k))
- return FALSE;
+ return false;
if (tn->table_size == 0) {
freenode(tn);
@@ -856,7 +858,7 @@ tree_remove(NODE *symbol, NODE *tree, long k)
memset(tree, '\0', sizeof(NODE));
tree->type = Node_array_tree;
}
- return TRUE;
+ return true;
}
@@ -1007,7 +1009,8 @@ tree_print(NODE *tree, size_t bi, int indent_level)
hsize = tree->array_size;
if ((tree->flags & HALFHAT) != 0)
hsize /= 2;
- fprintf(output_fp, "%4lu:%s[%4lu:%-4lu]\n", bi,
+ fprintf(output_fp, "%4lu:%s[%4lu:%-4lu]\n",
+ (unsigned long) bi,
(tree->flags & HALFHAT) ? "HH" : "H",
(unsigned long) hsize, (unsigned long) tree->table_size);
@@ -1098,7 +1101,7 @@ leaf_remove(NODE *symbol, NODE *array, long k)
lhs = array->nodes + (k - array->array_base);
if (*lhs == NULL)
- return FALSE;
+ return false;
*lhs = NULL;
if (--array->table_size == 0) {
efree(array->nodes);
@@ -1106,7 +1109,7 @@ leaf_remove(NODE *symbol, NODE *array, long k)
symbol->array_capacity -= array->array_size;
array->array_size = 0; /* sanity */
}
- return TRUE;
+ return true;
}
@@ -1222,7 +1225,8 @@ static void
leaf_print(NODE *array, size_t bi, int indent_level)
{
indent(indent_level);
- fprintf(output_fp, "%4lu:L[%4lu:%-4lu]\n", bi,
+ fprintf(output_fp, "%4lu:L[%4lu:%-4lu]\n",
+ (unsigned long) bi,
(unsigned long) array->array_size,
(unsigned long) array->table_size);
}