diff --git a/include/rcutils/time.h b/include/rcutils/time.h index ec9ed523..e08692fa 100644 --- a/include/rcutils/time.h +++ b/include/rcutils/time.h @@ -27,18 +27,18 @@ extern "C" #include "rcutils/visibility_control.h" /// Convenience macro to convert seconds to nanoseconds. -#define RCUTILS_S_TO_NS(seconds) (seconds * (1000 * 1000 * 1000)) +#define RCUTILS_S_TO_NS(seconds) (seconds * (1000LL * 1000LL * 1000LL)) /// Convenience macro to convert milliseconds to nanoseconds. -#define RCUTILS_MS_TO_NS(milliseconds) (milliseconds * (1000 * 1000)) +#define RCUTILS_MS_TO_NS(milliseconds) (milliseconds * (1000LL * 1000LL)) /// Convenience macro to convert microseconds to nanoseconds. -#define RCUTILS_US_TO_NS(microseconds) (microseconds * 1000) +#define RCUTILS_US_TO_NS(microseconds) (microseconds * 1000LL) /// Convenience macro to convert nanoseconds to seconds. -#define RCUTILS_NS_TO_S(nanoseconds) (nanoseconds / (1000 * 1000 * 1000)) +#define RCUTILS_NS_TO_S(nanoseconds) (nanoseconds / (1000LL * 1000LL * 1000LL)) /// Convenience macro to convert nanoseconds to milliseconds. -#define RCUTILS_NS_TO_MS(nanoseconds) (nanoseconds / (1000 * 1000)) +#define RCUTILS_NS_TO_MS(nanoseconds) (nanoseconds / (1000LL * 1000LL)) /// Convenience macro to convert nanoseconds to microseconds. -#define RCUTILS_NS_TO_US(nanoseconds) (nanoseconds / 1000) +#define RCUTILS_NS_TO_US(nanoseconds) (nanoseconds / 1000LL) /// A single point in time, measured in nanoseconds since the Unix epoch. typedef int64_t rcutils_time_point_value_t;