ruby-changes:56826
From: Nobuyoshi <ko1@a...>
Date: Mon, 5 Aug 2019 23:27:50 +0900 (JST)
Subject: [ruby-changes:56826] Nobuyoshi Nakada: 4c15b241f8 (master): Unused macro argument `varc`
https://git.ruby-lang.org/ruby.git/commit/?id=4c15b241f8 From 4c15b241f8e83696ae104ad141ba990adf833309 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Mon, 5 Aug 2019 13:29:53 +0900 Subject: Unused macro argument `varc` diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 5456dbc..7eb6b30 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2337,45 +2337,45 @@ ERRORFUNC(("variable argument length doesn't match"), int rb_scan_args_length_mi https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2337 #define __has_attribute(x) 0 #endif # if __has_attribute(diagnose_if) -# define rb_scan_args_count_end(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_end(fmt, ofs, vari) \ (fmt[ofs] ? rb_scan_args_bad_format(fmt) : (vari)) # else -# define rb_scan_args_count_end(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_end(fmt, ofs, vari) \ ((vari)/(!fmt[ofs] || rb_scan_args_bad_format(fmt))) # endif -# define rb_scan_args_count_block(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_block(fmt, ofs, vari) \ (fmt[ofs]!='&' ? \ - rb_scan_args_count_end(fmt, ofs, varc, vari) : \ - rb_scan_args_count_end(fmt, ofs+1, varc, vari+1)) + rb_scan_args_count_end(fmt, ofs, vari) : \ + rb_scan_args_count_end(fmt, ofs+1, vari+1)) -# define rb_scan_args_count_hash(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_hash(fmt, ofs, vari) \ (fmt[ofs]!=':' ? \ - rb_scan_args_count_block(fmt, ofs, varc, vari) : \ - rb_scan_args_count_block(fmt, ofs+1, varc, vari+1)) + rb_scan_args_count_block(fmt, ofs, vari) : \ + rb_scan_args_count_block(fmt, ofs+1, vari+1)) -# define rb_scan_args_count_trail(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_trail(fmt, ofs, vari) \ (!rb_scan_args_isdigit(fmt[ofs]) ? \ - rb_scan_args_count_hash(fmt, ofs, varc, vari) : \ - rb_scan_args_count_hash(fmt, ofs+1, varc, vari+(fmt[ofs]-'0'))) + rb_scan_args_count_hash(fmt, ofs, vari) : \ + rb_scan_args_count_hash(fmt, ofs+1, vari+(fmt[ofs]-'0'))) -# define rb_scan_args_count_var(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_var(fmt, ofs, vari) \ (fmt[ofs]!='*' ? \ - rb_scan_args_count_trail(fmt, ofs, varc, vari) : \ - rb_scan_args_count_trail(fmt, ofs+1, varc, vari+1)) + rb_scan_args_count_trail(fmt, ofs, vari) : \ + rb_scan_args_count_trail(fmt, ofs+1, vari+1)) -# define rb_scan_args_count_opt(fmt, ofs, varc, vari) \ +# define rb_scan_args_count_opt(fmt, ofs, vari) \ (!rb_scan_args_isdigit(fmt[1]) ? \ - rb_scan_args_count_var(fmt, ofs, varc, vari) : \ - rb_scan_args_count_var(fmt, ofs+1, varc, vari+fmt[ofs]-'0')) + rb_scan_args_count_var(fmt, ofs, vari) : \ + rb_scan_args_count_var(fmt, ofs+1, vari+fmt[ofs]-'0')) -# define rb_scan_args_count(fmt, varc) \ +# define rb_scan_args_count(fmt) \ (!rb_scan_args_isdigit(fmt[0]) ? \ - rb_scan_args_count_var(fmt, 0, varc, 0) : \ - rb_scan_args_count_opt(fmt, 1, varc, fmt[0]-'0')) + rb_scan_args_count_var(fmt, 0, 0) : \ + rb_scan_args_count_opt(fmt, 1, fmt[0]-'0')) # define rb_scan_args_verify_count(fmt, varc) \ - ((varc)/(rb_scan_args_count(fmt, varc) == (varc) || \ + ((varc)/(rb_scan_args_count(fmt) == (varc) || \ rb_scan_args_length_mismatch(fmt, varc))) # if defined(__has_attribute) && __has_attribute(diagnose_if) @@ -2516,8 +2516,8 @@ rb_scan_args_set(int argc, const VALUE *argv, https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L2516 int f_var, int f_hash, int f_block, VALUE *vars[], RB_UNUSED_VAR(char *fmt), RB_UNUSED_VAR(int varc)) # if defined(__has_attribute) && __has_attribute(diagnose_if) - __attribute__((diagnose_if(rb_scan_args_count(fmt,varc)==0,"bad scan arg format","error"))) - __attribute__((diagnose_if(rb_scan_args_count(fmt,varc)!=varc,"variable argument length doesn't match","error"))) + __attribute__((diagnose_if(rb_scan_args_count(fmt)==0,"bad scan arg format","error"))) + __attribute__((diagnose_if(rb_scan_args_count(fmt)!=varc,"variable argument length doesn't match","error"))) # endif { int i, argi = 0, vari = 0, last_idx = -1; -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/