* 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
This commit is contained in:
nobu 2015-05-18 09:03:48 +00:00
Родитель c4d216793b
Коммит bd40bd3393
1 изменённых файлов: 31 добавлений и 33 удалений

64
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); snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s @%s:%d", buff, RANY(obj)->file, RANY(obj)->line);
#endif #endif
#ifdef HAVE_VA_ARGS_MACRO
switch (type) { switch (type) {
case T_NODE: case T_NODE:
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (%s)", buff, snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (%s)", buff,
@ -8872,50 +8871,49 @@ obj_info(VALUE obj)
(int)RARRAY_LEN(obj)); (int)RARRAY_LEN(obj));
break; break;
case T_STRING: { case T_STRING: {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(obj)); snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(obj));
break; break;
} }
case T_CLASS: { case T_CLASS: {
VALUE class_path = rb_class_path_cached(obj); VALUE class_path = rb_class_path_cached(obj);
if (!NIL_P(class_path)) { if (!NIL_P(class_path)) {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(class_path)); snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, RSTRING_PTR(class_path));
} }
break; break;
} }
case T_DATA: { case T_DATA: {
const char * const type_name = rb_objspace_data_type_name(obj); const char * const type_name = rb_objspace_data_type_name(obj);
if (type_name && strcmp(type_name, "iseq") == 0) { if (type_name && strcmp(type_name, "iseq") == 0) {
rb_iseq_t *iseq; rb_iseq_t *iseq;
GetISeqPtr(obj, iseq); GetISeqPtr(obj, iseq);
if (iseq->location.label) { if (iseq->location.label) {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s@%s:%d", buff, 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); RSTRING_PTR(iseq->location.label), RSTRING_PTR(iseq->location.path), (int)iseq->location.first_lineno);
} }
} }
else if (type_name) { else if (type_name) {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, type_name); snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s %s", buff, type_name);
} }
break; break;
} }
case T_IMEMO: { case T_IMEMO: {
const char *imemo_name; const char *imemo_name;
switch (imemo_type(obj)) { switch (imemo_type(obj)) {
#define IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break; #define IMEMO_NAME(x) case imemo_##x: imemo_name = #x; break;
IMEMO_NAME(none); IMEMO_NAME(none);
IMEMO_NAME(cref); IMEMO_NAME(cref);
IMEMO_NAME(svar); IMEMO_NAME(svar);
IMEMO_NAME(throw_data); IMEMO_NAME(throw_data);
IMEMO_NAME(ifunc); IMEMO_NAME(ifunc);
IMEMO_NAME(memo); IMEMO_NAME(memo);
default: rb_bug("unknown IMEMO"); default: rb_bug("unknown IMEMO");
#undef IMEMO_NAME #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: default:
break; break;
} }
#endif
#undef TF #undef TF
#undef C #undef C