1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

id_table.c: adjust indent

* id_table.c (list_table_extend, fix_empty): adjust indent.
  (hash_id_table_foreach_values): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-08-26 00:46:58 +00:00
parent f92ed1943c
commit 86fd28d11e

View file

@ -427,15 +427,15 @@ list_table_extend(struct list_id_table *tbl)
} }
if (0) if (0)
for (i=0; i< 2 * num; i++) { for (i=0; i< 2 * num; i++) {
unsigned char *cs = (unsigned char *)&tbl->keys[i]; unsigned char *cs = (unsigned char *)&tbl->keys[i];
size_t j; size_t j;
fprintf(stderr, ">> %3d | %p - ", i, cs); fprintf(stderr, ">> %3d | %p - ", i, cs);
for (j=0; j<sizeof(VALUE); j++) { for (j=0; j<sizeof(VALUE); j++) {
fprintf(stderr, "%x ", cs[j]); fprintf(stderr, "%x ", cs[j]);
}
fprintf(stderr, "\n");
} }
fprintf(stderr, "\n");
}
} }
tbl->keys = (id_key_t *)xrealloc(tbl->keys, size); tbl->keys = (id_key_t *)xrealloc(tbl->keys, size);
@ -812,8 +812,8 @@ calc_pos(register sa_table* table, id_key_t key)
static void static void
fix_empty(register sa_table* table) fix_empty(register sa_table* table)
{ {
while(--table->free_pos && while (--table->free_pos &&
table->entries[table->free_pos-1].next != SA_EMPTY); table->entries[table->free_pos-1].next != SA_EMPTY);
} }
#define FLOOR_TO_4 ((~((sa_index_t)0)) << 2) #define FLOOR_TO_4 ((~((sa_index_t)0)) << 2)
@ -1008,7 +1008,7 @@ hash_id_table_lookup(register sa_table *table, ID id, VALUE *valuep)
if (entry->key == key) goto found; if (entry->key == key) goto found;
} }
return 0; return 0;
found: found:
if (valuep) *valuep = entry->value; if (valuep) *valuep = entry->value;
return 1; return 1;
} }
@ -1058,7 +1058,7 @@ hash_id_table_delete(sa_table *table, ID id)
entry = table->entries + pos; entry = table->entries + pos;
} while(1); } while(1);
not_found: not_found:
return 0; return 0;
} }
@ -1382,7 +1382,7 @@ hash_id_table_foreach_values(struct hash_id_table *tbl, enum rb_id_table_iterato
enum rb_id_table_iterator_result ret = (*func)(tbl->items[i].val, data); enum rb_id_table_iterator_result ret = (*func)(tbl->items[i].val, data);
if (ret == ID_TABLE_DELETE) if (ret == ID_TABLE_DELETE)
hash_delete_index(tbl, i); hash_delete_index(tbl, i);
else if (ret == ID_TABLE_STOP) else if (ret == ID_TABLE_STOP)
return; return;
} }