diff --git a/rpcs3/Crypto/unself.cpp b/rpcs3/Crypto/unself.cpp index df8d0838ae..5fababbb02 100644 --- a/rpcs3/Crypto/unself.cpp +++ b/rpcs3/Crypto/unself.cpp @@ -421,7 +421,7 @@ bool SELFDecrypter::MakeElf(const std::string& elf, bool isElf32) } // Write section headers. - if(self_hdr.se_shdroff != NULL) + if(self_hdr.se_shdroff != 0) { e.Seek(elf32_hdr.e_shoff); @@ -482,7 +482,7 @@ bool SELFDecrypter::MakeElf(const std::string& elf, bool isElf32) } // Write section headers. - if(self_hdr.se_shdroff != NULL) + if(self_hdr.se_shdroff != 0) { e.Seek(elf64_hdr.e_shoff); diff --git a/rpcs3/Emu/Audio/AL/OpenALThread.h b/rpcs3/Emu/Audio/AL/OpenALThread.h index cf65d31919..424b3e2a6e 100644 --- a/rpcs3/Emu/Audio/AL/OpenALThread.h +++ b/rpcs3/Emu/Audio/AL/OpenALThread.h @@ -12,7 +12,7 @@ private: ALuint m_buffers[g_al_buffers_count]; ALCdevice* m_device; ALCcontext* m_context; - u32 m_buffer_size; + ALsizei m_buffer_size; public: ~OpenALThread(); diff --git a/rpcs3/Emu/Cell/PPUInterpreter.h b/rpcs3/Emu/Cell/PPUInterpreter.h index c049a7e95a..9284e52c15 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.h +++ b/rpcs3/Emu/Cell/PPUInterpreter.h @@ -10,7 +10,7 @@ #include #else #include -#define _rotl64(x,r) (((u64)x << r) | ((u64)x >> (64 - r))) +#define _rotl64(x,r) (((u64)(x) << (r)) | ((u64)(x) >> (64 - (r)))) #endif #define UNIMPLEMENTED() UNK(__FUNCTION__) diff --git a/rpcs3/Emu/Cell/PPUProgramCompiler.cpp b/rpcs3/Emu/Cell/PPUProgramCompiler.cpp index 4120c81372..06e913ff83 100644 --- a/rpcs3/Emu/Cell/PPUProgramCompiler.cpp +++ b/rpcs3/Emu/Cell/PPUProgramCompiler.cpp @@ -44,7 +44,7 @@ s64 FindOp(const std::string& text, const std::string& op, s64 from) { if (text.length() < op.length()) return -1; - for (s64 i = from; i= m_asm.length(); } -bool CompilePPUProgram::IsEndLn(const char c) const { return c == '\n' || p - 1 >= m_asm.length(); } +bool CompilePPUProgram::IsEnd() const { return p >= (s64)m_asm.length(); } +bool CompilePPUProgram::IsEndLn(const char c) const { return c == '\n' || p - 1 >= (s64)m_asm.length(); } char CompilePPUProgram::NextChar() { return *m_asm.substr(p++, 1).c_str(); } -void CompilePPUProgram::NextLn() { while( !IsEndLn(NextChar()) ); if(!IsEnd()) m_line++; } +void CompilePPUProgram::NextLn() { while( !IsEndLn(NextChar()) ) continue; if(!IsEnd()) m_line++; } void CompilePPUProgram::EndLn() { NextLn(); diff --git a/rpcs3/Emu/Cell/PPUThread.h b/rpcs3/Emu/Cell/PPUThread.h index 6bcbe71eee..62b43ff36e 100644 --- a/rpcs3/Emu/Cell/PPUThread.h +++ b/rpcs3/Emu/Cell/PPUThread.h @@ -827,7 +827,7 @@ public: return true; } } - catch (std::invalid_argument& e)//if any of the stoull conversion fail + catch (std::invalid_argument&)//if any of the stoull conversion fail { return false; } diff --git a/rpcs3/Emu/Cell/SPUThread.h b/rpcs3/Emu/Cell/SPUThread.h index 07894259b8..96e9d3947b 100644 --- a/rpcs3/Emu/Cell/SPUThread.h +++ b/rpcs3/Emu/Cell/SPUThread.h @@ -178,6 +178,10 @@ public: case 1: return this->low >> 22 & 0x3; + + default: + ConLog.Error("Unexpected slice value in FPSCR::checkSliceRounding(): %d", slice); + return 0; } } diff --git a/rpcs3/Emu/Memory/Memory.cpp b/rpcs3/Emu/Memory/Memory.cpp index e1d9383578..755dd389f5 100644 --- a/rpcs3/Emu/Memory/Memory.cpp +++ b/rpcs3/Emu/Memory/Memory.cpp @@ -521,7 +521,7 @@ MemoryBlock* VirtualMemoryBlock::SetRange(const u64 start, const u32 size) bool VirtualMemoryBlock::IsInMyRange(const u64 addr) { - return addr >= GetStartAddr() && addr < GetStartAddr() + GetSize() - GetResevedAmount(); + return addr >= GetStartAddr() && addr < GetStartAddr() + GetSize() - GetReservedAmount(); } bool VirtualMemoryBlock::IsInMyRange(const u64 addr, const u32 size) @@ -554,7 +554,7 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr) } else { - for(u64 addr = GetStartAddr(); addr <= GetEndAddr() - GetResevedAmount() - size;) + for(u64 addr = GetStartAddr(); addr <= GetEndAddr() - GetReservedAmount() - size;) { bool is_good_addr = true; @@ -718,7 +718,7 @@ void VirtualMemoryBlock::Delete() bool VirtualMemoryBlock::Reserve(u32 size) { - if(size + GetResevedAmount() > GetEndAddr() - GetStartAddr()) + if(size + GetReservedAmount() > GetEndAddr() - GetStartAddr()) return false; m_reserve_size += size; @@ -727,14 +727,14 @@ bool VirtualMemoryBlock::Reserve(u32 size) bool VirtualMemoryBlock::Unreserve(u32 size) { - if(size > GetResevedAmount()) + if(size > GetReservedAmount()) return false; m_reserve_size -= size; return true; } -u32 VirtualMemoryBlock::GetResevedAmount() +u32 VirtualMemoryBlock::GetReservedAmount() { return m_reserve_size; } diff --git a/rpcs3/Emu/Memory/Memory.h b/rpcs3/Emu/Memory/Memory.h index d361acd75d..d1dcef50e2 100644 --- a/rpcs3/Emu/Memory/Memory.h +++ b/rpcs3/Emu/Memory/Memory.h @@ -532,6 +532,7 @@ public: bool Unmap(const u64 addr) { + bool result = false; for(uint i=0; iIsMirror()) @@ -540,9 +541,11 @@ public: { delete MemoryBlocks[i]; MemoryBlocks.erase(MemoryBlocks.begin() + i); + return true; } } } + return false; } u8* operator + (const u64 vaddr) diff --git a/rpcs3/Emu/Memory/MemoryBlock.h b/rpcs3/Emu/Memory/MemoryBlock.h index 16c00ae925..144055716c 100644 --- a/rpcs3/Emu/Memory/MemoryBlock.h +++ b/rpcs3/Emu/Memory/MemoryBlock.h @@ -28,7 +28,7 @@ struct MemBlockInfo : public MemInfo { if(!mem) { - ConLog.Error("Not enought free memory."); + ConLog.Error("Not enough free memory."); assert(0); } memset(mem, 0, size); @@ -267,7 +267,7 @@ public: virtual bool Unreserve(u32 size); // Return the total amount of reserved memory - virtual u32 GetResevedAmount(); + virtual u32 GetReservedAmount(); virtual bool Read8(const u64 addr, u8* value); virtual bool Read16(const u64 addr, u16* value); diff --git a/rpcs3/Emu/SysCalls/Modules.cpp b/rpcs3/Emu/SysCalls/Modules.cpp index b759960929..b240f0d635 100644 --- a/rpcs3/Emu/SysCalls/Modules.cpp +++ b/rpcs3/Emu/SysCalls/Modules.cpp @@ -14,7 +14,7 @@ std::vector g_static_funcs_list; struct ModuleInfo { u32 id; - char* name; + const char* name; } static const g_module_list[] = { diff --git a/rpcs3/Emu/SysCalls/Modules.h b/rpcs3/Emu/SysCalls/Modules.h index c940df2b58..8ed63b7f26 100644 --- a/rpcs3/Emu/SysCalls/Modules.h +++ b/rpcs3/Emu/SysCalls/Modules.h @@ -31,7 +31,7 @@ struct SFunc { func_caller* func; void* ptr; - char* name; + const char* name; std::vector ops; u64 group; u32 found; @@ -117,7 +117,7 @@ public: template __forceinline void AddFunc(u32 id, T func); - template __forceinline void AddFuncSub(const char group[8], const u64 ops[], char* name, T func); + template __forceinline void AddFuncSub(const char group[8], const u64 ops[], const char* name, T func); }; template @@ -127,7 +127,7 @@ __forceinline void Module::AddFunc(u32 id, T func) } template -__forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], char* name, T func) +__forceinline void Module::AddFuncSub(const char group[8], const u64 ops[], const char* name, T func) { if (!ops[0]) return; diff --git a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp index 8028b923a8..e26278f707 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellAdec.cpp @@ -512,7 +512,7 @@ bool adecCheckType(AudioCodecType type) { switch (type) { - case CELL_ADEC_TYPE_ATRACX: ConLog.Write("*** (???) type: ATRAC3plus"); break; + case CELL_ADEC_TYPE_ATRACX: ConLog.Write("*** (?) type: ATRAC3plus"); break; case CELL_ADEC_TYPE_ATRACX_2CH: ConLog.Write("*** type: ATRAC3plus 2ch"); break; case CELL_ADEC_TYPE_ATRACX_6CH: diff --git a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp index 036fc17005..085c04326f 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellFont.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellFont.cpp @@ -219,7 +219,7 @@ struct CCellFontInternal //Module cellFont bool m_bFontGcmInitialized; CCellFontInternal() - : m_buffer_addr(NULL) + : m_buffer_addr(0) , m_buffer_size(0) , m_bInitialized(false) , m_bFontGcmInitialized(false) @@ -301,7 +301,7 @@ int cellFontOpenFontMemory(mem_ptr_t library, u32 fontAddr, u32 if (!stbtt_InitFont(&(font->stbfont), (unsigned char*)Memory.VirtualToRealAddr(fontAddr), 0)) return CELL_FONT_ERROR_FONT_OPEN_FAILED; - font->renderer_addr = NULL; + font->renderer_addr = 0; font->fontdata_addr = fontAddr; font->origin = CELL_FONT_OPEN_MEMORY; return CELL_FONT_OK; @@ -531,7 +531,7 @@ int cellFontUnbindRenderer(mem_ptr_t font) if (!font->renderer_addr) return CELL_FONT_ERROR_RENDERER_UNBIND; - font->renderer_addr = NULL; + font->renderer_addr = 0; return CELL_FONT_OK; } diff --git a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp index 7872146ed9..2a463daa48 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGcmSys.cpp @@ -9,7 +9,7 @@ void cellGcmSys_unload(); Module cellGcmSys(0x0010, cellGcmSys_init, cellGcmSys_load, cellGcmSys_unload); u32 local_size = 0; -u32 local_addr = NULL; +u32 local_addr = 0; enum { @@ -562,7 +562,7 @@ int32_t cellGcmAddressToOffset(u64 address, mem32_t offset) uint32_t cellGcmGetMaxIoMapSize() { - return Memory.RSXIOMem.GetEndAddr() - Memory.RSXIOMem.GetStartAddr() - Memory.RSXIOMem.GetResevedAmount(); + return Memory.RSXIOMem.GetEndAddr() - Memory.RSXIOMem.GetStartAddr() - Memory.RSXIOMem.GetReservedAmount(); } void cellGcmGetOffsetTable(mem_ptr_t table) @@ -681,8 +681,8 @@ int32_t cellGcmReserveIoMapSize(const u32 size) int32_t cellGcmUnmapEaIoAddress(u64 ea) { - u32 size; - if (size = Memory.RSXIOMem.UnmapRealAddress(ea)) + u32 size = Memory.RSXIOMem.UnmapRealAddress(ea); + if (size) { u64 io; ea = ea >> 20; @@ -704,8 +704,8 @@ int32_t cellGcmUnmapEaIoAddress(u64 ea) int32_t cellGcmUnmapIoAddress(u64 io) { - u32 size; - if (size = Memory.RSXIOMem.UnmapAddress(io)) + u32 size = Memory.RSXIOMem.UnmapAddress(io); + if (size) { u64 ea; io = io >> 20; @@ -730,7 +730,7 @@ int32_t cellGcmUnreserveIoMapSize(u32 size) if (size & 0xFFFFF) return CELL_GCM_ERROR_INVALID_ALIGNMENT; - if (size > Memory.RSXIOMem.GetResevedAmount()) + if (size > Memory.RSXIOMem.GetReservedAmount()) return CELL_GCM_ERROR_INVALID_VALUE; Memory.RSXIOMem.Unreserve(size); @@ -956,10 +956,10 @@ void cellGcmSys_init() void cellGcmSys_load() { - current_config.ioAddress = NULL; - current_config.localAddress = NULL; + current_config.ioAddress = 0; + current_config.localAddress = 0; local_size = 0; - local_addr = NULL; + local_addr = 0; } void cellGcmSys_unload() diff --git a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp index 439602605f..f3ed4eab19 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellGifDec.cpp @@ -57,7 +57,7 @@ int cellGifDecOpen(u32 mainHandle, mem32_t subHandle, const mem_ptr_t> fd; - int ret = cellFsOpen(src->fileName, 0, fd, NULL, 0); + int ret = cellFsOpen(src->fileName, 0, fd, 0, 0); current_subHandle->fd = fd->ToLE(); if(ret != CELL_OK) return CELL_GIFDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp index 7049153dd6..c22cc072f5 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellJpgDec.cpp @@ -37,7 +37,7 @@ int cellJpgDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t s // Get file descriptor MemoryAllocator> fd; - int ret = cellFsOpen(src->fileName, 0, fd, NULL, 0); + int ret = cellFsOpen(src->fileName, 0, fd, 0, 0); current_subHandle->fd = fd->ToLE(); if(ret != CELL_OK) return CELL_JPGDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp index b0ace5ef72..06aa19d629 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp @@ -29,7 +29,7 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t s CellPngDecSubHandle *current_subHandle = new CellPngDecSubHandle; - current_subHandle->fd = NULL; + current_subHandle->fd = 0; current_subHandle->src = *src; switch(src->srcSelect.ToBE()) @@ -41,7 +41,7 @@ int cellPngDecOpen(u32 mainHandle, mem32_t subHandle, mem_ptr_t s case const_se_t::value: // Get file descriptor MemoryAllocator> fd; - int ret = cellFsOpen(src->fileName_addr, 0, fd.GetAddr(), NULL, 0); + int ret = cellFsOpen(src->fileName_addr, 0, fd.GetAddr(), 0, 0); current_subHandle->fd = fd->ToLE(); if(ret != CELL_OK) return CELL_PNGDEC_ERROR_OPEN_FILE; diff --git a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp index 95585c1d17..7e44764af9 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellResc.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellResc.cpp @@ -517,7 +517,7 @@ int cellRescSetDisplayMode(u32 displayMode) videocfg->aspect = CELL_VIDEO_OUT_ASPECT_AUTO; videocfg->pitch = s_rescInternalInstance->m_dstPitch; - cellVideoOutConfigure(CELL_VIDEO_OUT_PRIMARY, videocfg.GetAddr(), NULL, 0); + cellVideoOutConfigure(CELL_VIDEO_OUT_PRIMARY, videocfg.GetAddr(), 0, 0); if (IsPalInterpolate()) { @@ -527,7 +527,7 @@ int cellRescSetDisplayMode(u32 displayMode) cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ); //cellGcmSetVBlankHandler(CCellRescInternal::IntrHandler50); //cellGcmSetSecondVHandler(CCellRescInternal::IntrHandler60); - cellGcmSetFlipHandler(NULL); + cellGcmSetFlipHandler(0); } else if (IsPalDrop()) { @@ -535,7 +535,7 @@ int cellRescSetDisplayMode(u32 displayMode) cellGcmSetSecondVFrequency(CELL_GCM_DISPLAY_FREQUENCY_59_94HZ); //cellGcmSetVBlankHandler(NULL); //cellGcmSetSecondVHandler(CCellRescInternal::IntrHandler60Drop); - cellGcmSetFlipHandler(NULL); + cellGcmSetFlipHandler(0); } else if (IsPal60Hsync()) { diff --git a/rpcs3/Emu/SysCalls/Modules/cellSysutil_SaveData.cpp b/rpcs3/Emu/SysCalls/Modules/cellSysutil_SaveData.cpp index 695bf751dc..f3761601c3 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellSysutil_SaveData.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellSysutil_SaveData.cpp @@ -366,12 +366,6 @@ int cellSaveDataListSave2(u32 version, mem_ptr_t setList, m // Enter the loop where the save files are read/created/deleted. s32 ret = modifySaveDataFiles(funcFile, result.GetAddr(), saveBaseDir + (char*)statGet->dir.dirName); - // TODO: There are other returns in this function that doesn't free the memory. Fix it (without using goto's, please). - for (auto& entry : saveEntries) { - delete[] entry.iconBuf; - entry.iconBuf = nullptr; - } - return ret; } @@ -457,12 +451,6 @@ int cellSaveDataListLoad2(u32 version, mem_ptr_t setList, m // Enter the loop where the save files are read/created/deleted. s32 ret = modifySaveDataFiles(funcFile, result.GetAddr(), saveBaseDir + (char*)statGet->dir.dirName); - // TODO: There are other returns in this function that doesn't free the memory. Fix it (without using goto's, please). - for (auto& entry : saveEntries) { - delete[] entry.iconBuf; - entry.iconBuf = nullptr; - } - return ret; } @@ -535,12 +523,6 @@ int cellSaveDataFixedSave2(u32 version, mem_ptr_t setList, // Enter the loop where the save files are read/created/deleted. s32 ret = modifySaveDataFiles(funcFile, result.GetAddr(), saveBaseDir + (char*)statGet->dir.dirName); - // TODO: There are other returns in this function that doesn't free the memory. Fix it (without using goto's, please). - for (auto& entry : saveEntries) { - delete[] entry.iconBuf; - entry.iconBuf = nullptr; - } - return ret; } @@ -613,12 +595,6 @@ int cellSaveDataFixedLoad2(u32 version, mem_ptr_t setList, // Enter the loop where the save files are read/created/deleted. s32 ret = modifySaveDataFiles(funcFile, result.GetAddr(), saveBaseDir + (char*)statGet->dir.dirName); - // TODO: There are other returns in this function that doesn't free the memory. Fix it (without using goto's, please). - for (auto& entry : saveEntries) { - delete[] entry.iconBuf; - entry.iconBuf = nullptr; - } - return ret; } diff --git a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp index 5ae038f0ae..237963cac2 100644 --- a/rpcs3/Emu/SysCalls/Modules/sys_net.cpp +++ b/rpcs3/Emu/SysCalls/Modules/sys_net.cpp @@ -19,7 +19,7 @@ extern "C" void sys_net_init(); Module sys_net((u16)0x0000, sys_net_init); -mem32_t g_lastError(NULL); +mem32_t g_lastError(0); // Auxiliary Functions @@ -476,7 +476,7 @@ int sys_net_finalize_network() { sys_net.Warning("sys_net_initialize_network_ex()"); Memory.Free(g_lastError.GetAddr()); - g_lastError.SetAddr(NULL); + g_lastError.SetAddr(0); #ifdef _WIN32 WSACleanup(); #endif diff --git a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp index 92f2f174d9..e2c5201182 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_SPU_Thread.cpp @@ -230,8 +230,8 @@ int sys_spu_thread_group_start(u32 id) for (u32 i = 0; i < group_info->list.size(); i++) { - CPUThread* t; - if (t = Emu.GetCPU().GetThread(group_info->list[i])) + CPUThread* t = Emu.GetCPU().GetThread(group_info->list[i]); + if (t) { t->Exec(); } diff --git a/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp b/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp index f8d2a3c148..b718ce1ed9 100644 --- a/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp +++ b/rpcs3/Emu/SysCalls/lv2/SC_Time.cpp @@ -27,6 +27,10 @@ u64 get_time() struct timespec ts; if (!clock_gettime(CLOCK_MONOTONIC, &ts)) return ts.tv_sec * (s64)10000000 + (s64)ts.tv_nsec / (s64)100; + + // Should never occur. + assert(0); + return 0; #endif } diff --git a/rpcs3/Gui/MemoryViewer.cpp b/rpcs3/Gui/MemoryViewer.cpp index 5081efa847..ff56509bcf 100644 --- a/rpcs3/Gui/MemoryViewer.cpp +++ b/rpcs3/Gui/MemoryViewer.cpp @@ -212,7 +212,7 @@ void MemoryViewerPanel::ShowMemory() t_mem_ascii->SetValue(t_mem_ascii_str); } -void MemoryViewerPanel::ShowImage(wxWindow* parent, u32 addr, int mode, int width, int height, bool flipv) +void MemoryViewerPanel::ShowImage(wxWindow* parent, u32 addr, int mode, u32 width, u32 height, bool flipv) { wxString title = wxString::Format("Raw Image @ 0x%x", addr); diff --git a/rpcs3/Gui/MemoryViewer.h b/rpcs3/Gui/MemoryViewer.h index 2abfa66c94..3f73d368c4 100644 --- a/rpcs3/Gui/MemoryViewer.h +++ b/rpcs3/Gui/MemoryViewer.h @@ -41,5 +41,5 @@ public: void SetPC(const uint pc) { m_addr = pc; } //Static methods - static void ShowImage(wxWindow* parent, u32 addr, int mode, int sizex, int sizey, bool flipv); + static void ShowImage(wxWindow* parent, u32 addr, int mode, u32 sizex, u32 sizey, bool flipv); }; diff --git a/rpcs3/Gui/RSXDebugger.cpp b/rpcs3/Gui/RSXDebugger.cpp index a0b285685a..505f67395e 100644 --- a/rpcs3/Gui/RSXDebugger.cpp +++ b/rpcs3/Gui/RSXDebugger.cpp @@ -780,7 +780,7 @@ wxString RSXDebugger::DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioA { wxString disasm = wxEmptyString; -#define DISASM(string, ...) if(disasm.IsEmpty()) disasm = wxString::Format((string), ##__VA_ARGS__); else disasm += (wxString(' ') + wxString::Format((string), ##__VA_ARGS__)) +#define DISASM(string, ...) { if(disasm.IsEmpty()) disasm = wxString::Format((string), ##__VA_ARGS__); else disasm += (wxString(' ') + wxString::Format((string), ##__VA_ARGS__)); } if(cmd & CELL_GCM_METHOD_FLAG_JUMP) { u32 jumpAddr = cmd & ~(CELL_GCM_METHOD_FLAG_JUMP | CELL_GCM_METHOD_FLAG_NON_INCREMENT); diff --git a/rpcs3/Gui/VFSManager.cpp b/rpcs3/Gui/VFSManager.cpp index d9828ede5d..1223f7ee61 100644 --- a/rpcs3/Gui/VFSManager.cpp +++ b/rpcs3/Gui/VFSManager.cpp @@ -96,9 +96,9 @@ void VFSEntrySettingsDialog::OnSelectDevPath(wxCommandEvent& event) void VFSEntrySettingsDialog::OnOk(wxCommandEvent& event) { - m_entry.device_path = strdup( m_tctrl_dev_path->GetValue().c_str()); - m_entry.path = strdup(m_tctrl_path->GetValue().c_str()); - m_entry.mount = strdup(m_tctrl_mount->GetValue().c_str()); + m_entry.device_path = m_tctrl_dev_path->GetValue().ToStdString(); + m_entry.path = m_tctrl_path->GetValue().ToStdString(); + m_entry.mount = m_tctrl_mount->GetValue().ToStdString(); m_entry.device = (vfsDeviceType)m_ch_type->GetSelection(); EndModal(wxID_OK); diff --git a/rpcs3/Loader/TRP.cpp b/rpcs3/Loader/TRP.cpp index c1596a916e..5b2fd634f4 100644 --- a/rpcs3/Loader/TRP.cpp +++ b/rpcs3/Loader/TRP.cpp @@ -64,7 +64,7 @@ bool TRPLoader::LoadHeader(bool show) return true; } -bool TRPLoader::ContainsEntry(char *filename) +bool TRPLoader::ContainsEntry(const char *filename) { for (const TRPEntry& entry : m_entries) { if (!strcmp(entry.name, filename)) @@ -73,7 +73,7 @@ bool TRPLoader::ContainsEntry(char *filename) return false; } -void TRPLoader::RemoveEntry(char *filename) +void TRPLoader::RemoveEntry(const char *filename) { std::vector::iterator i = m_entries.begin(); while (i != m_entries.end()) { @@ -84,7 +84,7 @@ void TRPLoader::RemoveEntry(char *filename) } } -void TRPLoader::RenameEntry(char *oldname, char *newname) +void TRPLoader::RenameEntry(const char *oldname, const char *newname) { for (const TRPEntry& entry : m_entries) { if (!strcmp(entry.name, oldname)) diff --git a/rpcs3/Loader/TRP.h b/rpcs3/Loader/TRP.h index d86541e6c2..758af90989 100644 --- a/rpcs3/Loader/TRP.h +++ b/rpcs3/Loader/TRP.h @@ -34,9 +34,9 @@ public: virtual bool Install(std::string dest, bool show = false); virtual bool LoadHeader(bool show = false); - virtual bool ContainsEntry(char *filename); - virtual void RemoveEntry(char *filename); - virtual void RenameEntry(char *oldname, char *newname); + virtual bool ContainsEntry(const char *filename); + virtual void RemoveEntry(const char *filename); + virtual void RenameEntry(const char *oldname, const char *newname); virtual bool Close(); }; \ No newline at end of file diff --git a/rpcs3/rpcs3.vcxproj b/rpcs3/rpcs3.vcxproj index 4b53458454..17809ade40 100644 --- a/rpcs3/rpcs3.vcxproj +++ b/rpcs3/rpcs3.vcxproj @@ -584,6 +584,7 @@ + diff --git a/rpcs3/rpcs3.vcxproj.filters b/rpcs3/rpcs3.vcxproj.filters index 45d74aa2c1..e16c56bc86 100644 --- a/rpcs3/rpcs3.vcxproj.filters +++ b/rpcs3/rpcs3.vcxproj.filters @@ -987,5 +987,8 @@ Crypto + + Gui + \ No newline at end of file