From 83b8b23e409cbd8839c937663605d875b3961d63 Mon Sep 17 00:00:00 2001 From: Chin Date: Wed, 24 Dec 2014 18:12:57 -0500 Subject: [PATCH 1/5] Remove a useless switch --- ext/disarm.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/ext/disarm.cpp b/ext/disarm.cpp index 17cf072410..7cc829a354 100644 --- a/ext/disarm.cpp +++ b/ext/disarm.cpp @@ -599,15 +599,10 @@ static bool DisasmNeonF2F3(uint32_t op, char *text) { } return DisasmArithNeon(op, opname, text, includeSuffix); case 0x31: - temp = (op >> 4) & 0xF1; - switch (temp) { - default: - if (op & 0x100) - opname = "MLS"; - else - opname = "SUB"; - break; - } + if (op & 0x100) + opname = "MLS"; + else + opname = "SUB"; return DisasmArithNeon(op, opname, text); case 0x30: case 0x34: From 294ade904c5704d1db74f22e7c41d6406d9bccc6 Mon Sep 17 00:00:00 2001 From: Chin Date: Wed, 24 Dec 2014 18:34:33 -0500 Subject: [PATCH 2/5] Remove some unused variables --- UI/GameSettingsScreen.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 45523df287..98dab6f4fc 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -513,7 +513,6 @@ void GameSettingsScreen::CreateViews() { const HRESULT result = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, myDocumentsPath); const std::string PPSSPPpath = File::GetExeDirectory(); const std::string installedFile = PPSSPPpath + "installed.txt"; - const std::string path = File::GetExeDirectory(); installed_ = File::Exists(installedFile); otherinstalled_ = false; if (!installed_ && result == S_OK) { @@ -658,10 +657,8 @@ UI::EventReturn GameSettingsScreen::OnJitAffectingSetting(UI::EventParams &e) { UI::EventReturn GameSettingsScreen::OnSavePathMydoc(UI::EventParams &e) { const std::string PPSSPPpath = File::GetExeDirectory(); const std::string installedFile = PPSSPPpath + "installed.txt"; - const std::string path = File::GetExeDirectory(); installed_ = File::Exists(installedFile); if (otherinstalled_) { - const std::string PPSSPPpath = File::GetExeDirectory(); File::Delete(PPSSPPpath + "installed.txt"); File::CreateEmptyFile(PPSSPPpath + "installed.txt"); otherinstalled_ = false; From ff5d408c810e46c6dfbdaf5035ea6e472e6c8c52 Mon Sep 17 00:00:00 2001 From: Chin Date: Wed, 24 Dec 2014 18:48:35 -0500 Subject: [PATCH 3/5] Combine two ifs --- Core/HLE/sceAtrac.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 74c68188f6..19dcd64162 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -2148,9 +2148,8 @@ static int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesCo if (avret < 0) { ERROR_LOG(ME, "swr_convert: Error while converting %d", avret); } + break; } - if (res == ATDECODE_GOTFRAME) - break; } } From 37f50a37925244ddea56e5a3039a839ba8fb2d06 Mon Sep 17 00:00:00 2001 From: Chin Date: Wed, 24 Dec 2014 21:42:41 -0500 Subject: [PATCH 4/5] Change to pass some arguments by reference --- Core/CwCheat.cpp | 2 +- Core/Dialog/PSPOskDialog.cpp | 4 ++-- Core/Dialog/PSPOskDialog.h | 2 +- Core/Dialog/SavedataParam.cpp | 6 +++--- Core/Dialog/SavedataParam.h | 6 +++--- Core/MIPS/x86/Jit.cpp | 2 +- Core/MIPS/x86/Jit.h | 2 +- Core/MIPS/x86/JitSafeMem.cpp | 2 +- Core/MIPS/x86/JitSafeMem.h | 4 ++-- Core/MIPS/x86/RegCache.cpp | 2 +- Core/MIPS/x86/RegCache.h | 2 +- Core/MIPS/x86/RegCacheFPU.cpp | 2 +- Core/MIPS/x86/RegCacheFPU.h | 2 +- Core/MemMap.cpp | 2 +- Core/MemMap.h | 2 +- GPU/Common/SplineCommon.cpp | 4 ++-- headless/Compare.cpp | 2 +- headless/Compare.h | 2 +- 18 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index b1a5940aae..63b6954d18 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -131,7 +131,7 @@ void CWCheatEngine::Exit() { exit2 = true; } -static inline std::vector makeCodeParts(const std::vector CodesList) { //Takes a single code line and creates a two-part vector for each code. Feeds to CreateCodeList +static inline std::vector makeCodeParts(const std::vector& CodesList) { //Takes a single code line and creates a two-part vector for each code. Feeds to CreateCodeList std::string currentcode; std::vector finalList; char split_char = '\n'; diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index b1a95a4a73..e07668a9e5 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -152,7 +152,7 @@ PSPOskDialog::PSPOskDialog() : PSPDialog() { PSPOskDialog::~PSPOskDialog() { } -void PSPOskDialog::ConvertUCS2ToUTF8(std::string& _string, const PSPPointer em_address) +void PSPOskDialog::ConvertUCS2ToUTF8(std::string& _string, const PSPPointer& em_address) { if (!em_address.IsValid()) { @@ -182,7 +182,7 @@ void PSPOskDialog::ConvertUCS2ToUTF8(std::string& _string, const PSPPointer em_address) +void GetWideStringFromPSPPointer(std::wstring& _string, const PSPPointer& em_address) { if (!em_address.IsValid()) { diff --git a/Core/Dialog/PSPOskDialog.h b/Core/Dialog/PSPOskDialog.h index dd4850f809..fa0ce88a6a 100644 --- a/Core/Dialog/PSPOskDialog.h +++ b/Core/Dialog/PSPOskDialog.h @@ -217,7 +217,7 @@ protected: } private: - void ConvertUCS2ToUTF8(std::string& _string, const PSPPointer em_address); + void ConvertUCS2ToUTF8(std::string& _string, const PSPPointer& em_address); void ConvertUCS2ToUTF8(std::string& _string, const wchar_t *input); void RenderKeyboard(); #if defined(USING_WIN_UI) diff --git a/Core/Dialog/SavedataParam.cpp b/Core/Dialog/SavedataParam.cpp index 3bbbf3961c..e9a6821ac8 100644 --- a/Core/Dialog/SavedataParam.cpp +++ b/Core/Dialog/SavedataParam.cpp @@ -579,7 +579,7 @@ bool SavedataParam::Load(SceUtilitySavedataParam *param, const std::string &save return true; } -bool SavedataParam::LoadSaveData(SceUtilitySavedataParam *param, const std::string &saveDirName, const std::string dirPath, bool secureMode) { +bool SavedataParam::LoadSaveData(SceUtilitySavedataParam *param, const std::string &saveDirName, const std::string& dirPath, bool secureMode) { u8 *data_ = param->dataBuf; std::string filePath = dirPath+"/"+GetFileName(param); s64 readSize; @@ -668,7 +668,7 @@ void SavedataParam::LoadNotCryptedSave(SceUtilitySavedataParam *param, u8 *data, memcpy(data, saveData, std::min((u32)saveSize, (u32)param->dataBufSize)); } -void SavedataParam::LoadSFO(SceUtilitySavedataParam *param, const std::string dirPath) { +void SavedataParam::LoadSFO(SceUtilitySavedataParam *param, const std::string& dirPath) { ParamSFOData sfoFile; std::string sfopath = dirPath+"/" + SFO_FILENAME; PSPFileInfo sfoInfo = pspFileSystem.GetFileInfo(sfopath); @@ -720,7 +720,7 @@ std::set SavedataParam::getSecureFileNames(std::string dirPath) { return secureFileNames; } -void SavedataParam::LoadFile(const std::string dirPath, const std::string filename, PspUtilitySavedataFileData *fileData) { +void SavedataParam::LoadFile(const std::string& dirPath, const std::string& filename, PspUtilitySavedataFileData *fileData) { std::string filePath = dirPath + "/" + filename; s64 readSize = -1; if(!fileData->buf.IsValid()) diff --git a/Core/Dialog/SavedataParam.h b/Core/Dialog/SavedataParam.h index 0dc0aaae57..be8c679305 100644 --- a/Core/Dialog/SavedataParam.h +++ b/Core/Dialog/SavedataParam.h @@ -354,11 +354,11 @@ private: void SetFileInfo(SaveFileInfo &saveInfo, PSPFileInfo &info, std::string saveName); void ClearFileInfo(SaveFileInfo &saveInfo, std::string saveName); - bool LoadSaveData(SceUtilitySavedataParam *param, const std::string &saveDirName, const std::string dirPath, bool secureMode); + bool LoadSaveData(SceUtilitySavedataParam *param, const std::string &saveDirName, const std::string& dirPath, bool secureMode); void LoadCryptedSave(SceUtilitySavedataParam *param, u8 *data, u8 *saveData, int &saveSize, int prevCryptMode, bool &saveDone); void LoadNotCryptedSave(SceUtilitySavedataParam *param, u8 *data, u8 *saveData, int &saveSize); - void LoadSFO(SceUtilitySavedataParam *param, const std::string dirPath); - void LoadFile(const std::string dirPath, const std::string filename, PspUtilitySavedataFileData *fileData); + void LoadSFO(SceUtilitySavedataParam *param, const std::string& dirPath); + void LoadFile(const std::string& dirPath, const std::string& filename, PspUtilitySavedataFileData *fileData); int DecryptSave(unsigned int mode, unsigned char *data, int *dataLen, int *alignedLen, unsigned char *cryptkey); int EncryptData(unsigned int mode, unsigned char *data, int *dataLen, int *alignedLen, unsigned char *hash, unsigned char *cryptkey); diff --git a/Core/MIPS/x86/Jit.cpp b/Core/MIPS/x86/Jit.cpp index 6fd834f6b9..946d9592f7 100644 --- a/Core/MIPS/x86/Jit.cpp +++ b/Core/MIPS/x86/Jit.cpp @@ -183,7 +183,7 @@ void Jit::GetStateAndFlushAll(RegCacheState &state) FlushAll(); } -void Jit::RestoreState(const RegCacheState state) +void Jit::RestoreState(const RegCacheState& state) { gpr.RestoreState(state.gpr); fpr.RestoreState(state.fpr); diff --git a/Core/MIPS/x86/Jit.h b/Core/MIPS/x86/Jit.h index a4b8c8cfa4..3e3b20b6ec 100644 --- a/Core/MIPS/x86/Jit.h +++ b/Core/MIPS/x86/Jit.h @@ -187,7 +187,7 @@ public: private: void GetStateAndFlushAll(RegCacheState &state); - void RestoreState(const RegCacheState state); + void RestoreState(const RegCacheState& state); void FlushAll(); void FlushPrefixV(); void WriteDowncount(int offset = 0); diff --git a/Core/MIPS/x86/JitSafeMem.cpp b/Core/MIPS/x86/JitSafeMem.cpp index 3141fb892d..481f1524a0 100644 --- a/Core/MIPS/x86/JitSafeMem.cpp +++ b/Core/MIPS/x86/JitSafeMem.cpp @@ -234,7 +234,7 @@ bool JitSafeMem::PrepareSlowWrite() return false; } -void JitSafeMem::DoSlowWrite(const void *safeFunc, const OpArg src, int suboffset) +void JitSafeMem::DoSlowWrite(const void *safeFunc, const OpArg& src, int suboffset) { if (iaddr_ != (u32) -1) jit_->MOV(32, R(EAX), Imm32((iaddr_ + suboffset) & alignMask_)); diff --git a/Core/MIPS/x86/JitSafeMem.h b/Core/MIPS/x86/JitSafeMem.h index 908b146591..58885ca58e 100644 --- a/Core/MIPS/x86/JitSafeMem.h +++ b/Core/MIPS/x86/JitSafeMem.h @@ -36,9 +36,9 @@ public: // Emit code proceeding a slow write call, returns true if slow write is needed. bool PrepareSlowWrite(); // Emit a slow write from src. - void DoSlowWrite(const void *safeFunc, const Gen::OpArg src, int suboffset = 0); + void DoSlowWrite(const void *safeFunc, const Gen::OpArg& src, int suboffset = 0); template - void DoSlowWrite(void (*safeFunc)(T val, u32 addr), const Gen::OpArg src, int suboffset = 0) { + void DoSlowWrite(void (*safeFunc)(T val, u32 addr), const Gen::OpArg& src, int suboffset = 0) { DoSlowWrite((const void *)safeFunc, src, suboffset); } diff --git a/Core/MIPS/x86/RegCache.cpp b/Core/MIPS/x86/RegCache.cpp index 933bbb2765..31b4fc4924 100644 --- a/Core/MIPS/x86/RegCache.cpp +++ b/Core/MIPS/x86/RegCache.cpp @@ -396,7 +396,7 @@ void GPRRegCache::GetState(GPRRegCacheState &state) const { memcpy(state.xregs, xregs, sizeof(xregs)); } -void GPRRegCache::RestoreState(const GPRRegCacheState state) { +void GPRRegCache::RestoreState(const GPRRegCacheState& state) { memcpy(regs, state.regs, sizeof(regs)); memcpy(xregs, state.xregs, sizeof(xregs)); } diff --git a/Core/MIPS/x86/RegCache.h b/Core/MIPS/x86/RegCache.h index c63d129fde..e13f257aec 100644 --- a/Core/MIPS/x86/RegCache.h +++ b/Core/MIPS/x86/RegCache.h @@ -112,7 +112,7 @@ public: u32 GetImm(MIPSGPReg preg) const; void GetState(GPRRegCacheState &state) const; - void RestoreState(const GPRRegCacheState state); + void RestoreState(const GPRRegCacheState& state); MIPSState *mips; diff --git a/Core/MIPS/x86/RegCacheFPU.cpp b/Core/MIPS/x86/RegCacheFPU.cpp index c3aa9e20d4..648a63b13a 100644 --- a/Core/MIPS/x86/RegCacheFPU.cpp +++ b/Core/MIPS/x86/RegCacheFPU.cpp @@ -1066,7 +1066,7 @@ void FPURegCache::GetState(FPURegCacheState &state) const { memcpy(state.xregs, xregs, sizeof(xregs)); } -void FPURegCache::RestoreState(const FPURegCacheState state) { +void FPURegCache::RestoreState(const FPURegCacheState& state) { memcpy(regs, state.regs, sizeof(regs)); memcpy(xregs, state.xregs, sizeof(xregs)); pendingFlush = true; diff --git a/Core/MIPS/x86/RegCacheFPU.h b/Core/MIPS/x86/RegCacheFPU.h index 6c48473942..9d6ad0d91a 100644 --- a/Core/MIPS/x86/RegCacheFPU.h +++ b/Core/MIPS/x86/RegCacheFPU.h @@ -206,7 +206,7 @@ public: void SimpleRegV(const u8 v, int flags); void GetState(FPURegCacheState &state) const; - void RestoreState(const FPURegCacheState state); + void RestoreState(const FPURegCacheState& state); MIPSState *mips; diff --git a/Core/MemMap.cpp b/Core/MemMap.cpp index 6dbac1777e..16b7ee583c 100644 --- a/Core/MemMap.cpp +++ b/Core/MemMap.cpp @@ -480,7 +480,7 @@ Opcode Read_Opcode_JIT(u32 address) // WARNING! No checks! // We assume that _Address is cached -void Write_Opcode_JIT(const u32 _Address, const Opcode _Value) +void Write_Opcode_JIT(const u32 _Address, const Opcode& _Value) { Memory::WriteUnchecked_U32(_Value.encoding, _Address); } diff --git a/Core/MemMap.h b/Core/MemMap.h index 7af28ab061..2064bdaa90 100644 --- a/Core/MemMap.h +++ b/Core/MemMap.h @@ -141,7 +141,7 @@ MemoryInitedLock Lock(); // used by JIT to read instructions. Does not resolve replacements. Opcode Read_Opcode_JIT(const u32 _Address); // used by JIT. Reads in the "Locked cache" mode -void Write_Opcode_JIT(const u32 _Address, const Opcode _Value); +void Write_Opcode_JIT(const u32 _Address, const Opcode& _Value); // Should be used by analyzers, disassemblers etc. Does resolve replacements. Opcode Read_Instruction(const u32 _Address, bool resolveReplacements = false); diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index 4884fc7166..f118930a68 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -121,13 +121,13 @@ inline float bern2deriv(float x) { return 3 * (2 - 3 * x) * x; } inline float bern3deriv(float x) { return 3 * x * x; } // http://en.wikipedia.org/wiki/Bernstein_polynomial -static Vec3Packedf Bernstein3D(const Vec3Packedf p0, const Vec3Packedf p1, const Vec3Packedf p2, const Vec3Packedf p3, float x) { +static Vec3Packedf Bernstein3D(const Vec3Packedf& p0, const Vec3Packedf& p1, const Vec3Packedf& p2, const Vec3Packedf& p3, float x) { if (x == 0) return p0; else if (x == 1) return p3; return p0 * bern0(x) + p1 * bern1(x) + p2 * bern2(x) + p3 * bern3(x); } -static Vec3Packedf Bernstein3DDerivative(const Vec3Packedf p0, const Vec3Packedf p1, const Vec3Packedf p2, const Vec3Packedf p3, float x) { +static Vec3Packedf Bernstein3DDerivative(const Vec3Packedf& p0, const Vec3Packedf& p1, const Vec3Packedf& p2, const Vec3Packedf& p3, float x) { return p0 * bern0deriv(x) + p1 * bern1deriv(x) + p2 * bern2deriv(x) + p3 * bern3deriv(x); } diff --git a/headless/Compare.cpp b/headless/Compare.cpp index 4fc954a200..330a0bd73a 100644 --- a/headless/Compare.cpp +++ b/headless/Compare.cpp @@ -322,7 +322,7 @@ std::vector TranslateDebugBufferToCompare(const GPUDebugBuffer *buffer, u32 return data; } -double CompareScreenshot(const std::vector &pixels, u32 stride, u32 w, u32 h, const std::string screenshotFilename, std::string &error) +double CompareScreenshot(const std::vector &pixels, u32 stride, u32 w, u32 h, const std::string& screenshotFilename, std::string &error) { if (pixels.size() < stride * h) { diff --git a/headless/Compare.h b/headless/Compare.h index e77c80a7f0..4e054ce416 100644 --- a/headless/Compare.h +++ b/headless/Compare.h @@ -32,4 +32,4 @@ std::string GetTestName(const std::string &bootFilename); bool CompareOutput(const std::string &bootFilename, const std::string &output, bool verbose); std::vector TranslateDebugBufferToCompare(const GPUDebugBuffer *buffer, u32 stride, u32 h); -double CompareScreenshot(const std::vector &pixels, u32 stride, u32 w, u32 h, const std::string screenshotFilename, std::string &error); \ No newline at end of file +double CompareScreenshot(const std::vector &pixels, u32 stride, u32 w, u32 h, const std::string& screenshotFilename, std::string &error); \ No newline at end of file From 22593cddcc1aa27135ada8fefe264c01dabc7762 Mon Sep 17 00:00:00 2001 From: Chin Date: Wed, 24 Dec 2014 22:20:21 -0500 Subject: [PATCH 5/5] Use pre-increment instead of post-increment for iterators, and use auto for some iterators --- Core/CwCheat.cpp | 3 ++- Core/ELF/ParamSFO.cpp | 4 ++-- Core/HLE/sceAtrac.cpp | 2 +- Core/HLE/sceKernelMbx.cpp | 2 +- Core/HLE/sceKernelThread.cpp | 4 ++-- Core/HLE/sceMpeg.cpp | 4 ++-- Core/HLE/sceNetAdhoc.cpp | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 63b6954d18..991e857c4e 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -131,7 +131,8 @@ void CWCheatEngine::Exit() { exit2 = true; } -static inline std::vector makeCodeParts(const std::vector& CodesList) { //Takes a single code line and creates a two-part vector for each code. Feeds to CreateCodeList +// Takes a single code line and creates a two-part vector for each code. Feeds to CreateCodeList +static inline std::vector makeCodeParts(const std::vector& CodesList) { std::string currentcode; std::vector finalList; char split_char = '\n'; diff --git a/Core/ELF/ParamSFO.cpp b/Core/ELF/ParamSFO.cpp index 542101a23c..4c2b65fa9b 100644 --- a/Core/ELF/ParamSFO.cpp +++ b/Core/ELF/ParamSFO.cpp @@ -176,7 +176,7 @@ bool ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size) total_size += sizeof(Header); // Get size info - for (std::map::iterator it = values.begin(); it != values.end(); it++) + for (auto it = values.begin(); it != values.end(); ++it) { key_size += it->first.size()+1; data_size += it->second.max_size; @@ -205,7 +205,7 @@ bool ParamSFOData::WriteSFO(u8 **paramsfo, size_t *size) u8* key_ptr = data + header.key_table_start; u8* data_ptr = data + header.data_table_start; - for (std::map::iterator it = values.begin(); it != values.end(); it++) + for (auto it = values.begin(); it != values.end(); ++it) { u16 offset = (u16)(key_ptr - (data+header.key_table_start)); index_ptr->key_table_offset = offset; diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index 19dcd64162..4875a06067 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -2148,7 +2148,7 @@ static int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesCo if (avret < 0) { ERROR_LOG(ME, "swr_convert: Error while converting %d", avret); } - break; + break; } } } diff --git a/Core/HLE/sceKernelMbx.cpp b/Core/HLE/sceKernelMbx.cpp index 9b72de4c50..c90d19dd45 100644 --- a/Core/HLE/sceKernelMbx.cpp +++ b/Core/HLE/sceKernelMbx.cpp @@ -71,7 +71,7 @@ struct Mbx : public KernelObject bool inserted = false; if (nmb.attr & SCE_KERNEL_MBA_THPRI) { - for (std::vector::iterator it = waitingThreads.begin(); it != waitingThreads.end(); it++) + for (auto it = waitingThreads.begin(); it != waitingThreads.end(); ++it) { if (__KernelGetThreadPrio(id) < __KernelGetThreadPrio(it->threadID)) { diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index d95b0dd85b..e7675c28c0 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -3608,7 +3608,7 @@ bool __KernelCheckCallbacks() { bool processed = false; u32 error; - for (std::vector::iterator iter = threadqueue.begin(); iter != threadqueue.end(); iter++) { + for (auto iter = threadqueue.begin(); iter != threadqueue.end(); ++iter) { Thread *thread = kernelObjects.Get(*iter, error); if (thread && __KernelCheckThreadCallbacks(thread, false)) { processed = true; @@ -3690,7 +3690,7 @@ std::vector GetThreadsInfo() std::vector threadList; u32 error; - for (std::vector::iterator iter = threadqueue.begin(); iter != threadqueue.end(); iter++) + for (auto iter = threadqueue.begin(); iter != threadqueue.end(); ++iter) { Thread *t = kernelObjects.Get(*iter, error); if (!t) diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp index 43ceee7b40..cbb655398a 100644 --- a/Core/HLE/sceMpeg.cpp +++ b/Core/HLE/sceMpeg.cpp @@ -740,7 +740,7 @@ static void SaveFrame(AVFrame *pFrame, int width, int height) // check the existence of pmp media context static bool isContextExist(u32 ctxAddr){ - for (std::list::iterator it = pmp_ContextList.begin(); it != pmp_ContextList.end(); it++){ + for (auto it = pmp_ContextList.begin(); it != pmp_ContextList.end(); ++it){ if (*it == ctxAddr){ return true; } @@ -1016,7 +1016,7 @@ void __VideoPmpInit() { void __VideoPmpShutdown() { #ifdef USE_FFMPEG // We need to empty pmp_queue to not leak memory. - for (std::list::iterator it = pmp_queue.begin(); it != pmp_queue.end(); it++){ + for (auto it = pmp_queue.begin(); it != pmp_queue.end(); ++it){ av_free(*it); } pmp_queue.clear(); diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index d2f056e7ee..abf53ff78e 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1000,7 +1000,7 @@ static u32 sceNetAdhocctlAddHandler(u32 handlerPtr, u32 handlerArg) { handler.entryPoint = handlerPtr; handler.argument = handlerArg; - for (std::map::iterator it = adhocctlHandlers.begin(); it != adhocctlHandlers.end(); it++) { + for (auto it = adhocctlHandlers.begin(); it != adhocctlHandlers.end(); ++it) { if (it->second.entryPoint == handlerPtr) { foundHandler = true; break;