From 139d4fc76e4ddf45179ca5ec5e42c52ef513ea4d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 2 Dec 2020 13:17:27 -0500 Subject: General: Convert PanicAlerts over to fmt equivalent Converts lingering panic alert calls over to the fmt-capable ones. --- Source/Core/Common/MemoryUtil.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Source/Core/Common/MemoryUtil.cpp') diff --git a/Source/Core/Common/MemoryUtil.cpp b/Source/Core/Common/MemoryUtil.cpp index 909c12fa90..ca9fa64185 100644 --- a/Source/Core/Common/MemoryUtil.cpp +++ b/Source/Core/Common/MemoryUtil.cpp @@ -46,7 +46,7 @@ void* AllocateExecutableMemory(size_t size) #endif if (ptr == nullptr) - PanicAlert("Failed to allocate executable memory"); + PanicAlertFmt("Failed to allocate executable memory"); return ptr; } @@ -63,7 +63,7 @@ void* AllocateMemoryPages(size_t size) #endif if (ptr == nullptr) - PanicAlert("Failed to allocate raw memory"); + PanicAlertFmt("Failed to allocate raw memory"); return ptr; } @@ -79,7 +79,7 @@ void* AllocateAlignedMemory(size_t size, size_t alignment) #endif if (ptr == nullptr) - PanicAlert("Failed to allocate aligned memory"); + PanicAlertFmt("Failed to allocate aligned memory"); return ptr; } @@ -90,10 +90,10 @@ void FreeMemoryPages(void* ptr, size_t size) { #ifdef _WIN32 if (!VirtualFree(ptr, 0, MEM_RELEASE)) - PanicAlert("FreeMemoryPages failed!\nVirtualFree: %s", GetLastErrorString().c_str()); + PanicAlertFmt("FreeMemoryPages failed!\nVirtualFree: {}", GetLastErrorString()); #else if (munmap(ptr, size) != 0) - PanicAlert("FreeMemoryPages failed!\nmunmap: %s", LastStrerrorString().c_str()); + PanicAlertFmt("FreeMemoryPages failed!\nmunmap: {}", LastStrerrorString()); #endif } } @@ -115,10 +115,10 @@ void ReadProtectMemory(void* ptr, size_t size) #ifdef _WIN32 DWORD oldValue; if (!VirtualProtect(ptr, size, PAGE_NOACCESS, &oldValue)) - PanicAlert("ReadProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str()); + PanicAlertFmt("ReadProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString()); #else if (mprotect(ptr, size, PROT_NONE) != 0) - PanicAlert("ReadProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str()); + PanicAlertFmt("ReadProtectMemory failed!\nmprotect: {}", LastStrerrorString()); #endif } @@ -127,10 +127,10 @@ void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) #ifdef _WIN32 DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue)) - PanicAlert("WriteProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str()); + PanicAlertFmt("WriteProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString()); #else if (mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_EXEC) : PROT_READ) != 0) - PanicAlert("WriteProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str()); + PanicAlertFmt("WriteProtectMemory failed!\nmprotect: {}", LastStrerrorString()); #endif } @@ -139,12 +139,12 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) #ifdef _WIN32 DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldValue)) - PanicAlert("UnWriteProtectMemory failed!\nVirtualProtect: %s", GetLastErrorString().c_str()); + PanicAlertFmt("UnWriteProtectMemory failed!\nVirtualProtect: {}", GetLastErrorString()); #else if (mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ) != 0) { - PanicAlert("UnWriteProtectMemory failed!\nmprotect: %s", LastStrerrorString().c_str()); + PanicAlertFmt("UnWriteProtectMemory failed!\nmprotect: {}", LastStrerrorString()); } #endif } -- cgit v1.2.3