diff --git a/frameworks/graphic_timer.cpp b/frameworks/graphic_timer.cpp old mode 100644 new mode 100755 index 0023823..5ee3ae7 --- a/frameworks/graphic_timer.cpp +++ b/frameworks/graphic_timer.cpp @@ -22,14 +22,17 @@ #include #include #include +#include "securec.h" #endif namespace { -#ifndef _WIN32 +#ifdef _WIN32 +constexpr int32_t HUNDRED_NS_PER_MS = 10000; +#elif defined(_LITEOS) +#else constexpr int16_t MS_PER_SECOND = 1000; constexpr int32_t NS_PER_MS = 1000000; #endif -constexpr int32_t HUNDRED_NS_PER_MS = 10000; } // namespace namespace OHOS { @@ -212,7 +215,8 @@ GraphicTimer::GraphicTimer(int32_t periodMs, GraphicTimerCb cb, void* arg, bool return; } - struct sigevent sev = {0}; + struct sigevent sev; + (void)memset_s(&sev, sizeof(sev), 0, sizeof(sev)); sev.sigev_notify = SIGEV_THREAD; sev.sigev_notify_function = TimerCallback; sev.sigev_value.sival_ptr = this;