1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

ext/psych/yaml: suppress warnings

* ext/psych/yaml/emitter.c (WRITE_BREAK, PUT_BREAK): suppress
  unused-value warnings.

* ext/psych/yaml/parser.c, ext/psych/yaml/scanner.c: suppress
  unused-but-set-variable warnings.

* ext/psych/yaml/yaml_private.h (STACK_EMPTY): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-02-16 07:53:20 +00:00
parent beb2d4c5a5
commit 6ef6dab36d
4 changed files with 8 additions and 13 deletions

View file

@ -53,7 +53,7 @@
#define WRITE_BREAK(emitter,string) \
(FLUSH(emitter) \
&& (CHECK(string,'\n') ? \
(PUT_BREAK(emitter), \
((void)PUT_BREAK(emitter), \
string.pointer ++, \
1) : \
(COPY(emitter->buffer,string), \

View file

@ -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;

View file

@ -1193,11 +1193,9 @@ yaml_parser_increase_flow_level(yaml_parser_t *parser)
static int
yaml_parser_decrease_flow_level(yaml_parser_t *parser)
{
yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
if (parser->flow_level) {
parser->flow_level --;
dummy_key = POP(parser, parser->simple_keys);
(void)POP(parser, parser->simple_keys);
}
return 1;

View file

@ -433,7 +433,8 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(stack).start = (stack).top = (stack).end = 0)
#define STACK_EMPTY(context,stack) \
((stack).start == (stack).top)
((void)(context), \
((stack).start == (stack).top))
#define STACK_LIMIT(context,stack,size) \
((stack).top - (stack).start < (size) ? \