From 65fb1ff8b183a748ab4a42a5e10d89c044fb91e1 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Fri, 4 Mar 2011 09:15:24 +0100 Subject: Simplify get_item_hour() and get_item_min() in "utils.c". Signed-off-by: Lukas Fleischer --- src/utils.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/utils.c b/src/utils.c index 630b6bf..f129416 100644 --- a/src/utils.c +++ b/src/utils.c @@ -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 -- cgit v1.2.3-70-g09d2