diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-03-04 09:15:24 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-03-04 09:17:21 +0100 |
commit | 65fb1ff8b183a748ab4a42a5e10d89c044fb91e1 (patch) | |
tree | 3e5ebecd275b70acbf2e99586e5b8a117b023df6 /src | |
parent | 061f74108b9bfc89126154a461c697a118fe1acb (diff) | |
download | calcurse-65fb1ff8b183a748ab4a42a5e10d89c044fb91e1.zip |
Simplify get_item_hour() and get_item_min() in "utils.c".
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.c | 22 |
1 files changed, 6 insertions, 16 deletions
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 |