diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-18 11:24:09 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-05-18 11:24:09 +0900 |
| commit | ac2adf347696c67507b3fef61a8d99852657abda (patch) | |
| tree | d1298dc4bd48014fb4eb077970d6bc518834dd11 /mrbgems/mruby-objectspace | |
| parent | a1c6996fea1a00b7be6cb49443061c96823bba64 (diff) | |
| download | mruby-ac2adf347696c67507b3fef61a8d99852657abda.tar.gz mruby-ac2adf347696c67507b3fef61a8d99852657abda.zip | |
indentation fix
Diffstat (limited to 'mrbgems/mruby-objectspace')
| -rw-r--r-- | mrbgems/mruby-objectspace/src/mruby_objectspace.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/mrbgems/mruby-objectspace/src/mruby_objectspace.c b/mrbgems/mruby-objectspace/src/mruby_objectspace.c index a1e6c2011..ccca6bcbc 100644 --- a/mrbgems/mruby-objectspace/src/mruby_objectspace.c +++ b/mrbgems/mruby-objectspace/src/mruby_objectspace.c @@ -5,7 +5,7 @@ struct os_count_struct { size_t total; - size_t freed; + size_t freed; size_t counts[MRB_TT_MAXDEFINE+1]; }; @@ -16,10 +16,10 @@ os_count_object_type(mrb_state *mrb, struct RBasic* obj, void *data) obj_count = (struct os_count_struct*)(data); if (is_dead(mrb, obj)) { - obj_count->freed++; + obj_count->freed++; } else { - obj_count->counts[obj->tt]++; - obj_count->total++; + obj_count->counts[obj->tt]++; + obj_count->total++; } } @@ -46,32 +46,32 @@ os_count_object_type(mrb_state *mrb, struct RBasic* obj, void *data) mrb_value os_count_objects(mrb_state *mrb, mrb_value self) { - struct os_count_struct obj_count; - size_t i; - mrb_value hash; + struct os_count_struct obj_count; + size_t i; + mrb_value hash; - if (mrb_get_args(mrb, "|H", &hash) == 0) { - hash = mrb_hash_new(mrb); - } + if (mrb_get_args(mrb, "|H", &hash) == 0) { + hash = mrb_hash_new(mrb); + } - if (!mrb_test(mrb_hash_empty_p(mrb, hash))) { - mrb_hash_clear(mrb, hash); - } + if (!mrb_test(mrb_hash_empty_p(mrb, hash))) { + mrb_hash_clear(mrb, hash); + } - for (i = 0; i <= MRB_TT_MAXDEFINE; i++) { - obj_count.counts[i] = 0; - } - obj_count.total = 0; - obj_count.freed = 0; + for (i = 0; i <= MRB_TT_MAXDEFINE; i++) { + obj_count.counts[i] = 0; + } + obj_count.total = 0; + obj_count.freed = 0; - mrb_objspace_each_objects(mrb, os_count_object_type, &obj_count); + mrb_objspace_each_objects(mrb, os_count_object_type, &obj_count); - mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_cstr(mrb, "TOTAL")), mrb_fixnum_value(obj_count.total)); - mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_cstr(mrb, "FREE")), mrb_fixnum_value(obj_count.freed)); + mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_cstr(mrb, "TOTAL")), mrb_fixnum_value(obj_count.total)); + mrb_hash_set(mrb, hash, mrb_symbol_value(mrb_intern_cstr(mrb, "FREE")), mrb_fixnum_value(obj_count.freed)); - for (i = 0; i < MRB_TT_MAXDEFINE; i++) { - mrb_value type; - switch (i) { + for (i = 0; i < MRB_TT_MAXDEFINE; i++) { + mrb_value type; + switch (i) { #define COUNT_TYPE(t) case (t): type = mrb_symbol_value(mrb_intern_cstr(mrb, #t)); break; COUNT_TYPE(MRB_TT_FALSE); COUNT_TYPE(MRB_TT_FREE); @@ -96,13 +96,14 @@ os_count_objects(mrb_state *mrb, mrb_value self) COUNT_TYPE(MRB_TT_ENV); COUNT_TYPE(MRB_TT_DATA); #undef COUNT_TYPE - default: type = mrb_fixnum_value(i); break; - } - if (obj_count.counts[i]) - mrb_hash_set(mrb, hash, type, mrb_fixnum_value(obj_count.counts[i])); + default: + type = mrb_fixnum_value(i); break; } + if (obj_count.counts[i]) + mrb_hash_set(mrb, hash, type, mrb_fixnum_value(obj_count.counts[i])); + } - return hash; + return hash; } void |
