mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Constify encoding type in universal parser
Fixed warning about discarding modifiers. ``` ../src/ruby_parser.c:677:48: warning: passing 'rb_encoding *' (aka 'const struct OnigEncodingTypeST *') to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 677 | ast = rb_parser_compile(p, gets, ptr, len, enc, input, line); | ^~~ ../src/internal/parse.h:58:128: note: passing argument to parameter 'fname_enc' here 58 | rb_ast_t *rb_parser_compile(rb_parser_t *p, rb_parser_lex_gets_func *gets, const char *fname_ptr, long fname_len, rb_encoding *fname_enc, rb_parser_input_data input, int line); | ^ ```
This commit is contained in:
parent
b911d2222f
commit
3c16d93cd3
4 changed files with 53 additions and 51 deletions
|
@ -59,7 +59,7 @@
|
|||
#undef st_lookup
|
||||
#define st_lookup rb_parser_st_lookup
|
||||
|
||||
#define rb_encoding void
|
||||
#define rb_encoding const void
|
||||
|
||||
#undef xmalloc
|
||||
#define xmalloc p->config->malloc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue