diff --git a/launcher/launcher/src/main/cpp/app_manage.h b/launcher/launcher/src/main/cpp/app_manage.h index ae8c4a8d206e743cdc9adc6f30cedfc89e78b382..bd4da448d0c50eda736b01cc7b2192fc4c2cf713 100755 --- a/launcher/launcher/src/main/cpp/app_manage.h +++ b/launcher/launcher/src/main/cpp/app_manage.h @@ -38,7 +38,7 @@ public: bool InstallApp(AppInfo* app); bool UnInstallApp(AppInfo* app); bool StartApp(AppInfo* app); - static void SetViewGroup(funcClick click, funcLongPress press, ViewGroupPage* arrPage[MAX_VIEWGROUP], int size); + static void SetViewGroup(funcClick click, funcLongPress press, ViewGroupPage* viewPage[MAX_VIEWGROUP], int size); private: static void MyBundleStateCallback(const uint8_t installType, const uint8_t resultCode, const void* resultMessage, diff --git a/launcher/launcher/src/main/cpp/event_listener.h b/launcher/launcher/src/main/cpp/event_listener.h index 144610a3643466c54076c0a637788989596c2d84..1a7910f2938baac7b5a3f0815fd844428dc2ef56 100755 --- a/launcher/launcher/src/main/cpp/event_listener.h +++ b/launcher/launcher/src/main/cpp/event_listener.h @@ -29,10 +29,7 @@ public: ~EventListener() override = default; EventListener(OnEventFunc onClick, OnEventFunc onLongPress) - { - onClick_ = std::move(onClick); - onLongPress_ = std::move(onLongPress); - } + : onClick_(std::move(onClick)), onLongPress_(std::move(onLongPress)) {} bool OnClick(UIView& view, const ClickEvent& event) override { diff --git a/launcher/launcher/src/main/cpp/long_press_view.cpp b/launcher/launcher/src/main/cpp/long_press_view.cpp index 89720f982f4b3635eeb92c7b9d3e0ff4b1928751..77116d734f0c7b62796e7ea1da562c74f318aa96 100755 --- a/launcher/launcher/src/main/cpp/long_press_view.cpp +++ b/launcher/launcher/src/main/cpp/long_press_view.cpp @@ -92,8 +92,6 @@ bool LongPressView::OnClick(UIView& view, const ClickEvent& event) if (currentView == nullptr) { return false; } - UILabelButton* lbutt = nullptr; - lbutt = static_cast(currentView); RemoveLview(); if (currentView == buttUninstall_) { uninstall_(app_); diff --git a/launcher/launcher/src/main/cpp/swipe_view.h b/launcher/launcher/src/main/cpp/swipe_view.h index 6034ae823be0e7dba9dd15b4761846af5c342bdc..03147d20a6a6ec0d7cc0da93c803634645052c4e 100755 --- a/launcher/launcher/src/main/cpp/swipe_view.h +++ b/launcher/launcher/src/main/cpp/swipe_view.h @@ -81,10 +81,10 @@ public: void InstallApp(AppInfo* app); void Callback() override { - char tmp[TMP_BUF_SIZE] = { 0 }; time_t t = time(nullptr); struct tm* st = localtime(&t); if (st != nullptr) { + char tmp[TMP_BUF_SIZE] = {0}; int ret = sprintf_s(tmp, sizeof(tmp), "%02d : %02d", st->tm_hour, st->tm_min); if (ret != LAUNCHER_PARAMERROR) { lableTitle_->SetText(tmp); diff --git a/launcher/launcher/src/main/cpp/time_weather_view.h b/launcher/launcher/src/main/cpp/time_weather_view.h index 3259e668d4f370b5a6c9fa5f2bd58b3b92c84735..1aeb488457692a933f7d04f26084f6adaab1fce9 100755 --- a/launcher/launcher/src/main/cpp/time_weather_view.h +++ b/launcher/launcher/src/main/cpp/time_weather_view.h @@ -43,7 +43,7 @@ public: explicit TimeWeatherView(UIViewGroup* viewGroup); virtual ~TimeWeatherView(); void SetStyle(Style sty); - void SetPosion(int16_t width, int16_t height, int16_t x, int16_t y); + void SetPosion(int16_t x, int16_t y, int16_t height, int16_t width); void SetUpView(); void SetUpTimeView(); diff --git a/launcher/launcher/src/main/cpp/view_group_page.h b/launcher/launcher/src/main/cpp/view_group_page.h index b4d29d53d5cbdac82090fdced68b19357c987fa3..3f02979c9a0ce73637f2b0ecb8ffb5d9446c7951 100755 --- a/launcher/launcher/src/main/cpp/view_group_page.h +++ b/launcher/launcher/src/main/cpp/view_group_page.h @@ -33,8 +33,8 @@ public: virtual ~ViewGroupPage(); void SetMatrix(int16_t rows, int16_t cols); bool AddApp(AppInfo* pAppInfo); - bool RemoveApp(const char* appName); - bool FindApp(AppInfo* pAppInfo); + bool RemoveApp(const char* pAppName); + bool FindApp(AppInfo* pApp); void SetScale(double scale); protected: diff --git a/setting/setting/src/main/cpp/app_ability_slice.cpp b/setting/setting/src/main/cpp/app_ability_slice.cpp index da1c662fb187dd492003c7ee973b987dba492b3e..c15a14ec089cef71e7ba2be49e4dbadfb8cd9352 100755 --- a/setting/setting/src/main/cpp/app_ability_slice.cpp +++ b/setting/setting/src/main/cpp/app_ability_slice.cpp @@ -117,9 +117,6 @@ void AppAbilitySlice::SetAnAppInfo(const int count, BundleInfo& pBundleInfo) printf("[ERROR]strcpy_s pBundleInfo.bundleName failed, err = %d\n", err); return; } - for (size_t i = 0; i < strlen(pBundleInfo.bundleName); i++) { - buff[i] = pBundleInfo.bundleName[i]; - } SetAppButtonListener(pBundleInfo.bundleName); itemView->SetOnClickListener(buttonAppInfoListener_); scrollView_->Add(itemView); diff --git a/setting/setting/src/main/cpp/app_info_ability_slice.h b/setting/setting/src/main/cpp/app_info_ability_slice.h index b1a6e80a79fc5bddbb412e267d6b28178281646f..4520ad6dae118e93a8db8707ac32400f42d4c1b3 100755 --- a/setting/setting/src/main/cpp/app_info_ability_slice.h +++ b/setting/setting/src/main/cpp/app_info_ability_slice.h @@ -123,7 +123,7 @@ private: void PermissionInfoList(); void SetAppPermissionInfo(int index, PermissionSaved& permissions); - char bundleName_[128]; + char bundleName_[128] = {0}; }; } // namespace OHOS diff --git a/setting/setting/src/main/cpp/event_listener.h b/setting/setting/src/main/cpp/event_listener.h index 980df14f6e37edb9e432fd3f9a055346d330c688..51f181ef076d3b7af18cd4d23e03c348319752cd 100755 --- a/setting/setting/src/main/cpp/event_listener.h +++ b/setting/setting/src/main/cpp/event_listener.h @@ -30,10 +30,7 @@ public: ~EventListener() override = default; EventListener(OnEventFunc onClick, OnEventFunc onLongPress) - { - onClick_ = std::move(onClick); - onLongPress_ = std::move(onLongPress); - } + : onClick_(std::move(onClick)), onLongPress_(std::move(onLongPress)) {} bool OnClick(UIView& view, const ClickEvent &event) override { diff --git a/setting/setting/src/main/cpp/wpa_work.c b/setting/setting/src/main/cpp/wpa_work.c index a3170e8b927cbddfefd82e1dfa527d0b2f907602..ac6401064509f18ba6bcba4c248317d73b158045 100755 --- a/setting/setting/src/main/cpp/wpa_work.c +++ b/setting/setting/src/main/cpp/wpa_work.c @@ -464,10 +464,9 @@ int InitControlInterface() void* WpaScanThread(void *args) { int mySleep = 2; - int ret = 0; sleep(mySleep); if (g_monitorConn == NULL) { - ret = InitControlInterface(); + int ret = InitControlInterface(); printf("%s:%d [INFO] InitControlInterface return %d.\n", __FUNCTION__, __LINE__, ret); if (ret == -1) { return NULL;