mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Suppress unused function warning for UNIVERSAL_PARSER build
Suppress the warning:
```
parse.y:2221:1: warning: unused function 'rb_parser_str_hash' [-Wunused-function]
2221 | rb_parser_str_hash(rb_parser_string_t *str)
| ^~~~~~~~~~~~~~~~~~
```
This commit is contained in:
parent
fba647087b
commit
474f41880f
4
parse.y
4
parse.y
@ -2118,6 +2118,7 @@ get_nd_args(struct parser_params *p, NODE *node)
|
||||
}
|
||||
|
||||
#ifndef RIPPER
|
||||
#ifndef UNIVERSAL_PARSER
|
||||
static st_index_t
|
||||
djb2(const uint8_t *str, size_t len)
|
||||
{
|
||||
@ -2136,6 +2137,7 @@ parser_memhash(const void *ptr, long len)
|
||||
return djb2(ptr, len);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define PARSER_STRING_PTR(str) (str->ptr)
|
||||
#define PARSER_STRING_LEN(str) (str->len)
|
||||
@ -2200,12 +2202,14 @@ rb_parser_string_free(rb_parser_t *p, rb_parser_string_t *str)
|
||||
}
|
||||
|
||||
#ifndef RIPPER
|
||||
#ifndef UNIVERSAL_PARSER
|
||||
static st_index_t
|
||||
rb_parser_str_hash(rb_parser_string_t *str)
|
||||
{
|
||||
return parser_memhash((const void *)PARSER_STRING_PTR(str), PARSER_STRING_LEN(str));
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static size_t
|
||||
rb_parser_str_capacity(rb_parser_string_t *str, const int termlen)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user