summaryrefslogtreecommitdiffstats
path: root/src/lex.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-20 06:02:29 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-20 06:08:07 +0200
commitd9dc87d8409ddf8361b7fcb311ae97088ed1d984 (patch)
treec63be2cf2a7d978dd5b30b3a404d9442acefdff7 /src/lex.c
parent3fd947a2d13a3f110f7c558b1d294dddfd2d25e0 (diff)
downloadfastd-d9dc87d8409ddf8361b7fcb311ae97088ed1d984.tar
fastd-d9dc87d8409ddf8361b7fcb311ae97088ed1d984.zip
Fix lots of -Wextra warnings
Everything clang and GCC warn about, except GCC's missing-field-initializers which are just stupid as they don't allow {} syntax to zero a field.
Diffstat (limited to 'src/lex.c')
-rw-r--r--src/lex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lex.c b/src/lex.c
index 59599ee..9e68bc2 100644
--- a/src/lex.c
+++ b/src/lex.c
@@ -169,7 +169,7 @@ static void consume(fastd_lex_t *lex, bool needspace) {
lex->needspace = needspace;
}
-static int io_error(YYSTYPE *yylval, fastd_lex_t *lex) {
+static int io_error(YYSTYPE *yylval, fastd_lex_t *lex UNUSED) {
yylval->error = "I/O error";
return -1;
}
@@ -354,7 +354,7 @@ static int parse_keyword(YYSTYPE *yylval, YYLTYPE *yylloc, fastd_lex_t *lex) {
}
char *token = get_token(lex);
- const keyword_t key = {token};
+ const keyword_t key = { .keyword = token };
const keyword_t *ret = bsearch(&key, keywords, sizeof(keywords)/sizeof(keyword_t), sizeof(keyword_t), compare_keywords);
free(token);