From 4810b37b2976580ae9f1f84d41986531ba2315da Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Fri, 26 Sep 2014 21:10:52 +0200 Subject: -Wpedantic/scan-build stuff --- Makefile | 2 +- ponymap.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index b13d239..7290dd0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ SHELL = /bin/sh CC = clang # -Wunused-function is pretty annoying here, as everything is static -CFLAGS = -std=c99 -Wall -Wextra -Wno-unused-function -ggdb +CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -Wno-unused-function -ggdb # -lpthread is only there for debugging (gdb & errno) # -lrt is only for glibc < 2.17 LDFLAGS = `pkg-config --libs libssl jansson` -lpthread -lrt -ldl -lcurses diff --git a/ponymap.c b/ponymap.c index 6ebf10e..559bfb8 100644 --- a/ponymap.c +++ b/ponymap.c @@ -1245,8 +1245,7 @@ node_print_tree_level (struct node *self, struct node_print_data *data) struct str indent; str_init (&indent); - struct node_print_level *iter = data->head; - for (iter = data->head; iter; iter = iter->next) + for (struct node_print_level *iter = data->head; iter; iter = iter->next) { bool started = iter->started; iter->started = true; @@ -1257,9 +1256,10 @@ node_print_tree_level (struct node *self, struct node_print_data *data) str_free (&indent); char *escaped = node_escape_text (self->text); - self->bold - ? print_bold (stdout, escaped) - : fputs (escaped, stdout); + if (self->bold) + print_bold (stdout, escaped); + else + fputs (escaped, stdout); fputc ('\n', stdout); free (escaped); -- cgit v1.2.3-70-g09d2