From 170f4dbb9bf9363c9fd012fc3f4e340ccda43273 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA Date: Fri, 3 Jan 2020 14:53:25 +0900 Subject: [PATCH] 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) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- class.c | 1 - vm_args.c | 23 ----------------------- 2 files changed, 24 deletions(-) diff --git a/class.c b/class.c index e42ee0821c..7db54d6038 100644 --- a/class.c +++ b/class.c @@ -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; diff --git a/vm_args.c b/vm_args.c index 3558d6487f..5bed9711de 100644 --- a/vm_args.c +++ b/vm_args.c @@ -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; ikw_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) {