summaryrefslogtreecommitdiff
path: root/id_table.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 00:26:02 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-26 00:26:02 (GMT)
commit341c84ed229b6d40c43e99cb3a6da4415ac8b9cd (patch)
tree31d7f491615dcbe62943579924611560d349b07e /id_table.c
parent14aed229eaa44f5cef6d692d9dfdf34b2d6511e5 (diff)
id_table.c: fix for C89 compilers
* id_table.c (list_table_extend, hash_table_extend): remove C99 features. [ruby-dev:49239] [Bug #11487] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'id_table.c')
-rw-r--r--id_table.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/id_table.c b/id_table.c
index 6307cc8..08a9451 100644
--- a/id_table.c
+++ b/id_table.c
@@ -450,7 +450,10 @@ list_table_extend(struct list_id_table *tbl)
*/
/* memmove */
- // fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n", old_values, new_values, num, capa);
+ if (0) {
+ fprintf(stderr, "memmove: %p -> %p (%d, capa: %d)\n",
+ old_values, new_values, num, capa);
+ }
assert(num < capa);
assert(num == 0 || old_values < new_values);
@@ -1274,7 +1277,8 @@ hash_table_extend(struct hash_id_table* tbl)
int new_cap = round_capa(tbl->num + (tbl->num >> 1));
int i;
item_t* old;
- struct hash_id_table tmp_tbl = {new_cap, 0, 0};
+ struct hash_id_table tmp_tbl = {0, 0, 0};
+ tmp_tbl.capa = new_cap;
tmp_tbl.items = ZALLOC_N(item_t, new_cap);
for (i = 0; i < tbl->capa; i++) {
id_key_t key = ITEM_GET_KEY(tbl, i);