From a2a3f377fd2cb3909c1d5d2a816aa1971cef8e1b Mon Sep 17 00:00:00 2001 From: emanuel Date: Fri, 23 Sep 2022 09:33:25 +0100 Subject: [PATCH] %ld -> %lld in tpm.c --- src/tpm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/tpm.c b/src/tpm.c index 54fa317..7d65dc2 100644 --- a/src/tpm.c +++ b/src/tpm.c @@ -44,11 +44,11 @@ int tpm_should_retransmit() { uint64_t now = itss_ts_get(TIME_MICROSECONDS); if (tolling->station.obu.rt_on) { - if (now > tolling->station.obu.rt_init + TOLLING_RT_TIMEOUT_MS*1000) { + if (now > tolling->station.obu.rt_init + TOLLING_RT_TIMEOUT_MS*1000ULL) { tolling->station.obu.rt_on = false; return 0; } - if (now > tolling->station.obu.rt_t_trigger + TOLLING_RT_PERIOD_MS*1000) { + if (now > tolling->station.obu.rt_t_trigger + TOLLING_RT_PERIOD_MS*1000ULL) { return 1; } } @@ -81,7 +81,7 @@ int tpm_pay(tolling_info_t* info, void** security_socket, uint8_t* neighbour, ui tolling->station.obu.active = true; tolling->station.obu.nonce = rand() + 1; - log_info("[tolling] issuing toll %s.request | client: %ld nonce: %ld", tts(info->asn->tollType), tolling->station.obu.client_id, tolling->station.obu.nonce); + log_info("[tolling] issuing toll %s.request | client: %lld nonce: %lld", tts(info->asn->tollType), tolling->station.obu.client_id, tolling->station.obu.nonce); // TPM tpm = calloc(1, sizeof(TPM_t)); @@ -1139,11 +1139,11 @@ static void veh_handle_recv(tolling_t* tolling, TPM_t* tpm_rx, void** security_s switch (type_rx->present) { case TollingType_PR_entry: - log_info("[tolling] received entry.reply | client: %lld nonce: %ld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); + log_info("[tolling] received entry.reply | client: %lld nonce: %lld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); break; case TollingType_PR_exit: - log_info("[tolling] received exit.reply | client: %lld nonce: %ld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); + log_info("[tolling] received exit.reply | client: %lld nonce: %lld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); tolling->station.obu.toll_type = -1; tolling->station.obu.active = false; ASN_STRUCT_FREE(asn_DEF_TPM, tolling->station.obu.entry_proof); @@ -1151,7 +1151,7 @@ static void veh_handle_recv(tolling_t* tolling, TPM_t* tpm_rx, void** security_s break; case TollingType_PR_single: - log_info("[tolling] received single.reply | client: %lld nonce: %ld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); + log_info("[tolling] received single.reply | client: %lld nonce: %lld accepted: %s", (long long) tolling->station.obu.client_id, tolling->station.obu.nonce, accepted ? "yes" : "no"); tolling->station.obu.toll_type = -1; tolling->station.obu.active = false; break; @@ -1252,7 +1252,7 @@ int tpm_recv(TPM_t* tpm_rx, void** security_socket, uint8_t* neighbour, uint8_t* goto cleanup; } itss_time_lock(); - log_info("[tolling] entry.reply took %ld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); + log_info("[tolling] entry.reply took %lld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); itss_time_unlock(); tolling->station.obu.rt_on = false; veh_handle_recv(tolling, tpm_rx, security_socket, facilities.tx_queue, neighbour, src_addr); @@ -1280,7 +1280,7 @@ int tpm_recv(TPM_t* tpm_rx, void** security_socket, uint8_t* neighbour, uint8_t* goto cleanup; } itss_time_lock(); - log_info("[tolling] exit.reply took %ld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); + log_info("[tolling] exit.reply took %lld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); itss_time_unlock(); tolling->station.obu.rt_on = false; veh_handle_recv(tolling, tpm_rx, security_socket, facilities.tx_queue, neighbour, src_addr); @@ -1305,7 +1305,7 @@ int tpm_recv(TPM_t* tpm_rx, void** security_socket, uint8_t* neighbour, uint8_t* goto cleanup; } itss_time_lock(); - log_info("[tolling] single.reply took %ld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); + log_info("[tolling] single.reply took %lld us", itss_ts_get(TIME_MICROSECONDS) - tolling->station.obu.rt_init); itss_time_unlock(); tolling->station.obu.rt_on = false; veh_handle_recv(tolling, tpm_rx, security_socket, facilities.tx_queue, neighbour, src_addr);