summaryrefslogtreecommitdiff
path: root/src/cdf_time.c
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2009-05-08 17:41:58 +0000
committerChristos Zoulas <christos@zoulas.com>2009-05-08 17:41:58 +0000
commit02b20a5d7635b627575cecaba3ce4afcb60891f3 (patch)
treeee2495751ebab6f9dae7a3e4546de6f3df62b81c /src/cdf_time.c
parentfffb9a51ce2baf298c797c29b65a59a45cba5b9d (diff)
downloadfile-git-02b20a5d7635b627575cecaba3ce4afcb60891f3.tar.gz
lint fixes and more from NetBSD
Diffstat (limited to 'src/cdf_time.c')
-rw-r--r--src/cdf_time.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cdf_time.c b/src/cdf_time.c
index 932253be..43c8d579 100644
--- a/src/cdf_time.c
+++ b/src/cdf_time.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: cdf_time.c,v 1.6 2009/03/10 11:44:29 christos Exp $")
+FILE_RCSID("@(#)$File: cdf_time.c,v 1.7 2009/05/08 17:41:58 christos Exp $")
#endif
#include <time.h>
@@ -108,22 +108,22 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
ts->tv_nsec = (t % CDF_TIME_PREC) * 100;
t /= CDF_TIME_PREC;
- tm.tm_sec = t % 60;
+ tm.tm_sec = (int)(t % 60);
t /= 60;
- tm.tm_min = t % 60;
+ tm.tm_min = (int)(t % 60);
t /= 60;
- tm.tm_hour = t % 24;
+ tm.tm_hour = (int)(t % 24);
t /= 24;
// XXX: Approx
- tm.tm_year = CDF_BASE_YEAR + (t / 365);
+ tm.tm_year = (int)(CDF_BASE_YEAR + (t / 365));
rdays = cdf_getdays(tm.tm_year);
t -= rdays;
- tm.tm_mday = cdf_getday(tm.tm_year, t);
- tm.tm_mon = cdf_getmonth(tm.tm_year, t);
+ tm.tm_mday = cdf_getday(tm.tm_year, (int)t);
+ tm.tm_mon = cdf_getmonth(tm.tm_year, (int)t);
tm.tm_wday = 0;
tm.tm_yday = 0;
tm.tm_isdst = 0;
@@ -143,10 +143,13 @@ cdf_timestamp_to_timespec(struct timespec *ts, cdf_timestamp_t t)
}
int
+/*ARGSUSED*/
cdf_timespec_to_timestamp(cdf_timestamp_t *t, const struct timespec *ts)
{
+#ifndef __lint__
(void)&t;
(void)&ts;
+#endif
#ifdef notyet
struct tm tm;
if (gmtime_r(&ts->ts_sec, &tm) == NULL) {