This is an automated email from the ASF dual-hosted git repository. xiaoxiang pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit b9bf7f5c4fb7c0e2f789009b3123f7481b9378df Author: ouyangxiangzhen <[email protected]> AuthorDate: Tue Sep 2 10:50:17 2025 +0800 testing/drivers: Change uint32_t time to uint64_t. This commmit fixed the time multiplication overflow issue. Signed-off-by: ouyangxiangzhen <[email protected]> --- testing/drivers/drivertest/drivertest_posix_timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/drivers/drivertest/drivertest_posix_timer.c b/testing/drivers/drivertest/drivertest_posix_timer.c index 469ecc198..ccca6e1c2 100644 --- a/testing/drivers/drivertest/drivertest_posix_timer.c +++ b/testing/drivers/drivertest/drivertest_posix_timer.c @@ -64,7 +64,7 @@ struct posix_timer_state_s { struct itimerspec it; - uint32_t tim; + uint64_t tim; uint32_t deviation; }; @@ -140,12 +140,12 @@ static void parse_commandline( * Name: get_timestamp ****************************************************************************/ -static uint32_t get_timestamp(void) +static uint64_t get_timestamp(void) { struct timespec ts; - uint32_t ms; + uint64_t ms; clock_gettime(CLOCK_MONOTONIC, &ts); - ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; + ms = (uint64_t)ts.tv_sec * 1000 + ts.tv_nsec / 1000000; return ms; }
