From 96fdbc412042917bebfcd6985faf74669d4594e1 Mon Sep 17 00:00:00 2001 From: niulihua Date: Tue, 25 Jan 2022 23:27:37 -0800 Subject: [PATCH] modify for compile warning Signed-off-by: niulihua Change-Id: Ie110e8c8bb3a79f2cf1d74653eeaebba6a95d7f3 --- frameworks/graphic_timer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 frameworks/graphic_timer.cpp 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;