зеркало из https://github.com/github/ruby.git
adjust styles [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
7573452099
Коммит
6924066a65
|
@ -174,7 +174,8 @@ hash_delete_index(struct rb_id_table *tbl, int ix)
|
|||
ITEM_SET_KEY(tbl, ix, 0);
|
||||
tbl->items[ix].val = 0;
|
||||
return TRUE;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
4
io.c
4
io.c
|
@ -9483,10 +9483,10 @@ do_fcntl(int fd, int cmd, long narg)
|
|||
if (retval != -1) {
|
||||
switch (cmd) {
|
||||
#if defined(F_DUPFD)
|
||||
case F_DUPFD:
|
||||
case F_DUPFD:
|
||||
#endif
|
||||
#if defined(F_DUPFD_CLOEXEC)
|
||||
case F_DUPFD_CLOEXEC:
|
||||
case F_DUPFD_CLOEXEC:
|
||||
#endif
|
||||
rb_update_max_fd(retval);
|
||||
}
|
||||
|
|
33
st.c
33
st.c
|
@ -1005,10 +1005,12 @@ find_table_bin_ptr_and_reserve(st_table *tab, st_hash_t *hash_value,
|
|||
MARK_BIN_EMPTY(tab, ind);
|
||||
}
|
||||
break;
|
||||
} else if (! DELETED_BIN_P(entry_index)) {
|
||||
}
|
||||
else if (! DELETED_BIN_P(entry_index)) {
|
||||
if (PTR_EQUAL(tab, &entries[entry_index - ENTRY_BASE], curr_hash_value, key))
|
||||
break;
|
||||
} else if (first_deleted_bin_ind == UNDEFINED_BIN_IND)
|
||||
}
|
||||
else if (first_deleted_bin_ind == UNDEFINED_BIN_IND)
|
||||
first_deleted_bin_ind = ind;
|
||||
#ifdef QUADRATIC_PROBE
|
||||
ind = hash_bin(ind + d, tab);
|
||||
|
@ -1034,7 +1036,8 @@ st_lookup(st_table *tab, st_data_t key, st_data_t *value)
|
|||
bin = find_entry(tab, hash, key);
|
||||
if (bin == UNDEFINED_ENTRY_IND)
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin = find_table_entry_ind(tab, hash, key);
|
||||
if (bin == UNDEFINED_ENTRY_IND)
|
||||
return 0;
|
||||
|
@ -1057,7 +1060,8 @@ st_get_key(st_table *tab, st_data_t key, st_data_t *result)
|
|||
bin = find_entry(tab, hash, key);
|
||||
if (bin == UNDEFINED_ENTRY_IND)
|
||||
return 0;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin = find_table_entry_ind(tab, hash, key);
|
||||
if (bin == UNDEFINED_ENTRY_IND)
|
||||
return 0;
|
||||
|
@ -1100,7 +1104,8 @@ st_insert(st_table *tab, st_data_t key, st_data_t value)
|
|||
if (new_p)
|
||||
tab->num_entries++;
|
||||
bin_ind = UNDEFINED_BIN_IND;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin = find_table_bin_ptr_and_reserve(tab, &hash_value,
|
||||
key, &bin_ind);
|
||||
new_p = bin == UNDEFINED_ENTRY_IND;
|
||||
|
@ -1183,7 +1188,8 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value,
|
|||
bin = find_entry(tab, hash_value, key);
|
||||
new_p = bin == UNDEFINED_ENTRY_IND;
|
||||
bin_ind = UNDEFINED_BIN_IND;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin = find_table_bin_ptr_and_reserve(tab, &hash_value,
|
||||
key, &bin_ind);
|
||||
new_p = bin == UNDEFINED_ENTRY_IND;
|
||||
|
@ -1269,7 +1275,8 @@ st_general_delete(st_table *tab, st_data_t *key, st_data_t *value)
|
|||
if (value != 0) *value = 0;
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin_ind = find_table_bin_ind(tab, hash, *key);
|
||||
if (bin_ind == UNDEFINED_BIN_IND) {
|
||||
if (value != 0) *value = 0;
|
||||
|
@ -1330,7 +1337,8 @@ st_shift(st_table *tab, st_data_t *key, st_data_t *value)
|
|||
bin = find_entry(tab, curr_entry_ptr->hash, curr_entry_ptr->key);
|
||||
st_assert(bin != UNDEFINED_ENTRY_IND
|
||||
&& &entries[bin] == curr_entry_ptr);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin_ind = find_table_bin_ind(tab, curr_entry_ptr->hash,
|
||||
curr_entry_ptr->key);
|
||||
st_assert(bin_ind != UNDEFINED_BIN_IND
|
||||
|
@ -1385,7 +1393,8 @@ st_update(st_table *tab, st_data_t key,
|
|||
existing = bin != UNDEFINED_ENTRY_IND;
|
||||
entry = &entries[bin];
|
||||
bin_ind = UNDEFINED_BIN_IND;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin_ind = find_table_bin_ind(tab, hash, key);
|
||||
existing = bin_ind != UNDEFINED_BIN_IND;
|
||||
if (existing) {
|
||||
|
@ -1469,7 +1478,8 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg,
|
|||
if (packed_p) {
|
||||
i = find_entry(tab, hash, key);
|
||||
error_p = i == UNDEFINED_ENTRY_IND;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
i = find_table_entry_ind(tab, hash, key);
|
||||
error_p = i == UNDEFINED_ENTRY_IND;
|
||||
i -= ENTRY_BASE;
|
||||
|
@ -1500,7 +1510,8 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg,
|
|||
bin = find_entry(tab, hash, curr_entry_ptr->key);
|
||||
if (bin == UNDEFINED_ENTRY_IND)
|
||||
break;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
bin_ind = find_table_bin_ind(tab, hash, curr_entry_ptr->key);
|
||||
if (bin_ind == UNDEFINED_BIN_IND)
|
||||
break;
|
||||
|
|
|
@ -543,7 +543,8 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
|
|||
if (off < 0) {
|
||||
off = -off;
|
||||
sign = -1;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
sign = +1;
|
||||
}
|
||||
switch (colons) {
|
||||
|
|
|
@ -298,7 +298,8 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th)
|
|||
}
|
||||
else if (mutex->th != th) {
|
||||
err = "Attempt to unlock a mutex which is locked by another thread";
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
struct mutex_waiter *cur = 0, *next = 0;
|
||||
rb_mutex_t *volatile *th_mutex = &th->keeping_mutexes;
|
||||
|
||||
|
@ -306,19 +307,19 @@ rb_mutex_unlock_th(rb_mutex_t *mutex, rb_thread_t volatile *th)
|
|||
list_for_each_safe(&mutex->waitq, cur, next, node) {
|
||||
list_del_init(&cur->node);
|
||||
switch (cur->th->status) {
|
||||
case THREAD_RUNNABLE: /* from someone else calling Thread#run */
|
||||
case THREAD_STOPPED_FOREVER: /* likely (rb_mutex_lock) */
|
||||
case THREAD_RUNNABLE: /* from someone else calling Thread#run */
|
||||
case THREAD_STOPPED_FOREVER: /* likely (rb_mutex_lock) */
|
||||
rb_threadptr_interrupt(cur->th);
|
||||
goto found;
|
||||
case THREAD_STOPPED: /* probably impossible */
|
||||
case THREAD_STOPPED: /* probably impossible */
|
||||
rb_bug("unexpected THREAD_STOPPED");
|
||||
case THREAD_KILLED:
|
||||
case THREAD_KILLED:
|
||||
/* not sure about this, possible in exit GC? */
|
||||
rb_bug("unexpected THREAD_KILLED");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
found:
|
||||
found:
|
||||
while (*th_mutex != mutex) {
|
||||
th_mutex = &(*th_mutex)->next_mutex;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче