diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 17cfda39e0..cfcf5ade41 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -552,7 +552,7 @@ void AddressPromptScreen::CreatePopupContents(UI::ViewGroup *parent) { void AddressPromptScreen::OnCompleted(DialogResult result) { if (result == DR_OK) { - UI::EventParams e; + UI::EventParams e{}; e.v = root_; e.a = addr_; OnChoice.Trigger(e); @@ -655,7 +655,7 @@ void JitCompareScreen::CreateViews() { blockAddr_->OnTextChange.Handle(this, &JitCompareScreen::OnAddressChange); blockStats_ = leftColumn->Add(new TextView("")); - EventParams ignore = {0}; + EventParams ignore{}; OnCurrentBlock(ignore); } diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 3aade7950b..338429431f 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -150,14 +150,14 @@ public: private: void TriggerOnHoldClick() { holdStart_ = 0.0; - UI::EventParams e; + UI::EventParams e{}; e.v = this; e.s = gamePath_; down_ = false; OnHoldClick.Trigger(e); } void TriggerOnHighlight(int focusFlags) { - UI::EventParams e; + UI::EventParams e{}; e.v = this; e.s = gamePath_; e.a = focusFlags; diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index ebeef0da33..7085fb4481 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -242,7 +242,7 @@ static void AfterSaveStateAction(bool status, const std::string &message, void * UI::EventReturn SaveSlotView::OnLoadState(UI::EventParams &e) { g_Config.iCurrentStateSlot = slot_; SaveState::LoadSlot(gamePath_, slot_, &AfterSaveStateAction); - UI::EventParams e2; + UI::EventParams e2{}; e2.v = this; OnStateLoaded.Trigger(e2); return UI::EVENT_DONE; @@ -251,14 +251,14 @@ UI::EventReturn SaveSlotView::OnLoadState(UI::EventParams &e) { UI::EventReturn SaveSlotView::OnSaveState(UI::EventParams &e) { g_Config.iCurrentStateSlot = slot_; SaveState::SaveSlot(gamePath_, slot_, &AfterSaveStateAction); - UI::EventParams e2; + UI::EventParams e2{}; e2.v = this; OnStateSaved.Trigger(e2); return UI::EVENT_DONE; } UI::EventReturn SaveSlotView::OnScreenshotClick(UI::EventParams &e) { - UI::EventParams e2; + UI::EventParams e2{}; e2.v = this; OnScreenshotClicked.Trigger(e2); return UI::EVENT_DONE; diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index a519daa264..fa7ed23316 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -119,7 +119,7 @@ EventReturn RatingChoice::OnChoiceClick(EventParams &e) { } } - EventParams e2; + EventParams e2{}; e2.v = e.v; e2.a = *value_; // Dispatch immediately (we're already on the UI thread as we're in an event handler). diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 86e22824a0..d1d8d83a48 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -330,7 +330,8 @@ void SavedataBrowser::Refresh() { UI::EventReturn SavedataBrowser::SavedataButtonClick(UI::EventParams &e) { SavedataButton *button = static_cast(e.v); - UI::EventParams e2; + UI::EventParams e2{}; + e2.v = e.v; e2.s = button->GamePath(); // Insta-update - here we know we are already on the right thread. OnChoice.Trigger(e2); diff --git a/UI/Store.cpp b/UI/Store.cpp index 3081e5ed1c..1aa35fad36 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -313,7 +313,8 @@ UI::EventReturn ProductView::OnLaunchClick(UI::EventParams &e) { path = ReplaceAll(path, "\\", "/"); #endif - UI::EventParams e2; + UI::EventParams e2{}; + e2.v = e.v; e2.s = path; // Insta-update - here we know we are already on the right thread. OnClickLaunch.Trigger(e2); diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index ba91ec1955..0aeb411a7e 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -237,7 +237,7 @@ bool PopupScreen::touch(const TouchInput &touch) { bool PopupScreen::key(const KeyInput &key) { if (key.flags & KEY_DOWN) { if (key.keyCode == NKCODE_ENTER && defaultButton_) { - UI::EventParams e; + UI::EventParams e{}; defaultButton_->OnClick.Trigger(e); return true; } @@ -414,7 +414,7 @@ void PopupMultiChoice::ChoiceCallback(int num) { *value_ = num + minVal_; UpdateText(); - UI::EventParams e; + UI::EventParams e{}; e.v = this; e.a = num; OnChoice.Trigger(e); @@ -691,8 +691,8 @@ EventReturn SliderFloatPopupScreen::OnTextChange(EventParams ¶ms) { void SliderPopupScreen::OnCompleted(DialogResult result) { if (result == DR_OK) { *value_ = sliderValue_; - EventParams e; - e.v = 0; + EventParams e{}; + e.v = nullptr; e.a = *value_; OnChange.Trigger(e); } @@ -701,8 +701,8 @@ void SliderPopupScreen::OnCompleted(DialogResult result) { void SliderFloatPopupScreen::OnCompleted(DialogResult result) { if (result == DR_OK) { *value_ = sliderValue_; - EventParams e; - e.v = 0; + EventParams e{}; + e.v = nullptr; e.a = (int)*value_; e.f = *value_; OnChange.Trigger(e); @@ -765,7 +765,7 @@ void TextEditPopupScreen::CreatePopupContents(UI::ViewGroup *parent) { void TextEditPopupScreen::OnCompleted(DialogResult result) { if (result == DR_OK) { *value_ = edit_->GetText(); - EventParams e; + EventParams e{}; e.v = edit_; OnChange.Trigger(e); } diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index e7794bd6d7..ad83df69d2 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -234,7 +234,7 @@ bool View::SetFocus() { } void Clickable::Click() { - UI::EventParams e; + UI::EventParams e{}; e.v = this; OnClick.Trigger(e); }; @@ -874,7 +874,8 @@ bool TextEdit::Key(const KeyInput &input) { break; case NKCODE_ENTER: { - EventParams e; + EventParams e{}; + e.v = this; e.s = text_; OnEnter.Trigger(e); break; @@ -955,7 +956,7 @@ bool TextEdit::Key(const KeyInput &input) { } if (textChanged) { - UI::EventParams e; + UI::EventParams e{}; e.v = this; OnTextChange.Trigger(e); } @@ -1071,7 +1072,7 @@ void Slider::Touch(const TouchInput &input) { float relativeX = (input.x - (bounds_.x + paddingLeft_)) / (bounds_.w - paddingLeft_ - paddingRight_); *value_ = floorf(relativeX * (maxValue_ - minValue_) + minValue_ + 0.5f); Clamp(); - EventParams params; + EventParams params{}; params.v = this; params.a = (uint32_t)(*value_); params.f = (float)(*value_); @@ -1183,7 +1184,7 @@ void SliderFloat::Touch(const TouchInput &input) { float relativeX = (input.x - (bounds_.x + paddingLeft_)) / (bounds_.w - paddingLeft_ - paddingRight_); *value_ = (relativeX * (maxValue_ - minValue_) + minValue_); Clamp(); - EventParams params; + EventParams params{}; params.v = this; params.a = (uint32_t)(*value_); params.f = (float)(*value_); diff --git a/ext/native/ui/viewgroup.cpp b/ext/native/ui/viewgroup.cpp index bfc42b7ce0..bd7a25d8c5 100644 --- a/ext/native/ui/viewgroup.cpp +++ b/ext/native/ui/viewgroup.cpp @@ -1212,7 +1212,7 @@ EventReturn ChoiceStrip::OnChoiceClick(EventParams &e) { } } - EventParams e2; + EventParams e2{}; e2.v = views_[selected_]; e2.a = selected_; // Set to 1 to indicate an explicit click. @@ -1232,7 +1232,7 @@ void ChoiceStrip::SetSelection(int sel) { newChoice->Press(); if (topTabs_ && prevSelected != selected_) { - EventParams e; + EventParams e{}; e.v = views_[selected_]; e.a = selected_; // Set to 0 to indicate a selection change (not a click.) @@ -1305,8 +1305,8 @@ void ListView::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) } EventReturn ListView::OnItemCallback(int num, EventParams &e) { - EventParams ev; - ev.v = 0; + EventParams ev{}; + ev.v = nullptr; ev.a = num; adaptor_->SetSelected(num); View *focused = GetFocusedView();