samples/tests: Convert use of %ll{u,d} to PRI{u,d}64
Move to using PRIu64/PRId64 instead of %llu/%lld since on native_posix_64 the uint64_t/int64_t type is defined in terms of 'long int' and not 'long long int'. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
a1b77fd589
commit
d00d0f1266
7 changed files with 10 additions and 10 deletions
|
@ -134,7 +134,7 @@ static void gptp_phase_dis_cb(uint8_t *gm_identity,
|
|||
if (memcmp(id, gm_identity, sizeof(id))) {
|
||||
memcpy(id, gm_identity, sizeof(id));
|
||||
|
||||
LOG_DBG("GM %s last phase %d.%lld",
|
||||
LOG_DBG("GM %s last phase %d.%" PRId64 "",
|
||||
log_strdup(gptp_sprint_clock_id(gm_identity, output,
|
||||
sizeof(output))),
|
||||
last_gm_ph_change->high,
|
||||
|
|
|
@ -218,7 +218,7 @@ static void recv_data_wso_api(int sock, size_t amount, uint8_t *buf,
|
|||
if (remaining != 0 || total_read != amount ||
|
||||
/* Do not check the final \n at the end of the msg */
|
||||
memcmp(lorem_ipsum, buf, amount - 1) != 0) {
|
||||
LOG_ERR("%s data recv failure %zd/%d bytes (remaining %lld)",
|
||||
LOG_ERR("%s data recv failure %zd/%d bytes (remaining %" PRId64 ")",
|
||||
proto, amount, total_read, remaining);
|
||||
LOG_HEXDUMP_DBG(buf, total_read, "received ws buf");
|
||||
LOG_HEXDUMP_DBG(lorem_ipsum, total_read, "sent ws buf");
|
||||
|
|
|
@ -85,7 +85,7 @@ int alpha_handle_set(const char *name, size_t len, settings_read_cb read_cb,
|
|||
|
||||
if (!next) {
|
||||
rc = read_cb(cb_arg, &length_val, sizeof(length_val));
|
||||
printk("<alpha/length> = %lld\n", length_val);
|
||||
printk("<alpha/length> = %" PRId64 "\n", length_val);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -318,7 +318,7 @@ static void example_direct_load_subtree(void)
|
|||
rc = settings_load_subtree_direct("alpha/length", direct_loader,
|
||||
(void *)&dld);
|
||||
if (rc == 0) {
|
||||
printk(" direct.length = %lld\n", dld.length);
|
||||
printk(" direct.length = %" PRId64 "\n", dld.length);
|
||||
printk(" direct.length_1 = %d\n", dld.length_1);
|
||||
printk(" direct.length_2 = %d\n", dld.length_2);
|
||||
} else {
|
||||
|
|
|
@ -102,7 +102,7 @@ static void test_early_sleep(void)
|
|||
*/
|
||||
k_thread_priority_set(k_current_get(), 0);
|
||||
|
||||
TC_PRINT("msec per tick: %lld.%03lld, ticks to sleep: %d\n",
|
||||
TC_PRINT("msec per tick: %" PRId64 ".%03" PRId64 ", ticks to sleep: %d\n",
|
||||
k_ticks_to_ms_floor64(1000) / 1000U,
|
||||
k_ticks_to_ms_floor64(1000) % 1000,
|
||||
TEST_TICKS_TO_SLEEP);
|
||||
|
|
|
@ -87,7 +87,7 @@ void test_usleep(void)
|
|||
}
|
||||
}
|
||||
|
||||
printk("elapsed_ms = %lld\n", elapsed_ms);
|
||||
printk("elapsed_ms = %" PRId64 "\n", elapsed_ms);
|
||||
zassert_true(elapsed_ms >= LOWER_BOUND_MS, "short sleep");
|
||||
zassert_true(elapsed_ms <= UPPER_BOUND_MS, "overslept");
|
||||
}
|
||||
|
|
|
@ -137,7 +137,7 @@ void ticklessTestThread(void)
|
|||
printk("Calibrated time stamp period = 0x%x%x\n",
|
||||
(uint32_t)(cal_tsc >> 32), (uint32_t)(cal_tsc & 0xFFFFFFFFLL));
|
||||
#elif defined(CONFIG_ARCH_POSIX)
|
||||
printk("Calibrated time stamp period = %llu\n", cal_tsc);
|
||||
printk("Calibrated time stamp period = %" PRIu64 "\n", cal_tsc);
|
||||
#elif defined(CONFIG_ARM)
|
||||
printk("Calibrated time stamp period = 0x%x\n", cal_tsc);
|
||||
#endif
|
||||
|
@ -184,8 +184,8 @@ void ticklessTestThread(void)
|
|||
printk("Cal time stamp: 0x%x%x\n",
|
||||
(uint32_t)(cal_tsc >> 32), (uint32_t)(cal_tsc & 0xFFFFFFFFLL));
|
||||
#elif defined(CONFIG_ARCH_POSIX)
|
||||
printk("diff time stamp: %llu\n", diff_tsc);
|
||||
printk("Cal time stamp: %llu\n", cal_tsc);
|
||||
printk("diff time stamp: %" PRIu64 "\n", diff_tsc);
|
||||
printk("Cal time stamp: %" PRIu64 "\n", cal_tsc);
|
||||
#elif defined(CONFIG_ARM)
|
||||
printk("diff time stamp: 0x%x\n", diff_tsc);
|
||||
printk("Cal time stamp: 0x%x\n", cal_tsc);
|
||||
|
|
|
@ -50,7 +50,7 @@ static void thread_tslice(void *p1, void *p2, void *p3)
|
|||
{
|
||||
int64_t t = k_uptime_delta(&elapsed_slice);
|
||||
|
||||
TC_PRINT("elapsed slice %lld, expected: <%lld, %lld>\n",
|
||||
TC_PRINT("elapsed slice %" PRId64 ", expected: <%" PRId64 ", %" PRId64 ">\n",
|
||||
t, SLICE_SIZE, SLICE_SIZE_LIMIT);
|
||||
|
||||
/**TESTPOINT: verify slicing scheduler behaves as expected*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue