@@ -120,8 +120,8 @@ ZTEST(timeutil_api, test_timespec_is_valid)
120120 bool valid = timespec_is_valid (& tspec -> invalid_ts );
121121
122122 zexpect_equal (valid , tspec -> expect_valid ,
123- "%d : timespec_is_valid({%ld , %ld }) = %s, expected true" , i ,
124- tspec -> valid_ts .tv_sec , tspec -> valid_ts .tv_nsec ,
123+ "%zu : timespec_is_valid({%lld , %lld }) = %s, expected true" , i ,
124+ ( long long ) tspec -> valid_ts .tv_sec , ( long long ) tspec -> valid_ts .tv_nsec ,
125125 tspec -> expect_valid ? "false" : "true" );
126126 }
127127}
@@ -139,7 +139,7 @@ ZTEST(timeutil_api, test_timespec_normalize)
139139
140140 overflow = !timespec_normalize (& norm );
141141 zexpect_not_equal (tspec -> expect_valid || tspec -> correctable , overflow ,
142- "%d : timespec_normalize({%lld, %lld}) %s, unexpectedly" , i ,
142+ "%zu : timespec_normalize({%lld, %lld}) %s, unexpectedly" , i ,
143143 (long long )tspec -> invalid_ts .tv_sec ,
144144 (long long )tspec -> invalid_ts .tv_nsec ,
145145 tspec -> correctable ? "failed" : "succeeded" );
@@ -148,7 +148,7 @@ ZTEST(timeutil_api, test_timespec_normalize)
148148 different = !timespec_equal (& tspec -> invalid_ts , & norm );
149149 corrected = timespec_equal (& tspec -> valid_ts , & norm );
150150 zexpect_true (different && corrected ,
151- "%d : {%lld, %lld} is not properly corrected:"
151+ "%zu : {%lld, %lld} is not properly corrected:"
152152 "{%lld, %lld} != {%lld, %lld}" , i ,
153153 (long long )tspec -> invalid_ts .tv_sec ,
154154 (long long )tspec -> invalid_ts .tv_nsec ,
@@ -191,15 +191,17 @@ ZTEST(timeutil_api, test_timespec_add)
191191 overflow = !timespec_add (& actual , & tspec -> b );
192192
193193 zexpect_equal (overflow , tspec -> expect ,
194- "%d: timespec_add({%ld, %ld}, {%ld, %ld}) %s, unexpectedly" , i ,
195- tspec -> a .tv_sec , tspec -> a .tv_nsec , tspec -> b .tv_sec , tspec -> b .tv_nsec ,
194+ "%zu: timespec_add({%lld, %lld}, {%lld, %lld}) %s, unexpectedly" , i ,
195+ (long long )tspec -> a .tv_sec , (long long )tspec -> a .tv_nsec ,
196+ (long long )tspec -> b .tv_sec , (long long )tspec -> b .tv_nsec ,
196197 tspec -> expect ? "succeeded" : "failed" );
197198
198199 if (!tspec -> expect ) {
199- zexpect_equal (timespec_equal (& actual , & tspec -> result ), true,
200- "%d: {%ld, %ld} and {%ld, %ld} are unexpectedly different" , i ,
201- actual .tv_sec , actual .tv_nsec , tspec -> result .tv_sec ,
202- tspec -> result .tv_nsec );
200+ zexpect_equal (
201+ timespec_equal (& actual , & tspec -> result ), true,
202+ "%zu: {%lld, %lld} and {%lld, %lld} are unexpectedly different" , i ,
203+ (long long )actual .tv_sec , (long long )actual .tv_nsec ,
204+ (long long )tspec -> result .tv_sec , (long long )tspec -> result .tv_nsec );
203205 }
204206 }
205207}
@@ -228,15 +230,16 @@ ZTEST(timeutil_api, test_timespec_negate)
228230
229231 overflow = !timespec_negate (& actual );
230232 zexpect_equal (overflow , tspec -> expect_failure ,
231- "%d : timespec_negate({%ld , %ld }) %s, unexpectedly" , i ,
232- tspec -> ts .tv_sec , tspec -> ts .tv_nsec ,
233+ "%zu : timespec_negate({%lld , %lld }) %s, unexpectedly" , i ,
234+ ( long long ) tspec -> ts .tv_sec , ( long long ) tspec -> ts .tv_nsec ,
233235 tspec -> expect_failure ? "did not overflow" : "overflowed" );
234236
235237 if (!tspec -> expect_failure ) {
236- zexpect_true (timespec_equal (& actual , & tspec -> result ),
237- "%d: {%ld, %ld} and {%ld, %ld} are unexpectedly different" , i ,
238- actual .tv_sec , actual .tv_nsec , tspec -> result .tv_sec ,
239- tspec -> result .tv_nsec );
238+ zexpect_true (
239+ timespec_equal (& actual , & tspec -> result ),
240+ "%zu: {%lld, %lld} and {%lld, %lld} are unexpectedly different" , i ,
241+ (long long )actual .tv_sec , (long long )actual .tv_nsec ,
242+ (long long )tspec -> result .tv_sec , (long long )tspec -> result .tv_nsec );
240243 }
241244 }
242245}
@@ -450,9 +453,9 @@ ZTEST(timeutil_api, test_timespec_from_timeout)
450453
451454 timespec_from_timeout (tspec -> timeout , & actual );
452455 zexpect_true (timespec_equal (& actual , & tspec -> tspec ),
453- "%d : {%ld , %ld } and {%ld , %ld } are unexpectedly different" , i ,
454- actual .tv_sec , actual .tv_nsec , tspec -> tspec . tv_sec ,
455- tspec -> tspec .tv_nsec );
456+ "%zu : {%lld , %lld } and {%lld , %lld } are unexpectedly different" , i ,
457+ ( long long ) actual .tv_sec , ( long long ) actual .tv_nsec ,
458+ ( long long ) tspec -> tspec . tv_sec , ( long long ) tspec -> tspec .tv_nsec );
456459 }
457460}
458461
@@ -486,7 +489,7 @@ ZTEST(timeutil_api, test_timespec_to_timeout)
486489 (long long )tspec -> tspec .tv_nsec );
487490 }
488491 zexpect_equal (actual .ticks , tspec -> timeout .ticks ,
489- "%d : {%" PRId64 "} and {%" PRId64
492+ "%zu : {%" PRId64 "} and {%" PRId64
490493 "} are unexpectedly different" ,
491494 i , (int64_t )actual .ticks , (int64_t )tspec -> timeout .ticks );
492495 } else if (tspec -> saturation < 0 ) {
@@ -499,7 +502,7 @@ ZTEST(timeutil_api, test_timespec_to_timeout)
499502 (long long )SYS_TIMESPEC_MIN .tv_sec ,
500503 (long long )SYS_TIMESPEC_MIN .tv_nsec );
501504 zexpect_equal (actual .ticks , K_TICK_MIN ,
502- "%d : {%" PRId64 "} and {%" PRId64
505+ "%zu : {%" PRId64 "} and {%" PRId64
503506 "} are unexpectedly different" ,
504507 i , (int64_t )actual .ticks , (int64_t )K_TICK_MIN );
505508 } else if (tspec -> saturation > 0 ) {
@@ -512,17 +515,17 @@ ZTEST(timeutil_api, test_timespec_to_timeout)
512515 (long long )SYS_TIMESPEC_MAX .tv_sec ,
513516 (long long )SYS_TIMESPEC_MAX .tv_nsec );
514517 zexpect_equal (actual .ticks , K_TICK_MAX ,
515- "%d : {%" PRId64 "} and {%" PRId64
518+ "%zu : {%" PRId64 "} and {%" PRId64
516519 "} are unexpectedly different" ,
517520 i , (int64_t )actual .ticks , (int64_t )K_TICK_MAX );
518521 }
519522
520523 timespec_from_timeout (tspec -> timeout , & tick_ts );
521524 timespec_add (& tick_ts , & rem );
522525 zexpect_true (timespec_equal (& tick_ts , & tspec -> tspec ),
523- "%d : {%ld , %ld } and {%ld , %ld } are unexpectedly different" , i ,
524- tick_ts .tv_sec , tick_ts .tv_nsec , tspec -> tspec . tv_sec ,
525- tspec -> tspec .tv_nsec );
526+ "%zu : {%lld , %lld } and {%lld , %lld } are unexpectedly different" , i ,
527+ ( long long ) tick_ts .tv_sec , ( long long ) tick_ts .tv_nsec ,
528+ ( long long ) tspec -> tspec . tv_sec , ( long long ) tspec -> tspec .tv_nsec );
526529 }
527530
528531#if defined(CONFIG_TIMEOUT_64BIT ) && (CONFIG_SYS_CLOCK_TICKS_PER_SEC == 100 )
0 commit comments