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/day.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/day.c')
-rw-r--r-- | src/day.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -72,10 +72,11 @@ static int day_cmp_start(struct day_item *a, struct day_item *b) return 0; else return -1; - } else if (b->type <= EVNT) + } else if (b->type <= EVNT) { return 1; - else + } else { return a->start < b->start ? -1 : (a->start == b->start ? 0 : 1); + } } /* Add an item to the current day list. */ @@ -446,9 +447,9 @@ display_item(struct day_item *day, int incolor, int width, int y, int x) ch_note = day_item_get_note(day) ? '>' : ' '; if (incolor == 0) custom_apply_attr(win, ATTR_HIGHEST); - if (utf8_strwidth(mesg) < width) + if (utf8_strwidth(mesg) < width) { mvwprintw(win, y, x, " %c%c%s", ch_recur, ch_note, mesg); - else { + } else { for (i = 0; mesg[i] && width > 0; i++) { if (!UTF8_ISCONT(mesg[i])) width -= utf8_width(&mesg[i]); |