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>
This commit is contained in:
Lukas Fleischer
2016-10-10 08:56:54 +02:00
parent 48bd82a003
commit 007a73f7a2
3 changed files with 9 additions and 5 deletions

View File

@@ -1132,10 +1132,10 @@ int parse_datetime(const char *string, long *ts)
new_date.mm = month;
new_date.yyyy = year;
*ts = date2sec(new_date, 0, 0) + get_item_time(*ts);
ret |= 1;
ret |= PARSE_DATETIME_HAS_DATE;
} else if (parse_time(p, &hour, &minute) == 1) {
*ts = update_time_in_date(*ts, hour, minute);
ret |= 2;
ret |= PARSE_DATETIME_HAS_TIME;
} else {
return 0;
}