Skip to content

Commit

Permalink
Suppress unused function warning for UNIVERSAL_PARSER build
Browse files Browse the repository at this point in the history
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)
      | ^~~~~~~~~~~~~~~~~~
```
  • Loading branch information
yui-knk committed Feb 20, 2024
1 parent fba6470 commit 474f418
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parse.y
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 474f418

Please sign in to comment.