Suppress -Wswitch warnings
This commit is contained in:
parent
3b1029f894
commit
e474c189da
2
class.c
2
class.c
@ -1712,6 +1712,8 @@ singleton_class_of(VALUE obj)
|
|||||||
case T_STRING:
|
case T_STRING:
|
||||||
if (FL_TEST_RAW(obj, RSTRING_FSTR)) goto no_singleton;
|
if (FL_TEST_RAW(obj, RSTRING_FSTR)) goto no_singleton;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8677,6 +8677,8 @@ opobj_inspect(VALUE obj)
|
|||||||
case T_ARRAY:
|
case T_ARRAY:
|
||||||
obj = rb_ary_dup(obj);
|
obj = rb_ary_dup(obj);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rb_inspect(obj);
|
return rb_inspect(obj);
|
||||||
|
2
eval.c
2
eval.c
@ -468,6 +468,8 @@ rb_class_modify_check(VALUE klass)
|
|||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
desc = "Class";
|
desc = "Class";
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@ obj_type(VALUE obj)
|
|||||||
CASE_TYPE(NODE);
|
CASE_TYPE(NODE);
|
||||||
CASE_TYPE(ZOMBIE);
|
CASE_TYPE(ZOMBIE);
|
||||||
#undef CASE_TYPE
|
#undef CASE_TYPE
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
return "UNKNOWN";
|
return "UNKNOWN";
|
||||||
}
|
}
|
||||||
@ -315,6 +316,9 @@ dump_object(VALUE obj, struct dump_config *dc)
|
|||||||
case T_ZOMBIE:
|
case T_ZOMBIE:
|
||||||
dump_append(dc, "}\n");
|
dump_append(dc, "}\n");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
rb_objspace_reachable_objects_from(obj, reachable_object_i, dc);
|
rb_objspace_reachable_objects_from(obj, reachable_object_i, dc);
|
||||||
|
12
gc.c
12
gc.c
@ -2594,6 +2594,8 @@ obj_free(rb_objspace_t *objspace, VALUE obj)
|
|||||||
case T_FALSE:
|
case T_FALSE:
|
||||||
rb_bug("obj_free() called for broken object");
|
rb_bug("obj_free() called for broken object");
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FL_TEST(obj, FL_EXIVAR)) {
|
if (FL_TEST(obj, FL_EXIVAR)) {
|
||||||
@ -3564,6 +3566,8 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
|
|||||||
make_io_zombie(objspace, vp);
|
make_io_zombie(objspace, vp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (poisoned) {
|
if (poisoned) {
|
||||||
GC_ASSERT(BUILTIN_TYPE(vp) == T_NONE);
|
GC_ASSERT(BUILTIN_TYPE(vp) == T_NONE);
|
||||||
@ -3634,6 +3638,8 @@ is_live_object(rb_objspace_t *objspace, VALUE ptr)
|
|||||||
case T_NONE:
|
case T_NONE:
|
||||||
case T_ZOMBIE:
|
case T_ZOMBIE:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_garbage_object(objspace, ptr)) {
|
if (!is_garbage_object(objspace, ptr)) {
|
||||||
@ -4588,6 +4594,9 @@ push_mark_stack(mark_stack_t *stack, VALUE data)
|
|||||||
case T_NODE:
|
case T_NODE:
|
||||||
UNEXPECTED_NODE(push_mark_stack);
|
UNEXPECTED_NODE(push_mark_stack);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack->index == stack->limit) {
|
if (stack->index == stack->limit) {
|
||||||
@ -5397,6 +5406,9 @@ gc_mark_children(rb_objspace_t *objspace, VALUE obj)
|
|||||||
case T_IMEMO:
|
case T_IMEMO:
|
||||||
gc_mark_imemo(objspace, obj);
|
gc_mark_imemo(objspace, obj);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gc_mark(objspace, any->as.basic.klass);
|
gc_mark(objspace, any->as.basic.klass);
|
||||||
|
2
iseq.c
2
iseq.c
@ -68,6 +68,8 @@ obj_resurrect(VALUE obj)
|
|||||||
case T_HASH:
|
case T_HASH:
|
||||||
obj = rb_hash_resurrect(obj);
|
obj = rb_hash_resurrect(obj);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return obj;
|
return obj;
|
||||||
|
@ -4147,6 +4147,8 @@ rb_num_pow(VALUE x, VALUE y)
|
|||||||
return rb_complex_pow(x, y);
|
return rb_complex_pow(x, y);
|
||||||
case T_RATIONAL:
|
case T_RATIONAL:
|
||||||
return rb_rational_pow(x, y);
|
return rb_rational_pow(x, y);
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
6
object.c
6
object.c
@ -3917,6 +3917,8 @@ rb_num_to_dbl(VALUE val)
|
|||||||
if (basic_to_f_p(rb_cRational))
|
if (basic_to_f_p(rb_cRational))
|
||||||
return rat2dbl_without_to_f(val);
|
return rat2dbl_without_to_f(val);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val = numeric_to_float(val);
|
val = numeric_to_float(val);
|
||||||
@ -3954,6 +3956,8 @@ rb_num2dbl(VALUE val)
|
|||||||
return rat2dbl_without_to_f(val);
|
return rat2dbl_without_to_f(val);
|
||||||
case T_STRING:
|
case T_STRING:
|
||||||
rb_raise(rb_eTypeError, "no implicit conversion to float from string");
|
rb_raise(rb_eTypeError, "no implicit conversion to float from string");
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val = rb_convert_type_with_id(val, T_FLOAT, "Float", id_to_f);
|
val = rb_convert_type_with_id(val, T_FLOAT, "Float", id_to_f);
|
||||||
@ -4132,6 +4136,8 @@ rb_obj_dig(int argc, VALUE *argv, VALUE obj, VALUE notfound)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rb_check_funcall_with_hook_kw(obj, id_dig, argc, argv,
|
return rb_check_funcall_with_hook_kw(obj, id_dig, argc, argv,
|
||||||
|
3
proc.c
3
proc.c
@ -1827,6 +1827,9 @@ rb_method_name_error(VALUE klass, VALUE str)
|
|||||||
case T_CLASS:
|
case T_CLASS:
|
||||||
c = obj;
|
c = obj;
|
||||||
s = MSG("");
|
s = MSG("");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
goto normal_class;
|
goto normal_class;
|
||||||
}
|
}
|
||||||
|
@ -2390,6 +2390,8 @@ check_hash(VALUE obj)
|
|||||||
case T_STRING:
|
case T_STRING:
|
||||||
case T_ARRAY:
|
case T_ARRAY:
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return rb_check_hash_type(obj);
|
return rb_check_hash_type(obj);
|
||||||
}
|
}
|
||||||
|
2
range.c
2
range.c
@ -318,6 +318,8 @@ linear_object_p(VALUE obj)
|
|||||||
case T_FLOAT:
|
case T_FLOAT:
|
||||||
case T_BIGNUM:
|
case T_BIGNUM:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (rb_obj_is_kind_of(obj, rb_cNumeric)) return TRUE;
|
if (rb_obj_is_kind_of(obj, rb_cNumeric)) return TRUE;
|
||||||
if (rb_obj_is_kind_of(obj, rb_cTime)) return TRUE;
|
if (rb_obj_is_kind_of(obj, rb_cTime)) return TRUE;
|
||||||
|
@ -72,6 +72,7 @@ rb_namespace_p(VALUE obj)
|
|||||||
if (RB_SPECIAL_CONST_P(obj)) return false;
|
if (RB_SPECIAL_CONST_P(obj)) return false;
|
||||||
switch (RB_BUILTIN_TYPE(obj)) {
|
switch (RB_BUILTIN_TYPE(obj)) {
|
||||||
case T_MODULE: case T_CLASS: return true;
|
case T_MODULE: case T_CLASS: return true;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -524,6 +524,8 @@ filter_defined_class(VALUE klass)
|
|||||||
return 0;
|
return 0;
|
||||||
case T_ICLASS:
|
case T_ICLASS:
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
rb_bug("filter_defined_class: %s", rb_obj_info(klass));
|
rb_bug("filter_defined_class: %s", rb_obj_info(klass));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user