diff --git a/Source/Core/Common/IniFile.cpp b/Source/Core/Common/IniFile.cpp index 413c5dc82bad..f94e62ebfac8 100644 --- a/Source/Core/Common/IniFile.cpp +++ b/Source/Core/Common/IniFile.cpp @@ -203,7 +203,7 @@ IniFile::Section* IniFile::GetOrCreateSection(const std::string& sectionName) Section* section = GetSection(sectionName); if (!section) { - sections.push_back(Section(sectionName)); + sections.emplace_back(sectionName); section = §ions.back(); } return section; diff --git a/Source/Core/Common/NandPaths.cpp b/Source/Core/Common/NandPaths.cpp index 7428ff2449bd..651fde7569d7 100644 --- a/Source/Core/Common/NandPaths.cpp +++ b/Source/Core/Common/NandPaths.cpp @@ -101,7 +101,7 @@ void ReadReplacements(replace_v& replacements) std::string replacement; while (f >> letter >> replacement && replacement.size()) - replacements.push_back(std::make_pair(letter, replacement)); + replacements.emplace_back(letter, replacement); } } diff --git a/Source/Core/Core/DSP/LabelMap.cpp b/Source/Core/Core/DSP/LabelMap.cpp index 57931a76db68..97a809283129 100644 --- a/Source/Core/Core/DSP/LabelMap.cpp +++ b/Source/Core/Core/DSP/LabelMap.cpp @@ -33,7 +33,7 @@ void LabelMap::RegisterLabel(const std::string &label, u16 lval, LabelType type) label.c_str(), lval, old_value); DeleteLabel(label); } - labels.push_back(label_t(label, lval, type)); + labels.emplace_back(label, lval, type); } void LabelMap::DeleteLabel(const std::string &label) diff --git a/Source/Core/Core/HW/GCMemcardDirectory.cpp b/Source/Core/Core/HW/GCMemcardDirectory.cpp index a01f70bad106..d3ffa768b58f 100644 --- a/Source/Core/Core/HW/GCMemcardDirectory.cpp +++ b/Source/Core/Core/HW/GCMemcardDirectory.cpp @@ -434,7 +434,7 @@ inline s32 GCMemcardDirectory::SaveAreaRW(u32 block, bool writing) int num_blocks = BE16(m_saves[i].m_gci_header.BlockCount); while (num_blocks) { - m_saves[i].m_save_data.push_back(GCMBlock()); + m_saves[i].m_save_data.emplace_back(); num_blocks--; } } diff --git a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp index d762d9e7c12e..c3dfafdc4415 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/JitIL.cpp @@ -186,7 +186,7 @@ namespace JitILProfiler static Block& Add(u64 codeHash) { const u32 _blockIndex = (u32)blocks.size(); - blocks.push_back(Block()); + blocks.emplace_back(); Block& block = blocks.back(); block.index = _blockIndex; block.codeHash = codeHash; diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index d3ad76673398..9d3a04f768dd 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -153,7 +153,7 @@ namespace JitInterface u64 timecost = block->ticCounter; // Todo: tweak. if (block->runCount >= 1) - stats.push_back(BlockStat(i, cost)); + stats.emplace_back(i, cost); cost_sum += cost; timecost_sum += timecost; } diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 97b81f4118df..17c8c7f98e89 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -175,7 +175,7 @@ bool AnalyzeFunction(u32 startAddr, Symbol &func, int max_size) if (target != INVALID_TARGET && instr.LK) { //we found a branch-n-link! - func.calls.push_back(SCall(target,addr)); + func.calls.emplace_back(target, addr); func.flags &= ~FFLAG_LEAF; } } diff --git a/Source/Core/DolphinWX/ARCodeAddEdit.cpp b/Source/Core/DolphinWX/ARCodeAddEdit.cpp index 0206c2634cec..a1ebf4e6c9c8 100644 --- a/Source/Core/DolphinWX/ARCodeAddEdit.cpp +++ b/Source/Core/DolphinWX/ARCodeAddEdit.cpp @@ -113,7 +113,7 @@ void CARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED (event)) u32 addr = std::stoul(pieces[0], nullptr, 16); u32 value = std::stoul(pieces[1], nullptr, 16); - decryptedLines.push_back(ActionReplay::AREntry(addr, value)); + decryptedLines.emplace_back(addr, value); continue; } else if (pieces.size() == 1) diff --git a/Source/Core/DolphinWX/PatchAddEdit.cpp b/Source/Core/DolphinWX/PatchAddEdit.cpp index 9a403ff8f91d..6b02f252e040 100644 --- a/Source/Core/DolphinWX/PatchAddEdit.cpp +++ b/Source/Core/DolphinWX/PatchAddEdit.cpp @@ -48,7 +48,7 @@ void CPatchAddEdit::CreateGUIControls(int _selection) if (_selection == -1) { tempEntries.clear(); - tempEntries.push_back(PatchEngine::PatchEntry(PatchEngine::PATCH_8BIT, 0x00000000, 0x00000000)); + tempEntries.emplace_back(PatchEngine::PATCH_8BIT, 0x00000000, 0x00000000); } else { diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.cpp b/Source/Core/VideoCommon/FramebufferManagerBase.cpp index 178a157f9a0c..f928fec9797d 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.cpp +++ b/Source/Core/VideoCommon/FramebufferManagerBase.cpp @@ -128,9 +128,7 @@ void FramebufferManagerBase::CopyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHe if (m_virtualXFBList.size() < MAX_VIRTUAL_XFB) { // create a new Virtual XFB and place it at the front of the list - VirtualXFB v; - memset(&v, 0, sizeof v); - m_virtualXFBList.push_front(v); + m_virtualXFBList.emplace_front(); vxfb = m_virtualXFBList.begin(); } else diff --git a/Source/Core/VideoCommon/FramebufferManagerBase.h b/Source/Core/VideoCommon/FramebufferManagerBase.h index 661cfb7f3104..03581468f782 100644 --- a/Source/Core/VideoCommon/FramebufferManagerBase.h +++ b/Source/Core/VideoCommon/FramebufferManagerBase.h @@ -57,14 +57,16 @@ class FramebufferManagerBase protected: struct VirtualXFB { - VirtualXFB() : xfbSource(nullptr) {} + VirtualXFB() + { + } // Address and size in GameCube RAM - u32 xfbAddr; - u32 xfbWidth; - u32 xfbHeight; + u32 xfbAddr = 0; + u32 xfbWidth = 0; + u32 xfbHeight = 0; - XFBSourceBase *xfbSource; + XFBSourceBase* xfbSource = nullptr; }; typedef std::list VirtualXFBListType; diff --git a/Source/Core/VideoCommon/PostProcessing.cpp b/Source/Core/VideoCommon/PostProcessing.cpp index c299d41b155a..2d4290fbe6e6 100644 --- a/Source/Core/VideoCommon/PostProcessing.cpp +++ b/Source/Core/VideoCommon/PostProcessing.cpp @@ -129,7 +129,7 @@ void PostProcessingShaderConfiguration::LoadOptions(const std::string& code) IniFile::ParseLine(line, &key, &value); if (!(key == "" && value == "")) - current_strings->m_options.push_back(std::make_pair(key, value)); + current_strings->m_options.emplace_back(key, value); } } }