diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-17 09:01:46 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2013-02-17 09:19:04 +0100 |
commit | a363cb9b9111aed22d105adb0e7a8e9caab9bbe3 (patch) | |
tree | b0be8fac73932dcde5b40d6f8cee777f501d869c /src/custom.c | |
parent | 8e16853201f8a608905cacbf1c7e4fb8ac7e568e (diff) | |
download | calcurse-a363cb9b9111aed22d105adb0e7a8e9caab9bbe3.zip |
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 <calcurse@cryptocrack.de>
Diffstat (limited to 'src/custom.c')
-rw-r--r-- | src/custom.c | 17 |
1 files changed, 10 insertions, 7 deletions
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); |