зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
14aed229ea
Коммит
341c84ed22
|
@ -1,3 +1,8 @@
|
|||
Wed Aug 26 09:26:00 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* id_table.c (list_table_extend, hash_table_extend): remove C99
|
||||
features. [ruby-dev:49239] [Bug #11487]
|
||||
|
||||
Tue Aug 25 06:34:43 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (w32_symlink): implement symlink().
|
||||
|
|
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче