1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix unused warnings

http://ci.rvm.jp/results/trunk_gcc7@silicon-docker/2539622
```
/tmp/ruby/v2/src/trunk_gcc7/class.c: In function 'rb_scan_args_parse':
/tmp/ruby/v2/src/trunk_gcc7/class.c:1971:12: warning: unused variable 'tmp_buffer' [-Wunused-variable]
     VALUE *tmp_buffer = arg->tmp_buffer;
            ^~~~~~~~~~
```
```
In file included from /tmp/ruby/v2/src/trunk_gcc7/vm_insnhelper.c:1895:0,
                 from /tmp/ruby/v2/src/trunk_gcc7/vm.c:349:
/tmp/ruby/v2/src/trunk_gcc7/vm_args.c:212:1: warning: 'args_stored_kw_argv_to_hash' defined but not used [-Wunused-function]
 args_stored_kw_argv_to_hash(struct args_info *args)
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
```
This commit is contained in:
Kazuhiro NISHIYAMA 2020-01-03 14:53:25 +09:00
parent e014e6bf66
commit 170f4dbb9b
No known key found for this signature in database
GPG key ID: 262ED8DBB4222F7A
2 changed files with 0 additions and 24 deletions

View file

@ -1968,7 +1968,6 @@ static void
rb_scan_args_parse(int kw_flag, int argc, const VALUE *argv, const char *fmt, struct rb_scan_args_t *arg)
{
const char *p = fmt;
VALUE *tmp_buffer = arg->tmp_buffer;
int keyword_given = 0;
int last_hash_keyword = 0;

View file

@ -208,29 +208,6 @@ args_kw_argv_to_hash(struct args_info *args)
return args->argc;
}
static void
args_stored_kw_argv_to_hash(struct args_info *args)
{
int i;
const struct rb_call_info_kw_arg *kw_arg = args->kw_arg;
const VALUE *const passed_keywords = kw_arg->keywords;
const int passed_keyword_len = kw_arg->keyword_len;
VALUE h = rb_hash_new_with_size(passed_keyword_len);
for (i=0; i<passed_keyword_len; i++) {
rb_hash_aset(h, passed_keywords[i], args->kw_argv[i]);
}
args->kw_argv = NULL;
if (args->rest) {
arg_rest_dup(args);
rb_ary_push(args->rest, h);
}
else {
args->argv[args->argc++] = h;
}
}
static inline void
args_setup_lead_parameters(struct args_info *args, int argc, VALUE *locals)
{