Skip to content

Commit 5ae753d

Browse files
committed
Adjusted styles
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent cc02df3 commit 5ae753d

File tree

7 files changed

+63
-42
lines changed

7 files changed

+63
-42
lines changed

array.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ rb_ary_shift_m(int argc, VALUE *argv, VALUE ary)
13261326
MJIT_FUNC_EXPORTED VALUE
13271327
rb_ary_behead(VALUE ary, long n)
13281328
{
1329-
if(n<=0) return ary;
1329+
if (n<=0) return ary;
13301330

13311331
rb_ary_modify_check(ary);
13321332
if (ARY_SHARED_P(ary)) {

gc.c

+54-36
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,8 @@ gc_object_moved_p(rb_objspace_t * objspace, VALUE obj)
11471147
{
11481148
if (RB_SPECIAL_CONST_P(obj)) {
11491149
return FALSE;
1150-
} else {
1150+
}
1151+
else {
11511152
void *poisoned = poisoned_object_p(obj);
11521153
unpoison_object(obj, false);
11531154

@@ -3395,17 +3396,19 @@ rb_obj_id(VALUE obj)
33953396
if (st_lookup(obj_to_id_tbl, (st_data_t)obj, &id)) {
33963397
gc_report(4, &rb_objspace, "Second time object_id was called on this object: %p\n", (void*)obj);
33973398
return id;
3398-
} else {
3399+
}
3400+
else {
33993401
id = nonspecial_obj_id(obj);
34003402

3401-
while(1) {
3403+
while (1) {
34023404
/* id is the object id */
34033405
if (st_lookup(id_to_obj_tbl, (st_data_t)id, 0)) {
34043406
gc_report(4, &rb_objspace, "object_id called on %p, but there was a collision at %d\n", (void*)obj, NUM2INT(id));
34053407
rb_objspace_t *objspace = &rb_objspace;
34063408
objspace->profile.object_id_collisions++;
34073409
id += 40;
3408-
} else {
3410+
}
3411+
else {
34093412
gc_report(4, &rb_objspace, "Initial insert: %p id: %d\n", (void*)obj, NUM2INT(id));
34103413
st_insert(obj_to_id_tbl, (st_data_t)obj, id);
34113414
st_insert(id_to_obj_tbl, (st_data_t)id, obj);
@@ -4422,7 +4425,8 @@ mark_keyvalue(st_data_t key, st_data_t value, st_data_t data)
44224425

44234426
if (SPECIAL_CONST_P((VALUE)key) || BUILTIN_TYPE((VALUE)key) == T_STRING) {
44244427
gc_mark(objspace, (VALUE)key);
4425-
} else {
4428+
}
4429+
else {
44264430
gc_mark_and_pin(objspace, (VALUE)key);
44274431
}
44284432
gc_mark(objspace, (VALUE)value);
@@ -5675,7 +5679,7 @@ gc_verify_heap_pages_(rb_objspace_t *objspace, struct list_head *head)
56755679
list_for_each(head, page, page_node) {
56765680
unpoison_memory_region(&page->freelist, sizeof(RVALUE*), false);
56775681
RVALUE *p = page->freelist;
5678-
while(p) {
5682+
while (p) {
56795683
RVALUE *prev = p;
56805684
unpoison_object((VALUE)p, false);
56815685
if (BUILTIN_TYPE(p) != T_NONE) {
@@ -7218,7 +7222,8 @@ update_id_to_obj(st_data_t *key, st_data_t *value, st_data_t arg, int exists)
72187222
if (exists) {
72197223
*value = arg;
72207224
return ST_CONTINUE;
7221-
} else {
7225+
}
7226+
else {
72227227
return ST_STOP;
72237228
}
72247229
}
@@ -7260,7 +7265,7 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free)
72607265

72617266
/* If the source object's object_id has been seen, we need to update
72627267
* the object to object id mapping. */
7263-
if(st_lookup(obj_to_id_tbl, (VALUE)src, &id)) {
7268+
if (st_lookup(obj_to_id_tbl, (VALUE)src, &id)) {
72647269
gc_report(4, objspace, "Moving object with seen id: %p -> %p\n", (void *)src, (void *)dest);
72657270
st_delete(obj_to_id_tbl, (st_data_t *)&src, 0);
72667271
st_insert(obj_to_id_tbl, (VALUE)dest, id);
@@ -7274,25 +7279,29 @@ gc_move(rb_objspace_t *objspace, VALUE scan, VALUE free)
72747279
/* Set bits for object in new location */
72757280
if (marking) {
72767281
MARK_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
7277-
} else {
7282+
}
7283+
else {
72787284
CLEAR_IN_BITMAP(GET_HEAP_MARKING_BITS((VALUE)dest), (VALUE)dest);
72797285
}
72807286

72817287
if (marked) {
72827288
MARK_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
7283-
} else {
7289+
}
7290+
else {
72847291
CLEAR_IN_BITMAP(GET_HEAP_MARK_BITS((VALUE)dest), (VALUE)dest);
72857292
}
72867293

72877294
if (wb_unprotected) {
72887295
MARK_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
7289-
} else {
7296+
}
7297+
else {
72907298
CLEAR_IN_BITMAP(GET_HEAP_WB_UNPROTECTED_BITS((VALUE)dest), (VALUE)dest);
72917299
}
72927300

72937301
if (uncollectible) {
72947302
MARK_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
7295-
} else {
7303+
}
7304+
else {
72967305
CLEAR_IN_BITMAP(GET_HEAP_UNCOLLECTIBLE_BITS((VALUE)dest), (VALUE)dest);
72977306
}
72987307

@@ -7316,7 +7325,8 @@ advance_cursor(struct heap_cursor *free, struct heap_page **page_list)
73167325
free->index++;
73177326
free->page = page_list[free->index];
73187327
free->slot = free->page->start;
7319-
} else {
7328+
}
7329+
else {
73207330
free->slot++;
73217331
}
73227332
}
@@ -7328,7 +7338,8 @@ retreat_cursor(struct heap_cursor *scan, struct heap_page **page_list)
73287338
scan->index--;
73297339
scan->page = page_list[scan->index];
73307340
scan->slot = scan->page->start + scan->page->total_slots - 1;
7331-
} else {
7341+
}
7342+
else {
73327343
scan->slot--;
73337344
}
73347345
}
@@ -7370,7 +7381,7 @@ int count_pinned(struct heap_page *page)
73707381
int pinned = 0;
73717382

73727383
VALUE v = (VALUE)pstart;
7373-
for(; v != (VALUE)pend; v += sizeof(RVALUE)) {
7384+
for (; v != (VALUE)pend; v += sizeof(RVALUE)) {
73747385
void *poisoned = poisoned_object_p(v);
73757386
unpoison_object(v, false);
73767387

@@ -7418,7 +7429,7 @@ gc_compact_heap(rb_objspace_t *objspace)
74187429
void *free_slot_poison = poisoned_object_p((VALUE)free_cursor.slot);
74197430
unpoison_object((VALUE)free_cursor.slot, false);
74207431

7421-
while(BUILTIN_TYPE(free_cursor.slot) != T_NONE && not_met(&free_cursor, &scan_cursor)) {
7432+
while (BUILTIN_TYPE(free_cursor.slot) != T_NONE && not_met(&free_cursor, &scan_cursor)) {
74227433
/* Re-poison slot if it's not the one we want */
74237434
if (free_slot_poison) {
74247435
GC_ASSERT(BUILTIN_TYPE(free_cursor.slot) == T_NONE);
@@ -7439,7 +7450,7 @@ gc_compact_heap(rb_objspace_t *objspace)
74397450
/* Scan cursor movement */
74407451
objspace->rcompactor.considered_count_table[BUILTIN_TYPE((VALUE)scan_cursor.slot)]++;
74417452

7442-
while(!gc_is_moveable_obj(objspace, (VALUE)scan_cursor.slot) && not_met(&free_cursor, &scan_cursor)) {
7453+
while (!gc_is_moveable_obj(objspace, (VALUE)scan_cursor.slot) && not_met(&free_cursor, &scan_cursor)) {
74437454

74447455
/* Re-poison slot if it's not the one we want */
74457456
if (scan_slot_poison) {
@@ -7487,7 +7498,7 @@ gc_ref_update_array(rb_objspace_t * objspace, VALUE v)
74877498
len = RARRAY_LEN(v);
74887499
if (len > 0) {
74897500
VALUE *ptr = (VALUE *)RARRAY_CONST_PTR_TRANSIENT(v);
7490-
for(i = 0; i < len; i++) {
7501+
for (i = 0; i < len; i++) {
74917502
UPDATE_IF_MOVED(objspace, ptr[i]);
74927503
}
74937504
}
@@ -7511,11 +7522,11 @@ hash_replace_ref(st_data_t *key, st_data_t *value, st_data_t argp, int existing)
75117522
{
75127523
rb_objspace_t *objspace = (rb_objspace_t *)argp;
75137524

7514-
if(gc_object_moved_p(objspace, (VALUE)*key)) {
7525+
if (gc_object_moved_p(objspace, (VALUE)*key)) {
75157526
*key = rb_gc_new_location((VALUE)*key);
75167527
}
75177528

7518-
if(gc_object_moved_p(objspace, (VALUE)*value)) {
7529+
if (gc_object_moved_p(objspace, (VALUE)*value)) {
75197530
*value = rb_gc_new_location((VALUE)*value);
75207531
}
75217532

@@ -7529,11 +7540,11 @@ hash_foreach_replace(st_data_t key, st_data_t value, st_data_t argp, int error)
75297540

75307541
objspace = (rb_objspace_t *)argp;
75317542

7532-
if(gc_object_moved_p(objspace, (VALUE)key)) {
7543+
if (gc_object_moved_p(objspace, (VALUE)key)) {
75337544
return ST_REPLACE;
75347545
}
75357546

7536-
if(gc_object_moved_p(objspace, (VALUE)value)) {
7547+
if (gc_object_moved_p(objspace, (VALUE)value)) {
75377548
return ST_REPLACE;
75387549
}
75397550
return ST_CONTINUE;
@@ -7666,7 +7677,7 @@ check_id_table_move(ID id, VALUE value, void *data)
76667677
{
76677678
rb_objspace_t *objspace = (rb_objspace_t *)data;
76687679

7669-
if(gc_object_moved_p(objspace, (VALUE)value)) {
7680+
if (gc_object_moved_p(objspace, (VALUE)value)) {
76707681
return ID_TABLE_REPLACE;
76717682
}
76727683

@@ -7681,14 +7692,15 @@ rb_gc_new_location(VALUE value)
76817692

76827693
VALUE destination;
76837694

7684-
if(!SPECIAL_CONST_P((void *)value)) {
7695+
if (!SPECIAL_CONST_P((void *)value)) {
76857696
void *poisoned = poisoned_object_p(value);
76867697
unpoison_object(value, false);
76877698

76887699
if (BUILTIN_TYPE(value) == T_MOVED) {
76897700
destination = (VALUE)RMOVED(value)->destination;
76907701
assert(BUILTIN_TYPE(destination) != T_NONE);
7691-
} else {
7702+
}
7703+
else {
76927704
destination = value;
76937705
}
76947706

@@ -7697,7 +7709,8 @@ rb_gc_new_location(VALUE value)
76977709
GC_ASSERT(BUILTIN_TYPE(value) == T_NONE);
76987710
poison_object(value);
76997711
}
7700-
} else {
7712+
}
7713+
else {
77017714
destination = value;
77027715
}
77037716

@@ -7709,7 +7722,7 @@ update_id_table(ID *key, VALUE * value, void *data, int existing)
77097722
{
77107723
rb_objspace_t *objspace = (rb_objspace_t *)data;
77117724

7712-
if(gc_object_moved_p(objspace, (VALUE)*value)) {
7725+
if (gc_object_moved_p(objspace, (VALUE)*value)) {
77137726
*value = rb_gc_new_location((VALUE)*value);
77147727
}
77157728

@@ -7730,11 +7743,11 @@ update_const_table(VALUE value, void *data)
77307743
rb_const_entry_t *ce = (rb_const_entry_t *)value;
77317744
rb_objspace_t * objspace = (rb_objspace_t *)data;
77327745

7733-
if(gc_object_moved_p(objspace, ce->value)) {
7746+
if (gc_object_moved_p(objspace, ce->value)) {
77347747
ce->value = rb_gc_new_location(ce->value);
77357748
}
77367749

7737-
if(gc_object_moved_p(objspace, ce->file)) {
7750+
if (gc_object_moved_p(objspace, ce->file)) {
77387751
ce->file = rb_gc_new_location(ce->file);
77397752
}
77407753

@@ -7813,7 +7826,8 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
78137826
case T_ARRAY:
78147827
if (FL_TEST(obj, ELTS_SHARED)) {
78157828
UPDATE_IF_MOVED(objspace, any->as.array.as.heap.aux.shared);
7816-
} else {
7829+
}
7830+
else {
78177831
gc_ref_update_array(objspace, obj);
78187832
}
78197833
break;
@@ -7894,7 +7908,7 @@ gc_update_object_references(rb_objspace_t *objspace, VALUE obj)
78947908
long i, len = RSTRUCT_LEN(obj);
78957909
VALUE *ptr = (VALUE *)RSTRUCT_CONST_PTR(obj);
78967910

7897-
for(i = 0; i < len; i++) {
7911+
for (i = 0; i < len; i++) {
78987912
UPDATE_IF_MOVED(objspace, ptr[i]);
78997913
}
79007914
}
@@ -7929,14 +7943,15 @@ gc_ref_update(void *vstart, void *vend, size_t stride, void * data)
79297943
page->flags.has_uncollectible_shady_objects = FALSE;
79307944

79317945
/* For each object on the page */
7932-
for(; v != (VALUE)vend; v += stride) {
7946+
for (; v != (VALUE)vend; v += stride) {
79337947
if (!SPECIAL_CONST_P(v)) {
79347948
unpoison_object(v, false);
79357949

79367950
if (BUILTIN_TYPE(v) == T_NONE) {
79377951
heap_page_add_freeobj(objspace, page, v);
79387952
free_slots++;
7939-
} else {
7953+
}
7954+
else {
79407955
if (RVALUE_WB_UNPROTECTED(v)) {
79417956
page->flags.has_uncollectible_shady_objects = TRUE;
79427957
}
@@ -8041,7 +8056,8 @@ heap_check_moved_i(void *vstart, void *vend, size_t stride, void *data)
80418056
for (; v != (VALUE)vend; v += stride) {
80428057
if (gc_object_moved_p(&rb_objspace, v)) {
80438058
/* Moved object still on the heap, something may have a reference. */
8044-
} else {
8059+
}
8060+
else {
80458061
void *poisoned = poisoned_object_p(v);
80468062
unpoison_object(v, false);
80478063

@@ -9774,7 +9790,8 @@ wmap_pin_obj(st_data_t key, st_data_t val, st_data_t arg)
97749790
VALUE obj = (VALUE)val;
97759791
if (obj && is_live_object(objspace, obj)) {
97769792
gc_pin(objspace, obj);
9777-
} else {
9793+
}
9794+
else {
97789795
return ST_DELETE;
97799796
}
97809797
return ST_CONTINUE;
@@ -11101,7 +11118,8 @@ rb_gcdebug_print_obj_condition(VALUE obj)
1110111118

1110211119
if (BUILTIN_TYPE(obj) == T_MOVED) {
1110311120
fprintf(stderr, "moved?: true\n");
11104-
} else {
11121+
}
11122+
else {
1110511123
fprintf(stderr, "moved?: false\n");
1110611124
}
1110711125
if (is_pointer_to_heap(objspace, (void *)obj)) {

id_table.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ rb_id_table_foreach_with_replace(struct rb_id_table *tbl, rb_id_table_foreach_fu
281281
VALUE val = tbl->items[i].val;
282282
ret = (*replace)(Qundef, &val, data, TRUE);
283283
tbl->items[i].val = val;
284-
} else if (ret == ID_TABLE_STOP)
284+
}
285+
else if (ret == ID_TABLE_STOP)
285286
return;
286287
}
287288
}

io.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -10996,7 +10996,8 @@ nogvl_fcopyfile(struct copy_stream_struct *stp)
1099610996
return 1;
1099710997
}
1099810998
}
10999-
} else {
10999+
}
11000+
else {
1100011001
switch (errno) {
1100111002
case ENOTSUP:
1100211003
case EPERM:

iseq.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ rb_iseq_update_references(rb_iseq_t *iseq)
233233
if (body->parent_iseq) {
234234
body->parent_iseq = (struct rb_iseq_struct *)rb_gc_new_location((VALUE)body->parent_iseq);
235235
}
236-
if(FL_TEST(iseq, ISEQ_MARKABLE_ISEQ)) {
236+
if (FL_TEST(iseq, ISEQ_MARKABLE_ISEQ)) {
237237
rb_iseq_each_value(iseq, update_each_insn_value, NULL);
238238
}
239239

mjit_worker.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,8 @@ mjit_copy_cache_from_main_thread(const rb_iseq_t *iseq, struct rb_call_cache *cc
11801180

11811181
if (UNLIKELY(mjit_opts.wait)) {
11821182
mjit_copy_job_handler((void *)job);
1183-
} else if (rb_workqueue_register(0, mjit_copy_job_handler, (void *)job)) {
1183+
}
1184+
else if (rb_workqueue_register(0, mjit_copy_job_handler, (void *)job)) {
11841185
CRITICAL_SECTION_START(3, "in MJIT copy job wait");
11851186
// checking `stop_worker_p` too because `RUBY_VM_CHECK_INTS(ec)` may not
11861187
// lush mjit_copy_job_handler when EC_EXEC_TAG() is not TAG_NONE, and then

vm_args.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ enum arg_setup_type {
3636
static inline void
3737
arg_rest_dup(struct args_info *args)
3838
{
39-
if(!args->rest_dupped) {
39+
if (!args->rest_dupped) {
4040
args->rest = rb_ary_dup(args->rest);
4141
args->rest_dupped = TRUE;
4242
}

0 commit comments

Comments
 (0)