From b05a4ae30acd80ff2c4077ac85f90fb585afb582 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Sat, 11 May 2024 09:52:53 +0000 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20!148=20:?= =?UTF-8?q?=20applications=5Fsample=5Fcamera=E9=83=A8=E4=BB=B6=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E6=95=B4=E6=94=B9=E4=B8=BB=E5=B9=B2=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E6=B6=88=E9=99=A4'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/cpp/time_weather_view.cpp | 24 ++++++++++++++----- setting/setting/src/main/cpp/wpa_work.c | 8 +++---- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/launcher/launcher/src/main/cpp/time_weather_view.cpp b/launcher/launcher/src/main/cpp/time_weather_view.cpp index c855bde..2d6699e 100755 --- a/launcher/launcher/src/main/cpp/time_weather_view.cpp +++ b/launcher/launcher/src/main/cpp/time_weather_view.cpp @@ -63,14 +63,22 @@ void TimeWeatherView::SetUpTimeView() const int16_t commonYear = 1970; time_t t = time(nullptr); struct tm* st = localtime(&t); - if (st == nullptr) { return; } + if (st == nullptr) { + return; + } int ret = sprintf_s(hour_min, sizeof(hour_min), "%02d : %02d", st->tm_hour, st->tm_min); - if (ret == LAUNCHER_PARAMERROR) { return; } + if (ret == LAUNCHER_PARAMERROR) { + return; + } ret = sprintf_s(mont_day, sizeof(mont_day), "%02d月%02d日", st->tm_mon + january, st->tm_mday); - if (ret == LAUNCHER_PARAMERROR) { return; } + if (ret == LAUNCHER_PARAMERROR) { + return; + } GetWeekdayByYearday(st->tm_year + commonYear, st->tm_mon + january, st->tm_mday, week_day, sizeof(week_day)); ret = sprintf_s(date, sizeof(date), "%s %s", mont_day, week_day); - if (ret == LAUNCHER_PARAMERROR) { return; } + if (ret == LAUNCHER_PARAMERROR) { + return; + } if (viewTime_ == nullptr) { viewTime_ = new UIViewGroup(); viewTime_->SetPosition(BLANK_TW, BLANK_H, viewGroup_->GetWidth() - BLANK_W, @@ -103,9 +111,13 @@ void TimeWeatherView::SetUpTimeView() } else { UILabel* label = nullptr; label = static_cast(viewTime_->GetChildById("labletime")); - if (label) { label->SetText(hour_min); } + if (label) { + label->SetText(hour_min); + } label = static_cast(viewTime_->GetChildById("labledate")); - if (label) { label->SetText(date); } + if (label) { + label->SetText(date); + } viewTime_->Invalidate(); } } diff --git a/setting/setting/src/main/cpp/wpa_work.c b/setting/setting/src/main/cpp/wpa_work.c index 7f93487..140c15f 100755 --- a/setting/setting/src/main/cpp/wpa_work.c +++ b/setting/setting/src/main/cpp/wpa_work.c @@ -316,7 +316,7 @@ static void CliRecvPending(void) { int pendingResult = -1; pthread_mutex_lock(&g_monitorConnMutex); - if (g_monitorConn != NULL) { + if (g_monitorConn!= NULL) { pendingResult = wpa_ctrl_pending(g_monitorConn); } while (pendingResult > 0) { @@ -433,7 +433,7 @@ int InitControlInterface() ret = -1; pthread_mutex_lock(&g_monitorConnMutex); - if (g_monitorConn != NULL) { + if (g_monitorConn!= NULL) { ret = wpa_ctrl_attach(g_monitorConn); } pthread_mutex_unlock(&g_monitorConnMutex); @@ -489,8 +489,8 @@ static void *ThreadMain() char argstr1[] = "/storage/app/run/com.huawei.setting/setting/assets"; char argstr2[] = "/setting/resources/base/element/wpa_supplicant.conf"; char argstr[120]; - strcpy_s(argstr, strlen(argstr1) + 1, argstr1); - strcat_s(argstr, strlen(argstr2) + 1, argstr2); + strcpy(argstr, argstr1); + strcat(argstr, argstr2); arg[i] = (char *)"wpa_supplicant"; arg[++i] = (char *)"-i"; arg[++i] = (char *)"wlan0"; -- Gitee