diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-03 14:19:02 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2020-02-03 14:19:02 +0900 |
commit | db69c5098781087c954e5fc0aaf3079a66f6d6d5 (patch) | |
tree | ffb9b027c48d8942d3627176d4777275bff43f4e | |
parent | 0ab7f2f2220cb40aa4c25f858b60eb9b4e9cb477 (diff) | |
download | ruby-db69c5098781087c954e5fc0aaf3079a66f6d6d5.tar.gz |
Parenthesized macro arguments
-rw-r--r-- | include/ruby/ruby.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 79ba9006df..db2124f019 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2331,37 +2331,37 @@ ERRORFUNC(("variable argument length doesn't match"), void rb_scan_args_length_m # define rb_scan_args_isdigit(c) ((unsigned char)((c)-'0')<10) # define rb_scan_args_count_end(fmt, ofs, vari) \ - (fmt[ofs] ? -1 : (vari)) + ((fmt)[ofs] ? -1 : (vari)) # define rb_scan_args_count_block(fmt, ofs, vari) \ - (fmt[ofs]!='&' ? \ + ((fmt)[ofs]!='&' ? \ rb_scan_args_count_end(fmt, ofs, vari) : \ - rb_scan_args_count_end(fmt, ofs+1, vari+1)) + rb_scan_args_count_end(fmt, (ofs)+1, (vari)+1)) # define rb_scan_args_count_hash(fmt, ofs, vari) \ - (fmt[ofs]!=':' ? \ + ((fmt)[ofs]!=':' ? \ rb_scan_args_count_block(fmt, ofs, vari) : \ - rb_scan_args_count_block(fmt, ofs+1, vari+1)) + rb_scan_args_count_block(fmt, (ofs)+1, (vari)+1)) # define rb_scan_args_count_trail(fmt, ofs, vari) \ - (!rb_scan_args_isdigit(fmt[ofs]) ? \ + (!rb_scan_args_isdigit((fmt)[ofs]) ? \ rb_scan_args_count_hash(fmt, ofs, vari) : \ - rb_scan_args_count_hash(fmt, ofs+1, vari+(fmt[ofs]-'0'))) + rb_scan_args_count_hash(fmt, (ofs)+1, (vari)+((fmt)[ofs]-'0'))) # define rb_scan_args_count_var(fmt, ofs, vari) \ - (fmt[ofs]!='*' ? \ + ((fmt)[ofs]!='*' ? \ rb_scan_args_count_trail(fmt, ofs, vari) : \ - rb_scan_args_count_trail(fmt, ofs+1, vari+1)) + rb_scan_args_count_trail(fmt, (ofs)+1, (vari)+1)) # define rb_scan_args_count_opt(fmt, ofs, vari) \ - (!rb_scan_args_isdigit(fmt[ofs]) ? \ + (!rb_scan_args_isdigit((fmt)[ofs]) ? \ rb_scan_args_count_var(fmt, ofs, vari) : \ - rb_scan_args_count_var(fmt, ofs+1, vari+fmt[ofs]-'0')) + rb_scan_args_count_var(fmt, (ofs)+1, (vari)+(fmt)[ofs]-'0')) # define rb_scan_args_count_lead(fmt, ofs, vari) \ - (!rb_scan_args_isdigit(fmt[ofs]) ? \ - rb_scan_args_count_var(fmt, ofs, vari) : \ - rb_scan_args_count_opt(fmt, ofs+1, vari+fmt[ofs]-'0')) + (!rb_scan_args_isdigit((fmt)[ofs]) ? \ + rb_scan_args_count_var(fmt, ofs, vari) : \ + rb_scan_args_count_opt(fmt, (ofs)+1, (vari)+(fmt)[ofs]-'0')) # define rb_scan_args_count(fmt) rb_scan_args_count_lead(fmt, 0, 0) |