aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-calendar.c
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2013-02-17 09:01:46 +0100
committerLukas Fleischer <calcurse@cryptocrack.de>2013-02-17 09:19:04 +0100
commita363cb9b9111aed22d105adb0e7a8e9caab9bbe3 (patch)
treeb0be8fac73932dcde5b40d6f8cee777f501d869c /src/ui-calendar.c
parent8e16853201f8a608905cacbf1c7e4fb8ac7e568e (diff)
downloadcalcurse-a363cb9b9111aed22d105adb0e7a8e9caab9bbe3.tar.gz
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/ui-calendar.c')
-rw-r--r--src/ui-calendar.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ui-calendar.c b/src/ui-calendar.c
index f9749c8..a312a99 100644
--- a/src/ui-calendar.c
+++ b/src/ui-calendar.c
@@ -260,9 +260,9 @@ static int date_change(struct tm *date, int delta_month, int delta_day)
t.tm_mon += delta_month;
t.tm_mday += delta_day;
- if (mktime(&t) == -1)
+ if (mktime(&t) == -1) {
return 1;
- else {
+ } else {
*date = t;
return 0;
}
@@ -338,8 +338,7 @@ draw_monthly_view(struct window *cwin, struct date *current_day,
/* check if the day contains an event or an appointment */
if (monthly_view_cache_valid) {
item_this_day = monthly_view_cache[c_day - 1];
- }
- else {
+ } else {
item_this_day = monthly_view_cache[c_day - 1] =
day_check_if_item(check_day);
}
@@ -625,9 +624,9 @@ void ui_calendar_change_day(int datefmt)
while (wrong_day) {
snprintf(outstr, BUFSIZ, request_date, DATEFMT_DESC(datefmt));
status_mesg(outstr, "");
- if (getstring(win[STA].p, selected_day, LDAY, 0, 1) == GETSTRING_ESC)
+ if (getstring(win[STA].p, selected_day, LDAY, 0, 1) == GETSTRING_ESC) {
return;
- else {
+ } else {
if (strlen(selected_day) == 0) {
wrong_day = 0;
ui_calendar_goto_today();