diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2019-08-05 14:37:53 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2019-08-05 14:38:59 +0900 |
commit | 58a478bce4a81e619dcef4436f437453d1a3cd89 (patch) | |
tree | 07014ee326085b66dd00c1cfe4ada803c9515531 /ext/psych | |
parent | 2403f9ac3af170ce0107a709a9cb510fe0501648 (diff) | |
download | ruby-58a478bce4a81e619dcef4436f437453d1a3cd89.tar.gz |
ext/psych/yaml/loader.c: Cast the difference of pointers to int
instead of casting a pointer to int.
Follow up of 39622232c7542d062f79277a11f6b8b6b6cfd994.
Diffstat (limited to 'ext/psych')
-rw-r--r-- | ext/psych/yaml/loader.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c index aa75cf57ab..e5d90be9bc 100644 --- a/ext/psych/yaml/loader.c +++ b/ext/psych/yaml/loader.c @@ -300,7 +300,7 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event) if (!PUSH(parser, parser->document->nodes, node)) goto error; - index = (int)parser->document->nodes.top - (int)parser->document->nodes.start; + index = (int)(parser->document->nodes.top - parser->document->nodes.start); if (!yaml_parser_register_anchor(parser, index, first_event->data.scalar.anchor)) return 0; @@ -347,7 +347,7 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event) if (!PUSH(parser, parser->document->nodes, node)) goto error; - index = (int)parser->document->nodes.top - (int)parser->document->nodes.start; + index = (int)(parser->document->nodes.top - parser->document->nodes.start); if (!yaml_parser_register_anchor(parser, index, first_event->data.sequence_start.anchor)) return 0; @@ -410,7 +410,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event) if (!PUSH(parser, parser->document->nodes, node)) goto error; - index = (int)parser->document->nodes.top - (int)parser->document->nodes.start; + index = (int)(parser->document->nodes.top - parser->document->nodes.start); if (!yaml_parser_register_anchor(parser, index, first_event->data.mapping_start.anchor)) return 0; |