diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-03 14:28:19 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-03 14:28:19 +0900 |
| commit | 97b1c57600b243e086114179cd61e3503beaa1e6 (patch) | |
| tree | aed758eb43bdfd9b8a2e873d91a931d052f17824 | |
| parent | 3be4e91376804c1815e38d4a591ab152fba9d3b3 (diff) | |
| download | mruby-97b1c57600b243e086114179cd61e3503beaa1e6.tar.gz mruby-97b1c57600b243e086114179cd61e3503beaa1e6.zip | |
constify parser input strings
| -rw-r--r-- | include/mruby/compile.h | 4 | ||||
| -rw-r--r-- | src/parse.y | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/mruby/compile.h b/include/mruby/compile.h index e549a2f5c..fa21d81a6 100644 --- a/include/mruby/compile.h +++ b/include/mruby/compile.h @@ -95,8 +95,8 @@ struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,int); int mrb_generate_code(mrb_state*, mrb_ast_node*); int mrb_compile_file(mrb_state*,FILE*); -int mrb_compile_string(mrb_state*,char*); -int mrb_compile_nstring(mrb_state*,char*,int); +int mrb_compile_string(mrb_state*,const char*); +int mrb_compile_nstring(mrb_state*,const char*,int); #if defined(__cplusplus) } /* extern "C" { */ diff --git a/src/parse.y b/src/parse.y index 8a85b6fc6..ae53d2cf7 100644 --- a/src/parse.y +++ b/src/parse.y @@ -4812,7 +4812,7 @@ mrb_compile_file(mrb_state * mrb, FILE *f) } int -mrb_compile_nstring(mrb_state *mrb, char *s, int len) +mrb_compile_nstring(mrb_state *mrb, const char *s, int len) { parser_state *p; int n; @@ -4828,7 +4828,7 @@ mrb_compile_nstring(mrb_state *mrb, char *s, int len) } int -mrb_compile_string(mrb_state *mrb, char *s) +mrb_compile_string(mrb_state *mrb, const char *s) { return mrb_compile_nstring(mrb, s, strlen(s)); } |
