diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-21 13:01:51 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-21 13:01:51 +0000 |
commit | 4911d45648d03a519a3c93ca04649705a10fe149 (patch) | |
tree | dac1cd0c1bd9ad89e6e8fde6408df020fddf3c88 /ext | |
parent | c70f12c288cec94d3a7079ee3ffac3ee606d29ff (diff) | |
download | ruby-4911d45648d03a519a3c93ca04649705a10fe149.tar.gz |
kill variable set but not used warning
Currently, dummy_mark variable makes following warnings. Let's fix it.
../../../ext/psych/yaml/parser.c: In function ‘yaml_parser_parse_block_sequence_entry’:
../../../ext/psych/yaml/parser.c:762:21: warning: variable ‘dummy_mark’ set but not used [-Wunused-but-set-variable]
yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
^
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/psych/yaml/parser.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c index dc5430b09f..32671b252c 100644 --- a/ext/psych/yaml/parser.c +++ b/ext/psych/yaml/parser.c @@ -759,9 +759,8 @@ yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser, else if (token->type == YAML_BLOCK_END_TOKEN) { - yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ parser->state = POP(parser, parser->states); - dummy_mark = POP(parser, parser->marks); + (void)POP(parser, parser->marks); SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -869,9 +868,8 @@ yaml_parser_parse_block_mapping_key(yaml_parser_t *parser, else if (token->type == YAML_BLOCK_END_TOKEN) { - yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ parser->state = POP(parser, parser->states); - dummy_mark = POP(parser, parser->marks); + (void)POP(parser, parser->marks); MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -952,7 +950,6 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser, yaml_event_t *event, int first) { yaml_token_t *token; - yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ if (first) { token = PEEK_TOKEN(parser); @@ -997,7 +994,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser, } parser->state = POP(parser, parser->states); - dummy_mark = POP(parser, parser->marks); + (void)POP(parser, parser->marks); SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; @@ -1104,7 +1101,6 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser, yaml_event_t *event, int first) { yaml_token_t *token; - yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */ if (first) { token = PEEK_TOKEN(parser); @@ -1158,7 +1154,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser, } parser->state = POP(parser, parser->states); - dummy_mark = POP(parser, parser->marks); + (void)POP(parser, parser->marks); MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark); SKIP_TOKEN(parser); return 1; |