aboutsummaryrefslogtreecommitdiffstats
path: root/src/notify.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/notify.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/notify.c')
-rw-r--r--src/notify.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/notify.c b/src/notify.c
index cb56e8c..36aad5a 100644
--- a/src/notify.c
+++ b/src/notify.c
@@ -140,9 +140,9 @@ static void extract_aptsfile(void)
char *file;
file = strrchr(path_apts, '/');
- if (!file)
+ if (!file) {
notify.apts_file = path_apts;
- else {
+ } else {
notify.apts_file = file;
notify.apts_file++;
}
@@ -455,8 +455,9 @@ void notify_check_added(char *mesg, long start, char state)
update_notify = 1;
} else if (start < notify_app.time && start >= current_time) {
update_notify = 1;
- } else if (start == notify_app.time && state != notify_app.state)
+ } else if (start == notify_app.time && state != notify_app.state) {
update_notify = 1;
+ }
if (update_notify) {
notify_update_app(start, state, mesg);
@@ -482,8 +483,9 @@ void notify_check_repeated(struct recur_apoint *i)
update_notify = 1;
} else if (real_app_time < notify_app.time && real_app_time >= current_time) {
update_notify = 1;
- } else if (real_app_time == notify_app.time && i->state != notify_app.state)
+ } else if (real_app_time == notify_app.time && i->state != notify_app.state) {
update_notify = 1;
+ }
}
if (update_notify) {
notify_update_app(real_app_time, i->state, i->mesg);
@@ -548,9 +550,9 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name,
maxlen = MAXCOL - x_opt - 2;
custom_apply_attr(win, ATTR_HIGHEST);
- if (len < maxlen)
+ if (len < maxlen) {
mvwaddstr(win, y, x_opt, valstr);
- else {
+ } else {
char buf[BUFSIZ];
strncpy(buf, valstr, maxlen - 1);
@@ -558,8 +560,9 @@ print_option(WINDOW * win, unsigned x, unsigned y, char *name,
mvwprintw(win, y, x_opt, "%s...", buf);
}
custom_remove_attr(win, ATTR_HIGHEST);
- } else
+ } else {
print_bool_option_incolor(win, valbool, y, x_opt);
+ }
mvwaddstr(win, y + 1, x, desc);
}