summaryrefslogtreecommitdiff
path: root/src/shared/time-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-05-22 11:44:03 +0900
committerLennart Poettering <lennart@poettering.net>2014-05-22 11:44:03 +0900
commit609e002e78e79ef2bf9d6a6ea22bda215abbbb14 (patch)
tree6849887587763c2c1333216e9f942c9a74b9b537 /src/shared/time-util.h
parent558c6490b1df7f82a63d0a747fda7412c4d28b0c (diff)
time-util: make sure USEC_PER_SEC and friends are actually of type usec_t
Diffstat (limited to 'src/shared/time-util.h')
-rw-r--r--src/shared/time-util.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/shared/time-util.h b/src/shared/time-util.h
index 96f2ec8fa3..f68c095605 100644
--- a/src/shared/time-util.h
+++ b/src/shared/time-util.h
@@ -37,25 +37,25 @@ typedef struct dual_timestamp {
usec_t monotonic;
} dual_timestamp;
-#define MSEC_PER_SEC 1000ULL
-#define USEC_PER_SEC 1000000ULL
-#define USEC_PER_MSEC 1000ULL
-#define NSEC_PER_SEC 1000000000ULL
-#define NSEC_PER_MSEC 1000000ULL
-#define NSEC_PER_USEC 1000ULL
-
-#define USEC_PER_MINUTE (60ULL*USEC_PER_SEC)
-#define NSEC_PER_MINUTE (60ULL*NSEC_PER_SEC)
-#define USEC_PER_HOUR (60ULL*USEC_PER_MINUTE)
-#define NSEC_PER_HOUR (60ULL*NSEC_PER_MINUTE)
-#define USEC_PER_DAY (24ULL*USEC_PER_HOUR)
-#define NSEC_PER_DAY (24ULL*NSEC_PER_HOUR)
-#define USEC_PER_WEEK (7ULL*USEC_PER_DAY)
-#define NSEC_PER_WEEK (7ULL*NSEC_PER_DAY)
-#define USEC_PER_MONTH (2629800ULL*USEC_PER_SEC)
-#define NSEC_PER_MONTH (2629800ULL*NSEC_PER_SEC)
-#define USEC_PER_YEAR (31557600ULL*USEC_PER_SEC)
-#define NSEC_PER_YEAR (31557600ULL*NSEC_PER_SEC)
+#define MSEC_PER_SEC ((usec_t) 1000ULL)
+#define USEC_PER_SEC ((usec_t) 1000000ULL)
+#define USEC_PER_MSEC ((usec_t) 1000ULL)
+#define NSEC_PER_SEC ((usec_t) 1000000000ULL)
+#define NSEC_PER_MSEC ((usec_t) 1000000ULL)
+#define NSEC_PER_USEC ((usec_t) 1000ULL)
+
+#define USEC_PER_MINUTE ((usec_t) (60ULL*USEC_PER_SEC))
+#define NSEC_PER_MINUTE ((usec_t) (60ULL*NSEC_PER_SEC))
+#define USEC_PER_HOUR ((usec_t) (60ULL*USEC_PER_MINUTE))
+#define NSEC_PER_HOUR ((usec_t) (60ULL*NSEC_PER_MINUTE))
+#define USEC_PER_DAY ((usec_t) (24ULL*USEC_PER_HOUR))
+#define NSEC_PER_DAY ((usec_t) (24ULL*NSEC_PER_HOUR))
+#define USEC_PER_WEEK ((usec_t) (7ULL*USEC_PER_DAY))
+#define NSEC_PER_WEEK ((usec_t) (7ULL*NSEC_PER_DAY))
+#define USEC_PER_MONTH ((usec_t) (2629800ULL*USEC_PER_SEC))
+#define NSEC_PER_MONTH ((usec_t) (2629800ULL*NSEC_PER_SEC))
+#define USEC_PER_YEAR ((usec_t) (31557600ULL*USEC_PER_SEC))
+#define NSEC_PER_YEAR ((usec_t) (31557600ULL*NSEC_PER_SEC))
#define FORMAT_TIMESTAMP_MAX ((4*4+1)+11+9+4+1) /* weekdays can be unicode */
#define FORMAT_TIMESTAMP_RELATIVE_MAX 256