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/ui-calendar.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/ui-calendar.c') 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(); -- cgit v1.2.3-54-g00ecf