diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-02 20:23:47 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-06-02 20:23:47 +0000 |
commit | f2980e3e2050f21273bfc8412e83adef5f75b1f0 (patch) | |
tree | 567b8001811a2396a9746d9f2332dbeab08f158d /parse.y | |
parent | b875b4a6d9fd3a025bffc77c5c265e746614ee2d (diff) | |
download | ruby-f2980e3e2050f21273bfc8412e83adef5f75b1f0.tar.gz |
encoding.h: constify rb_encoding
* include/ruby/encoding.h: constify `rb_encoding` itself, not only
arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r-- | parse.y | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -304,7 +304,7 @@ struct parser_params { #ifdef RIPPER #define intern_cstr_without_pindown(n,l,en) rb_intern3(n,l,en) #else -static ID intern_cstr_without_pindown(const char *, long, const rb_encoding *); +static ID intern_cstr_without_pindown(const char *, long, rb_encoding *); #endif #define STR_NEW(p,n) rb_enc_str_new((p),(n),current_enc) @@ -675,7 +675,7 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...); #else # define rb_compile_error rb_compile_error_with_enc # define compile_error parser->nerr++,rb_compile_error_with_enc -# define PARSER_ARG ruby_sourcefile, ruby_sourceline, current_enc, +# define PARSER_ARG ruby_sourcefile, ruby_sourceline, (void *)current_enc, #endif /* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150, @@ -10258,7 +10258,7 @@ id_type(ID id) #ifndef RIPPER static int -is_special_global_name(const char *m, const char *e, const rb_encoding *enc) +is_special_global_name(const char *m, const char *e, rb_encoding *enc) { int mb = 0; @@ -10290,7 +10290,7 @@ rb_symname_p(const char *name) } int -rb_enc_symname_p(const char *name, const rb_encoding *enc) +rb_enc_symname_p(const char *name, rb_encoding *enc) { return rb_enc_symname2_p(name, strlen(name), enc); } @@ -10299,7 +10299,7 @@ rb_enc_symname_p(const char *name, const rb_encoding *enc) #define IDSET_ATTRSET_FOR_INTERN (~(~0U<<(1<<ID_SCOPE_SHIFT)) & ~(1U<<ID_ATTRSET)) static int -rb_enc_symname_type(const char *name, long len, const rb_encoding *enc, unsigned int allowed_attrset) +rb_enc_symname_type(const char *name, long len, rb_encoding *enc, unsigned int allowed_attrset) { const char *m = name; const char *e = m + len; @@ -10397,7 +10397,7 @@ rb_enc_symname_type(const char *name, long len, const rb_encoding *enc, unsigned } int -rb_enc_symname2_p(const char *name, long len, const rb_encoding *enc) +rb_enc_symname2_p(const char *name, long len, rb_encoding *enc) { return rb_enc_symname_type(name, len, enc, IDSET_ATTRSET_FOR_SYNTAX) != -1; } @@ -10507,7 +10507,7 @@ lookup_sym_id(st_data_t str, st_data_t *data) } static ID -intern_cstr_without_pindown(const char *name, long len, const rb_encoding *enc) +intern_cstr_without_pindown(const char *name, long len, rb_encoding *enc) { st_data_t data; struct RString fake_str; @@ -10523,7 +10523,7 @@ intern_cstr_without_pindown(const char *name, long len, const rb_encoding *enc) } ID -rb_intern3(const char *name, long len, const rb_encoding *enc) +rb_intern3(const char *name, long len, rb_encoding *enc) { ID id; @@ -11013,7 +11013,7 @@ rb_check_id(volatile VALUE *namep) } ID -rb_check_id_cstr(const char *ptr, long len, const rb_encoding *enc) +rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc) { ID id; @@ -11080,7 +11080,7 @@ attrsetname_to_attr(VALUE name) } ID -rb_check_id_cstr_without_pindown(const char *ptr, long len, const rb_encoding *enc) +rb_check_id_cstr_without_pindown(const char *ptr, long len, rb_encoding *enc) { st_data_t id; struct RString fake_str; |