aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui-day.c
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@calcurse.org>2016-10-10 08:56:54 +0200
committerLukas Fleischer <lfleischer@calcurse.org>2016-10-10 09:02:42 +0200
commit007a73f7a20e88b8e4a958ab9b7658bb7b96cd62 (patch)
tree124daaa79b8b071c8cca08a3eb5f9bac0acb3ff3 /src/ui-day.c
parent48bd82a0033c52a6cbf706311df3ba4412771455 (diff)
downloadcalcurse-007a73f7a20e88b8e4a958ab9b7658bb7b96cd62.tar.gz
calcurse-007a73f7a20e88b8e4a958ab9b7658bb7b96cd62.zip
Replace parse_datetime() constants by named flags
Remove the magic constants used in the return value of parse_datetime() and use named flags instead. Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src/ui-day.c')
-rw-r--r--src/ui-day.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui-day.c b/src/ui-day.c
index 2eef149..d7112af 100644
--- a/src/ui-day.c
+++ b/src/ui-day.c
@@ -115,7 +115,7 @@ static int day_edit_duration(int start, int dur, unsigned *new_duration)
* the start time, assume that the time belongs to the
* next day.
*/
- if (ret == 2 && end < start)
+ if (!(ret & PARSE_DATETIME_HAS_DATE) && end < start)
end = date_sec_change(end, 0, 1);
if (ret) {
*new_duration = end - start;
@@ -537,7 +537,7 @@ void ui_day_item_add(void)
break;
}
ret = parse_datetime(item_time, &start);
- if (!(ret & 2))
+ if (!(ret & PARSE_DATETIME_HAS_TIME))
is_appointment = 0;
if (ret)
break;
@@ -574,7 +574,7 @@ void ui_day_item_add(void)
* the start time, assume that the time belongs to the
* next day.
*/
- if (ret == 2 && end < start)
+ if (!(ret & PARSE_DATETIME_HAS_DATE) && end < start)
end = date_sec_change(end, 0, 1);
if (ret) {
dur = end - start;