From a363cb9b9111aed22d105adb0e7a8e9caab9bbe3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 17 Feb 2013 09:01:46 +0100 Subject: Fix braces in if-else statements From the Linux kernel coding guidelines: Do not unnecessarily use braces where a single statement will do. [...] This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. Signed-off-by: Lukas Fleischer --- src/custom.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/custom.c') diff --git a/src/custom.c b/src/custom.c index 45cd07a..6f573c5 100644 --- a/src/custom.c +++ b/src/custom.c @@ -455,19 +455,21 @@ display_color_config(struct window *cwin, int *mark_fore, int *mark_back, /* Retrieve the actual color theme. */ pair_content(COLR_CUSTOM, &colr_fore, &colr_back); - if ((colr_fore == DEFAULTCOLOR) || (colr_fore == DEFAULTCOLOR_EXT)) + if ((colr_fore == DEFAULTCOLOR) || (colr_fore == DEFAULTCOLOR_EXT)) { *mark_fore = NBUSERCOLORS; - else + } else { for (i = 0; i < NBUSERCOLORS + 1; i++) if (colr_fore == colr[i]) *mark_fore = i; + } - if ((colr_back == DEFAULTCOLOR) || (colr_back == DEFAULTCOLOR_EXT)) + if ((colr_back == DEFAULTCOLOR) || (colr_back == DEFAULTCOLOR_EXT)) { *mark_back = SIZE - 1; - else + } else { for (i = 0; i < NBUSERCOLORS + 1; i++) if (colr_back == colr[NBUSERCOLORS + 1 + i]) *mark_back = NBUSERCOLORS + 1 + i; + } } } @@ -976,8 +978,9 @@ void custom_keys_config(void) LINESPERKEY); wins_scrollwin_display(&kwin); continue; - } else + } else { not_recognized = 0; + } /* Is the binding used by this action already? If so, just end the reassignment */ if (selrow == keys_get_action(keyval)) { @@ -1041,9 +1044,9 @@ void custom_config_main(void) switch (ch) { case 'C': case 'c': - if (has_colors()) + if (has_colors()) { custom_color_config(); - else { + } else { colorize = 0; wins_erase_status_bar(); mvwaddstr(win[STA].p, 0, 0, no_color_support); -- cgit v1.2.3