ruby-changes:59612
From: Kazuhiro <ko1@a...>
Date: Fri, 3 Jan 2020 14:54:30 +0900 (JST)
Subject: [ruby-changes:59612] 170f4dbb9b (master): Fix unused warnings
https://git.ruby-lang.org/ruby.git/commit/?id=170f4dbb9b From 170f4dbb9bf9363c9fd012fc3f4e340ccda43273 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Fri, 3 Jan 2020 14:53:25 +0900 Subject: 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) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` diff --git a/class.c b/class.c index e42ee08..7db54d6 100644 --- a/class.c +++ b/class.c @@ -1968,7 +1968,6 @@ static void https://github.com/ruby/ruby/blob/trunk/class.c#L1968 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 3558d64..5bed971 100644 --- a/vm_args.c +++ b/vm_args.c @@ -208,29 +208,6 @@ args_kw_argv_to_hash(struct args_info *args) https://github.com/ruby/ruby/blob/trunk/vm_args.c#L208 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) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/