aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-10 00:39:26 +0000
commitb83abc52e1d2fb022244b3f6970b9133d8ae57fe (patch)
treefe239dabe2f974c8af113bdcc2ca36ffd93d37f8
parent4fb77a54986c2fa81b7105bc79fe9bf23c9db38a (diff)
downloadruby-b83abc52e1d2fb022244b3f6970b9133d8ae57fe.tar.gz
adjust styles [ci skip]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--id_table.c3
-rw-r--r--io.c4
-rw-r--r--st.c33
-rw-r--r--strftime.c3
-rw-r--r--thread_sync.c13
5 files changed, 35 insertions, 21 deletions
diff --git a/id_table.c b/id_table.c
index 6fe14d75cd..74c9e756a0 100644
--- a/id_table.c
+++ b/id_table.c
@@ -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;
}
}
diff --git a/io.c b/io.c
index c274c9b9fe..19c588497a 100644
--- a/io.c
+++ b/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);
}
diff --git a/st.c b/st.c
index a8c9a44096..c2848b69b6 100644
--- a/st.c
+++ b/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;
diff --git a/strftime.c b/strftime.c
index 025be94afb..ebb587c379 100644
--- a/strftime.c
+++ b/strftime.c
@@ -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) {
diff --git a/thread_sync.c b/thread_sync.c
index bfd625d001..e40e8c2ea8 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -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;
}