Simplify get_item_hour() and get_item_min() in "utils.c".

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2011-03-04 09:15:24 +01:00
parent 061f74108b
commit 65fb1ff8b1

View File

@ -472,32 +472,22 @@ is_all_digit (char *string)
long
get_item_time (long date)
{
return (long)(get_item_hour (date) * HOURINSEC
+ get_item_min (date) * MININSEC);
return (long)(get_item_hour (date) * HOURINSEC +
get_item_min (date) * MININSEC);
}
int
get_item_hour (long date)
{
struct tm *lt;
time_t t;
t = (time_t)date;
lt = localtime (&t);
return lt->tm_hour;
time_t t = (time_t)date;
return (localtime (&t))->tm_hour;
}
int
get_item_min (long date)
{
struct tm *lt;
time_t t;
t = (time_t)date;
lt = localtime (&t);
return lt->tm_min;
time_t t = (time_t)date;
return (localtime (&t))->tm_min;
}
long