diff options
author | Reini Urban <rurban@cpanel.net> | 2016-02-27 11:45:51 +0100 |
---|---|---|
committer | Ingy döt Net <ingy@ingy.net> | 2018-01-08 10:44:25 -0800 |
commit | fc2dd942fc61ae135b7e2bfe5c248b1f15b74547 (patch) | |
tree | 73d890dce146a918cb53c768c7c8117066712476 /src/scanner.c | |
parent | 2b8b563222293e2cc410cd7fd9cb31f05622d97e (diff) | |
download | libyaml-git-fc2dd942fc61ae135b7e2bfe5c248b1f15b74547.tar.gz |
Fixed most compiler warnings -Wall -Wextra
repro:
CFLAGS="-Wall -Wextra -Wunused-parameter -Wc++-compat" ./configure && make
which we use for perl, and libyaml is now included in cperl.
Tested with gcc-5 and clang-3.7
There are still a tons of format warnings (%d on 64bit) in
example-deconstructor.c which I skipped.
Diffstat (limited to 'src/scanner.c')
-rw-r--r-- | src/scanner.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/scanner.c b/src/scanner.c index 068dc13..b6f5185 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -1186,11 +1186,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; @@ -2401,7 +2399,7 @@ yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token) { /* Set the handle to '' */ - handle = yaml_malloc(1); + handle = YAML_MALLOC(1); if (!handle) goto error; handle[0] = '\0'; @@ -2453,7 +2451,7 @@ yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token) /* Set the handle to '!'. */ yaml_free(handle); - handle = yaml_malloc(2); + handle = YAML_MALLOC(2); if (!handle) goto error; handle[0] = '!'; handle[1] = '\0'; |