Skip to content

Commit 382a828

Browse files
author
Minggang Wang
committed
Change parameter of timer from uint64_t to int64_t
This patch fixed the compile error caused by ros2/rcl@44801b3 Fix #265
1 parent cb71113 commit 382a828

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rcl_bindings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ NAN_METHOD(CreateTimer) {
7272
*timer = rcl_get_zero_initialized_timer();
7373
THROW_ERROR_IF_NOT_EQUAL(
7474
RCL_RET_OK,
75-
rcl_timer_init(timer, RCL_MS_TO_NS((uint64_t)period_ms), nullptr,
75+
rcl_timer_init(timer, RCL_MS_TO_NS(period_ms), nullptr,
7676
rcl_get_default_allocator()), rcl_get_error_string_safe());
7777

7878
auto js_obj = RclHandle::NewInstance(timer, nullptr, [timer] {
@@ -144,7 +144,7 @@ NAN_METHOD(TimerGetTimeUntilNextCall) {
144144
NAN_METHOD(TimerGetTimeSinceLastCall) {
145145
RclHandle* timer_handle = RclHandle::Unwrap<RclHandle>(info[0]->ToObject());
146146
rcl_timer_t* timer = reinterpret_cast<rcl_timer_t*>(timer_handle->ptr());
147-
uint64_t elapsed_time = 0;
147+
int64_t elapsed_time = 0;
148148

149149
THROW_ERROR_IF_NOT_EQUAL(
150150
RCL_RET_OK, rcl_timer_get_time_since_last_call(timer, &elapsed_time),

0 commit comments

Comments
 (0)