mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
constify parser input strings
This commit is contained in:
@@ -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" { */
|
||||
|
||||
+2
-2
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user