delete unused codes

Suppress compiler warnings.
This commit is contained in:
卜部昌平 2019-11-18 12:00:19 +09:00
parent 57cd4623cf
commit 7a9b2039b7
3 changed files with 1 additions and 8 deletions

View File

@ -2338,7 +2338,6 @@ rb_check_argv(int argc, VALUE *argv)
{
VALUE tmp, prog;
int i;
const char *name = 0;
rb_check_arity(argc, 1, UNLIMITED_ARGUMENTS);
@ -2353,7 +2352,6 @@ rb_check_argv(int argc, VALUE *argv)
SafeStringValue(prog);
StringValueCStr(prog);
prog = rb_str_new_frozen(prog);
name = RSTRING_PTR(prog);
}
for (i = 0; i < argc; i++) {
SafeStringValue(argv[i]);

5
ruby.c
View File

@ -1217,12 +1217,9 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
case 'T':
{
size_t numlen;
int v = 1;
if (*++s) {
v = scan_oct(s, 2, &numlen);
if (numlen == 0)
v = 1;
scan_oct(s, 2, &numlen);
s += numlen;
}
}

View File

@ -4937,10 +4937,8 @@ rb_pat_search(VALUE pat, VALUE str, long pos, int set_backref_str)
pos = rb_strseq_index(str, pat, pos, 1);
if (set_backref_str) {
if (pos >= 0) {
VALUE match;
str = rb_str_new_frozen(str);
rb_backref_set_string(str, pos, RSTRING_LEN(pat));
match = rb_backref_get();
}
else {
rb_backref_set(Qnil);