From 5853249026a1dc7ab3100ee642c8a9e768368b23 Mon Sep 17 00:00:00 2001 From: gozfree Date: Wed, 21 Nov 2018 21:26:09 +0800 Subject: [PATCH] [libtime] fix compile error --- autogen_lib.sh | 2 +- libtime/libtime.c | 4 ++-- libtime/test_libtime.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autogen_lib.sh b/autogen_lib.sh index 1cd490a0..37852302 100755 --- a/autogen_lib.sh +++ b/autogen_lib.sh @@ -177,7 +177,7 @@ ${S}(TGT_LIB_A): ${S}(OBJS_LIB) ${S}(AR_V) rcs ${S}@ $^ ${S}(TGT_LIB_SO): ${S}(OBJS_LIB) - ${S}(LD_V) -o ${S}@ $^ ${S}(SHARED) + ${S}(CC_V) -o ${S}@ $^ ${S}(SHARED) @mv ${S}(TGT_LIB_SO) ${S}(TGT_LIB_SO_VER) @ln -sf ${S}(TGT_LIB_SO_VER) ${S}(TGT_LIB_SO) diff --git a/libtime/libtime.c b/libtime/libtime.c index 59dd04bd..e0c62bfc 100644 --- a/libtime/libtime.c +++ b/libtime/libtime.c @@ -246,8 +246,8 @@ int time_set_info(struct time_info *ti) bool time_passed_sec(int sec) { bool ret = false; - static uint32_t last_sec = 0; - static uint32_t now_sec = 0; + static uint64_t last_sec = 0; + static uint64_t now_sec = 0; now_sec = time_get_sec(); if (last_sec == 0) { last_sec = now_sec; diff --git a/libtime/test_libtime.c b/libtime/test_libtime.c index 0bb39cac..140ecda1 100644 --- a/libtime/test_libtime.c +++ b/libtime/test_libtime.c @@ -16,7 +16,7 @@ void foo() char time[32]; printf("time_get_sec_str: %s", time_get_sec_str()); printf("time_get_msec_str: %s\n", time_get_msec_str(time, sizeof(time))); - printf("time_get_sec: %" PRIu32 "\n", time_get_sec()); + printf("time_get_sec: %" PRIu64 "\n", time_get_sec()); printf("time_get_msec: %" PRIu64 "\n", time_get_msec()); printf("time_get_msec: %" PRIu64 "\n", time_get_usec()/1000); printf("time_get_usec: %" PRIu64 "\n", time_get_usec());