From fdfce08b681588b00898e788e5a3fdfce7004f26 Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Fri, 10 Jul 2020 14:59:29 -0400 Subject: [PATCH] Fix the compile error [#499] --- docker/README.md | 1 + lib/core/ogs-time.h | 2 +- src/amf/nnrf-handler.c | 8 ++++---- src/ausf/nnrf-handler.c | 8 ++++---- src/smf/nnrf-handler.c | 8 ++++---- src/udm/nnrf-handler.c | 8 ++++---- src/udm/nudm-handler.c | 2 -- src/udr/nnrf-handler.c | 8 ++++---- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/docker/README.md b/docker/README.md index 750f836dc5..95981e002a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -68,6 +68,7 @@ export DEBEMAIL='acetcom@gmail.com' * Version Change $ vi meson.build + $ ./misc/git-version-gen . > .tarball-version 2>/dev/null * Upload OpenBuildService $ dch -i diff --git a/lib/core/ogs-time.h b/lib/core/ogs-time.h index 26e83fc9cf..8b713cb8a0 100644 --- a/lib/core/ogs-time.h +++ b/lib/core/ogs-time.h @@ -34,7 +34,7 @@ typedef int64_t ogs_time_t; #define OGS_NO_WAIT_TIME (0) /** number of microseconds per second */ -#define OGS_USEC_PER_SEC (1000000L) +#define OGS_USEC_PER_SEC (1000000LL) /** @return ogs_time_t as a second */ #define ogs_time_sec(time) ((time) / OGS_USEC_PER_SEC) diff --git a/src/amf/nnrf-handler.c b/src/amf/nnrf-handler.c index 2f478b5009..0d87d724f2 100644 --- a/src/amf/nnrf-handler.c +++ b/src/amf/nnrf-handler.c @@ -68,16 +68,16 @@ void amf_nnrf_handle_nf_status_subscribe( subscription, SubscriptionData->subscription_id); if (SubscriptionData->validity_time) { -#define VALIDITY_MARGIN (5 * OGS_USEC_PER_SEC) /* 5 seconds */ -#define VALIDITY_MINIMUM (3600 * OGS_USEC_PER_SEC) /* 3600 seconds */ +#define VALIDITY_MARGIN (5LL * OGS_USEC_PER_SEC) /* 5 seconds */ +#define VALIDITY_MINIMUM (3600LL * OGS_USEC_PER_SEC) /* 3600 seconds */ ogs_time_t time, duration; if (ogs_sbi_time_from_string( &time, SubscriptionData->validity_time) == true) { duration = time - ogs_time_now() - VALIDITY_MARGIN; if (duration < VALIDITY_MINIMUM) { duration = VALIDITY_MINIMUM; - ogs_warn("[%s] Forced to %d seconds", - subscription->id, (int)ogs_time_sec(VALIDITY_MINIMUM)); + ogs_warn("[%s] Forced to %lld seconds", subscription->id, + (long long)ogs_time_sec(VALIDITY_MINIMUM)); } subscription->t_validity = ogs_timer_add(amf_self()->timer_mgr, amf_timer_subscription_validity, subscription); diff --git a/src/ausf/nnrf-handler.c b/src/ausf/nnrf-handler.c index afe7795265..790c089894 100644 --- a/src/ausf/nnrf-handler.c +++ b/src/ausf/nnrf-handler.c @@ -66,16 +66,16 @@ void ausf_nnrf_handle_nf_status_subscribe( subscription, SubscriptionData->subscription_id); if (SubscriptionData->validity_time) { -#define VALIDITY_MARGIN (5 * OGS_USEC_PER_SEC) /* 5 seconds */ -#define VALIDITY_MINIMUM (3600 * OGS_USEC_PER_SEC) /* 3600 seconds */ +#define VALIDITY_MARGIN (5LL * OGS_USEC_PER_SEC) /* 5 seconds */ +#define VALIDITY_MINIMUM (3600LL * OGS_USEC_PER_SEC) /* 3600 seconds */ ogs_time_t time, duration; if (ogs_sbi_time_from_string( &time, SubscriptionData->validity_time) == true) { duration = time - ogs_time_now() - VALIDITY_MARGIN; if (duration < VALIDITY_MINIMUM) { duration = VALIDITY_MINIMUM; - ogs_warn("[%s] Forced to %d seconds", - subscription->id, (int)ogs_time_sec(VALIDITY_MINIMUM)); + ogs_warn("[%s] Forced to %lld seconds", subscription->id, + (long long)ogs_time_sec(VALIDITY_MINIMUM)); } subscription->t_validity = ogs_timer_add(ausf_self()->timer_mgr, ausf_timer_subscription_validity, subscription); diff --git a/src/smf/nnrf-handler.c b/src/smf/nnrf-handler.c index 57fd6b851f..ec77c525c4 100644 --- a/src/smf/nnrf-handler.c +++ b/src/smf/nnrf-handler.c @@ -66,16 +66,16 @@ void smf_nnrf_handle_nf_status_subscribe( subscription, SubscriptionData->subscription_id); if (SubscriptionData->validity_time) { -#define VALIDITY_MARGIN (5 * OGS_USEC_PER_SEC) /* 5 seconds */ -#define VALIDITY_MINIMUM (3600 * OGS_USEC_PER_SEC) /* 3600 seconds */ +#define VALIDITY_MARGIN (5LL * OGS_USEC_PER_SEC) /* 5 seconds */ +#define VALIDITY_MINIMUM (3600LL * OGS_USEC_PER_SEC) /* 3600 seconds */ ogs_time_t time, duration; if (ogs_sbi_time_from_string( &time, SubscriptionData->validity_time) == true) { duration = time - ogs_time_now() - VALIDITY_MARGIN; if (duration < VALIDITY_MINIMUM) { duration = VALIDITY_MINIMUM; - ogs_warn("[%s] Forced to %d seconds", - subscription->id, (int)ogs_time_sec(VALIDITY_MINIMUM)); + ogs_warn("[%s] Forced to %lld seconds", subscription->id, + (long long)ogs_time_sec(VALIDITY_MINIMUM)); } subscription->t_validity = ogs_timer_add(smf_self()->timer_mgr, smf_timer_subscription_validity, subscription); diff --git a/src/udm/nnrf-handler.c b/src/udm/nnrf-handler.c index 620bd9f3ae..e4812e9219 100644 --- a/src/udm/nnrf-handler.c +++ b/src/udm/nnrf-handler.c @@ -66,16 +66,16 @@ void udm_nnrf_handle_nf_status_subscribe( subscription, SubscriptionData->subscription_id); if (SubscriptionData->validity_time) { -#define VALIDITY_MARGIN (5 * OGS_USEC_PER_SEC) /* 5 seconds */ -#define VALIDITY_MINIMUM (3600 * OGS_USEC_PER_SEC) /* 3600 seconds */ +#define VALIDITY_MARGIN (5LL * OGS_USEC_PER_SEC) /* 5 seconds */ +#define VALIDITY_MINIMUM (3600LL * OGS_USEC_PER_SEC) /* 3600 seconds */ ogs_time_t time, duration; if (ogs_sbi_time_from_string( &time, SubscriptionData->validity_time) == true) { duration = time - ogs_time_now() - VALIDITY_MARGIN; if (duration < VALIDITY_MINIMUM) { duration = VALIDITY_MINIMUM; - ogs_warn("[%s] Forced to %d seconds", - subscription->id, (int)ogs_time_sec(VALIDITY_MINIMUM)); + ogs_warn("[%s] Forced to %lld seconds", subscription->id, + (long long)ogs_time_sec(VALIDITY_MINIMUM)); } subscription->t_validity = ogs_timer_add(udm_self()->timer_mgr, udm_timer_subscription_validity, subscription); diff --git a/src/udm/nudm-handler.c b/src/udm/nudm-handler.c index fd90e06aaf..01da88aaf6 100644 --- a/src/udm/nudm-handler.c +++ b/src/udm/nudm-handler.c @@ -122,8 +122,6 @@ bool udm_nudm_ueau_handle_get(udm_ue_t *udm_ue, ogs_sbi_message_t *recvmsg) ogs_log_print(OGS_LOG_ERROR, "[MAC_S] "); ogs_log_hexdump(OGS_LOG_ERROR, mac_s, OGS_MAC_S_LEN); ogs_log_hexdump(OGS_LOG_ERROR, auts + OGS_SQN_LEN, OGS_MAC_S_LEN); - ogs_log_print(OGS_LOG_ERROR, "[SQN] UDM 0x%llx UE ", - (long long)udm_ue->sqn); ogs_log_hexdump(OGS_LOG_ERROR, sqn_ms, OGS_SQN_LEN); ogs_sbi_server_send_error(session, OGS_SBI_HTTP_STATUS_UNAUTHORIZED, diff --git a/src/udr/nnrf-handler.c b/src/udr/nnrf-handler.c index 4625abb23d..55a8bea954 100644 --- a/src/udr/nnrf-handler.c +++ b/src/udr/nnrf-handler.c @@ -66,16 +66,16 @@ void udr_nnrf_handle_nf_status_subscribe( subscription, SubscriptionData->subscription_id); if (SubscriptionData->validity_time) { -#define VALIDITY_MARGIN (5 * OGS_USEC_PER_SEC) /* 5 seconds */ -#define VALIDITY_MINIMUM (3600 * OGS_USEC_PER_SEC) /* 3600 seconds */ +#define VALIDITY_MARGIN (5LL * OGS_USEC_PER_SEC) /* 5 seconds */ +#define VALIDITY_MINIMUM (3600LL * OGS_USEC_PER_SEC) /* 3600 seconds */ ogs_time_t time, duration; if (ogs_sbi_time_from_string( &time, SubscriptionData->validity_time) == true) { duration = time - ogs_time_now() - VALIDITY_MARGIN; if (duration < VALIDITY_MINIMUM) { duration = VALIDITY_MINIMUM; - ogs_warn("[%s] Forced to %d seconds", - subscription->id, (int)ogs_time_sec(VALIDITY_MINIMUM)); + ogs_warn("[%s] Forced to %lld seconds", subscription->id, + (long long)ogs_time_sec(VALIDITY_MINIMUM)); } subscription->t_validity = ogs_timer_add(udr_self()->timer_mgr, udr_timer_subscription_validity, subscription);