diff --git a/base/test/unittest/common/event_loop_test.cpp b/base/test/unittest/common/event_loop_test.cpp index b47ffc48..bff54af7 100644 --- a/base/test/unittest/common/event_loop_test.cpp +++ b/base/test/unittest/common/event_loop_test.cpp @@ -18,7 +18,7 @@ #include #include #include - +#include #include #include #include @@ -62,7 +62,7 @@ void EventLoopTest::TearDown() bool RealEventHandler::OnEvent(std::shared_ptr& event) { - printf("OnEvent id:%d sender:%s pid:%d time:%ld. index:%d\n", event->eventId_, event->sender_.c_str(), + printf("OnEvent id:%d sender:%s pid:%d time:%" PRId64 ". index:%d\n", event->eventId_, event->sender_.c_str(), gettid(), time(nullptr), event->what_); lastProcessId_ = event->eventId_; if ((event->what_ % 10) == 0) { // 10 : add delay in processing some event @@ -76,7 +76,7 @@ bool RealEventHandler::OnEvent(std::shared_ptr& event) void RealEventHandler::DoTask() { - printf("RealEventHandler::DoTask pid:%d time:%ld.\n", gettid(), time(nullptr)); + printf("RealEventHandler::DoTask pid:%d time:%" PRId64 ".\n", gettid(), time(nullptr)); processedEventCount_++; } diff --git a/plugins/faultlogger/common/faultlog_util.cpp b/plugins/faultlogger/common/faultlog_util.cpp index 973248f5..fc64a702 100644 --- a/plugins/faultlogger/common/faultlog_util.cpp +++ b/plugins/faultlogger/common/faultlog_util.cpp @@ -59,7 +59,7 @@ std::string GetFormatedTime(uint64_t time) return "00000000000000"; } - auto out = static_cast(time); + auto out = static_cast(time); struct tm tmStruct {0}; struct tm* timeInfo = localtime_r(&out, &tmStruct); if (timeInfo == nullptr) {