Global: Cleanup initialization/pointer checks.

Cleaning up a lot of cases of uninitialized data, unchecked return values
for failures, and similar.
This commit is contained in:
Unknown W. Brackets
2022-12-10 21:09:50 -08:00
parent a7b7bf7826
commit 9cfcbc46e6
41 changed files with 190 additions and 138 deletions
+4 -1
View File
@@ -321,7 +321,10 @@ void CPUInfo::Detect() {
#if PPSSPP_PLATFORM(WINDOWS)
#if !PPSSPP_PLATFORM(UWP)
typedef BOOL (WINAPI *getLogicalProcessorInformationEx_f)(LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer, PDWORD ReturnedLength);
auto getLogicalProcessorInformationEx = (getLogicalProcessorInformationEx_f)GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetLogicalProcessorInformationEx");
getLogicalProcessorInformationEx_f getLogicalProcessorInformationEx = nullptr;
HMODULE kernel32 = GetModuleHandle(L"kernel32.dll");
if (kernel32)
getLogicalProcessorInformationEx = (getLogicalProcessorInformationEx_f)GetProcAddress(kernel32, "GetLogicalProcessorInformationEx");
#else
void *getLogicalProcessorInformationEx = nullptr;
#endif