aboutsummaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-18 09:03:48 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-18 09:03:48 +0000
commitbd40bd33934cb7ccdc4ee5a3f7a0df0323619370 (patch)
tree886f92788c8a02fbad2bee7237e131af97182082 /gc.c
parentc4d216793b4c74b725c72679149d6db82a2d7597 (diff)
downloadruby-bd40bd33934cb7ccdc4ee5a3f7a0df0323619370.tar.gz
gc.c: remove ifdef
* gc.c (obj_info): remove needless ifdef, and adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/gc.c b/gc.c
index 7f1d77c4df..830d9d8046 100644
--- a/gc.c
+++ b/gc.c
@@ -8859,7 +8859,6 @@ obj_info(VALUE obj)
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s @%s:%d", buff, RANY(obj)->file, RANY(obj)->line);
#endif
-#ifdef HAVE_VA_ARGS_MACRO
switch (type) {
case T_NODE:
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (%s)", buff,
@@ -8872,50 +8871,49 @@ obj_info(VALUE obj)
(int)RARRAY_LEN(obj));
break;
case T_STRING: {
- snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(obj));
- break;
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(obj));
+ break;
}
case T_CLASS: {
- VALUE class_path = rb_class_path_cached(obj);
- if (!NIL_P(class_path)) {
- snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(class_path));
- }
- break;
+ VALUE class_path = rb_class_path_cached(obj);
+ if (!NIL_P(class_path)) {
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(class_path));
+ }
+ break;
}
case T_DATA: {
- const char * const type_name = rb_objspace_data_type_name(obj);
- if (type_name && strcmp(type_name, "iseq") == 0) {
- rb_iseq_t *iseq;
- GetISeqPtr(obj, iseq);
- if (iseq->location.label) {
- snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s@%s:%d", buff,
- RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path), (int)iseq->location.first_lineno);
- }
- }
- else if (type_name) {
- snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, type_name);
- }
- break;
+ const char * const type_name = rb_objspace_data_type_name(obj);
+ if (type_name && strcmp(type_name, "iseq") == 0) {
+ rb_iseq_t *iseq;
+ GetISeqPtr(obj, iseq);
+ if (iseq->location.label) {
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s@%s:%d", buff,
+ RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path), (int)iseq->location.first_lineno);
+ }
+ }
+ else if (type_name) {
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, type_name);
+ }
+ break;
}
case T_IMEMO: {
- const char *imemo_name;
- switch (imemo_type(obj)) {
+ const char *imemo_name;
+ switch (imemo_type(obj)) {
#define IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break;
- IMEMO_NAME(none);
- IMEMO_NAME(cref);
- IMEMO_NAME(svar);
- IMEMO_NAME(throw_data);
- IMEMO_NAME(ifunc);
- IMEMO_NAME(memo);
- default: rb_bug("unknown IMEMO");
+ IMEMO_NAME(none);
+ IMEMO_NAME(cref);
+ IMEMO_NAME(svar);
+ IMEMO_NAME(throw_data);
+ IMEMO_NAME(ifunc);
+ IMEMO_NAME(memo);
+ default: rb_bug("unknown IMEMO");
#undef IMEMO_NAME
- }
- snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, imemo_name);
+ }
+ snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, imemo_name);
}
default:
break;
}
-#endif
#undef TF
#undef C