diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-26 01:30:31 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-05-26 01:30:31 +0000 |
commit | 43079283a882258b11cc807b1264a084ff23d462 (patch) | |
tree | 17382e74195de11d1dbd161755bb93edbc2c60b9 /include/ruby | |
parent | 37cea8142b1282f1b516641e165ec8cfafe67741 (diff) | |
download | ruby-43079283a882258b11cc807b1264a084ff23d462.tar.gz |
ruby.h: fix clang warnings
* include/ruby/ruby.h (rb_scan_args0): use pointer dereference
forms instead of array forms, to get rid of warnings by clang.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/ruby.h | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 234ccd9fbc..669bc605cc 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -2166,64 +2166,64 @@ ERRORFUNC(("variable argument length doesn't match"), int rb_scan_args_length_mi # define rb_scan_args_isdigit(c) ((unsigned char)((c)-'0')<10) # define rb_scan_args_count_block(fmt, ofs) \ - ((fmt)[ofs]=='&') + (*(""fmt+ofs)=='&') # define rb_scan_args_count_hash(fmt, ofs) \ - ((fmt)[ofs]!=':' ? \ + (*(""fmt+ofs)!=':' ? \ rb_scan_args_count_block(fmt, ofs) : \ - rb_scan_args_count_block(fmt, (ofs)+1)+1) + rb_scan_args_count_block(fmt, ofs+1)+1) # define rb_scan_args_count_trail(fmt, ofs) \ - (!rb_scan_args_isdigit((fmt)[ofs]) ? \ + (!rb_scan_args_isdigit(*(""fmt+ofs)) ? \ rb_scan_args_count_hash(fmt, ofs) : \ - ((fmt)[ofs]-'0') + rb_scan_args_count_hash(fmt, (ofs)+1)) + (*(""fmt+ofs)-'0') + rb_scan_args_count_hash(fmt, ofs+1)) # define rb_scan_args_count_var(fmt, ofs) \ - ((fmt)[ofs]!='*' ? \ + (*(""fmt+ofs)!='*' ? \ rb_scan_args_count_trail(fmt, ofs) : \ - rb_scan_args_count_trail(fmt, (ofs)+1)+1) + rb_scan_args_count_trail(fmt, ofs+1)+1) # define rb_scan_args_count(fmt) \ - (!rb_scan_args_isdigit((fmt)[0]) ? rb_scan_args_count_var(fmt, 0) : \ - !rb_scan_args_isdigit((fmt)[1]) ? rb_scan_args_count_var(fmt, 1)+(fmt)[0]-'0' : \ - rb_scan_args_count_var(fmt, 2)+(fmt)[0]-'0'+(fmt)[1]-'0') - -# define rb_scan_args_lead_p(fmt) rb_scan_args_isdigit((fmt)[0]) -# define rb_scan_args_n_lead(fmt) (rb_scan_args_lead_p(fmt) ? (fmt)[0]-'0' : 0) -# define rb_scan_args_opt_p(fmt) (rb_scan_args_lead_p(fmt) && rb_scan_args_isdigit((fmt)[1])) -# define rb_scan_args_n_opt(fmt) (rb_scan_args_opt_p(fmt) ? (fmt)[1]-'0' : 0) + (!rb_scan_args_isdigit(*(""fmt+0)) ? rb_scan_args_count_var(fmt, 0) : \ + !rb_scan_args_isdigit(*(""fmt+1)) ? rb_scan_args_count_var(fmt, 1)+*(""fmt+0)-'0' : \ + rb_scan_args_count_var(fmt, 2)+*(""fmt+0)-'0'+*(""fmt+1)-'0') + +# define rb_scan_args_lead_p(fmt) rb_scan_args_isdigit(*(""fmt+0)) +# define rb_scan_args_n_lead(fmt) (rb_scan_args_lead_p(fmt) ? *(""fmt+0)-'0' : 0) +# define rb_scan_args_opt_p(fmt) (rb_scan_args_lead_p(fmt) && rb_scan_args_isdigit(*(""fmt+1))) +# define rb_scan_args_n_opt(fmt) (rb_scan_args_opt_p(fmt) ? *(""fmt+1)-'0' : 0) # define rb_scan_args_var_idx(fmt) \ - (!rb_scan_args_lead_p(fmt) ? 0 : !rb_scan_args_isdigit((fmt)[1]) ? 1 : 2) -# define rb_scan_args_f_var(fmt) ((fmt)[rb_scan_args_var_idx(fmt)]=='*') + (!rb_scan_args_lead_p(fmt) ? 0 : !rb_scan_args_isdigit(*(""fmt+1)) ? 1 : 2) +# define rb_scan_args_f_var(fmt) (*(""fmt+rb_scan_args_var_idx(fmt))=='*') # define rb_scan_args_trail_idx(fmt) \ (rb_scan_args_lead_p(fmt) ? \ - (rb_scan_args_isdigit((fmt)[1]) || (fmt)[1]=='*')+1 : \ - ((fmt)[0]=='*')) + (rb_scan_args_isdigit(*(""fmt+1)) || *(""fmt+1)=='*')+1 : \ + (*(""fmt+0)=='*')) # define rb_scan_args_trail_p(fmt) \ (rb_scan_args_lead_p(fmt) ? \ - (rb_scan_args_isdigit((fmt)[1]) || (fmt)[1]=='*') && \ - rb_scan_args_isdigit((fmt)[2]) : \ - (fmt)[0]=='*' && rb_scan_args_isdigit((fmt)[1])) + (rb_scan_args_isdigit(*(""fmt+1)) || *(""fmt+1)=='*') && \ + rb_scan_args_isdigit(*(""fmt+2)) : \ + *(""fmt+0)=='*' && rb_scan_args_isdigit(*(""fmt+1))) # define rb_scan_args_n_trail(fmt) \ (rb_scan_args_lead_p(fmt) ? \ - ((rb_scan_args_isdigit((fmt)[1]) || (fmt)[1]=='*') && \ - rb_scan_args_isdigit((fmt)[2]) ? (fmt)[2]-'0' : 0) : \ - ((fmt)[0]=='*' && rb_scan_args_isdigit((fmt)[1]) ? (fmt)[1]-'0' : 0)) + ((rb_scan_args_isdigit(*(""fmt+1)) || *(""fmt+1)=='*') && \ + rb_scan_args_isdigit(*(""fmt+2)) ? *(""fmt+2)-'0' : 0) : \ + (*(""fmt+0)=='*' && rb_scan_args_isdigit(*(""fmt+1)) ? *(""fmt+1)-'0' : 0)) # define rb_scan_args_hash_idx(fmt) \ (rb_scan_args_trail_idx(fmt)+rb_scan_args_trail_p(fmt)) -# define rb_scan_args_f_hash(fmt) ((fmt)[rb_scan_args_hash_idx(fmt)]==':') +# define rb_scan_args_f_hash(fmt) (*(""fmt+rb_scan_args_hash_idx(fmt))==':') # define rb_scan_args_block_idx(fmt) \ (rb_scan_args_hash_idx(fmt)+rb_scan_args_f_hash(fmt)) -# define rb_scan_args_f_block(fmt) ((fmt)[rb_scan_args_block_idx(fmt)]=='&') +# define rb_scan_args_f_block(fmt) (*(""fmt+rb_scan_args_block_idx(fmt))=='&') # define rb_scan_args_end_idx(fmt) \ (rb_scan_args_block_idx(fmt)+rb_scan_args_f_block(fmt)) # define rb_scan_args_validate(fmt, varc) \ - (!rb_scan_args_isdigit((fmt)[0]) ? \ + (!rb_scan_args_isdigit(*(""fmt+0)) ? \ rb_scan_args_validate_var(fmt, 0, varc) : \ - !rb_scan_args_isdigit((fmt)[1]) ? \ - rb_scan_args_validate_var(fmt, 1, (varc-(fmt)[0]+'0')) : \ - rb_scan_args_validate_var(fmt, 2, (varc-(fmt)[0]+'0'-(fmt)[1]+'0'))) + !rb_scan_args_isdigit(*(""fmt+1)) ? \ + rb_scan_args_validate_var(fmt, 1, (varc-*(""fmt+0)+'0')) : \ + rb_scan_args_validate_var(fmt, 2, (varc-*(""fmt+0)+'0'-*(""fmt+1)+'0'))) # define rb_scan_args_validate_var(fmt, ofs, varc) \ ((fmt)[ofs]=='*' ? \ rb_scan_args_validate_trail(fmt, ofs+1, (varc-1)) : \ |