зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
c70f12c288
Коммит
4911d45648
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче