diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-04 17:27:08 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-04 17:27:08 +0000 |
commit | 5405eff9017c5827d39e60e84ac5dbe87571efb4 (patch) | |
tree | 654cde0097685b1dfb3cd9638da3d84b41473160 /parse.y | |
parent | 336f65eb57f1723527aab1b8182b03cdfb3946d0 (diff) | |
download | ruby-5405eff9017c5827d39e60e84ac5dbe87571efb4.tar.gz |
parse.y: fix casts
* parse.y (reg_named_capture_assign_gen): remove needless cast.
* parse.y (must_be_dynamic_symbol, intern_cstr_without_pindown):
get rid of type-punning cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -9999,7 +9999,7 @@ reg_named_capture_assign_gen(struct parser_params* parser, VALUE regexp, NODE *m arg.succ_block = 0; arg.fail_block = 0; arg.num = 0; - onig_foreach_name(RREGEXP(regexp)->ptr, reg_named_capture_assign_iter, (void*)&arg); + onig_foreach_name(RREGEXP(regexp)->ptr, reg_named_capture_assign_iter, &arg); if (arg.num == 0) return match; @@ -10419,10 +10419,10 @@ must_be_dynamic_symbol(VALUE x) { if (UNLIKELY(!DYNAMIC_SYM_P(x))) { if (STATIC_SYM_P(x)) { - VALUE str; + st_data_t str; - if (lookup_id_str(RSHIFT((unsigned long)(x),RUBY_SPECIAL_SHIFT), (st_data_t *)&str)) { - rb_bug("wrong argument: %s (inappropriate Symbol)", RSTRING_PTR(str)); + if (lookup_id_str(RSHIFT((unsigned long)(x),RUBY_SPECIAL_SHIFT), &str)) { + rb_bug("wrong argument: %s (inappropriate Symbol)", RSTRING_PTR((VALUE)str)); } else { rb_bug("wrong argument: inappropriate Symbol (%p)", (void *)x); @@ -10475,14 +10475,14 @@ lookup_str_id(st_data_t str, st_data_t *data) static ID intern_cstr_without_pindown(const char *name, long len, rb_encoding *enc) { - ID id; + st_data_t id; struct RString fake_str; VALUE str = setup_fake_str(&fake_str, name, len); rb_enc_associate(str, enc); OBJ_FREEZE(str); - if (st_lookup(global_symbols.str_id, str, (st_data_t *)&id)) { - return id; + if (st_lookup(global_symbols.str_id, str, &id)) { + return (ID)id; } str = rb_enc_str_new(name, len, enc); /* make true string */ |