From 3a450f72f828433f1a3bee3b3e1e2da1f97d73ae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 Jul 2015 23:39:38 -0400 Subject: CPUDetect: Remove a memset call on the this pointer --- Source/Core/Common/x64CPUDetect.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'Source/Core/Common/x64CPUDetect.cpp') diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp index 0e9f32e622..8bce493b5a 100644 --- a/Source/Core/Common/x64CPUDetect.cpp +++ b/Source/Core/Common/x64CPUDetect.cpp @@ -61,7 +61,6 @@ CPUInfo::CPUInfo() // Detects the various CPU features void CPUInfo::Detect() { - memset(this, 0, sizeof(*this)); #ifdef _M_X86_64 Mode64bit = true; OS64bit = true; @@ -79,7 +78,6 @@ void CPUInfo::Detect() // Assume CPU supports the CPUID instruction. Those that don't can barely // boot modern OS:es anyway. int cpu_id[4]; - memset(brand_string, 0, sizeof(brand_string)); // Detect CPU's CPUID capabilities, and grab CPU string __cpuid(cpu_id, 0x00000000); -- cgit v1.2.3 From 2c5c99ec71e808679ac4763f82ad876f440e0b2c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 15 Sep 2015 12:13:13 -0400 Subject: Common: Get rid of a few pointer casts --- Source/Core/Common/x64CPUDetect.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/x64CPUDetect.cpp') diff --git a/Source/Core/Common/x64CPUDetect.cpp b/Source/Core/Common/x64CPUDetect.cpp index 8bce493b5a..23b279dbb8 100644 --- a/Source/Core/Common/x64CPUDetect.cpp +++ b/Source/Core/Common/x64CPUDetect.cpp @@ -82,9 +82,9 @@ void CPUInfo::Detect() // Detect CPU's CPUID capabilities, and grab CPU string __cpuid(cpu_id, 0x00000000); u32 max_std_fn = cpu_id[0]; // EAX - *((int *)brand_string) = cpu_id[1]; - *((int *)(brand_string + 4)) = cpu_id[3]; - *((int *)(brand_string + 8)) = cpu_id[2]; + std::memcpy(&brand_string[0], &cpu_id[1], sizeof(int)); + std::memcpy(&brand_string[4], &cpu_id[3], sizeof(int)); + std::memcpy(&brand_string[8], &cpu_id[2], sizeof(int)); __cpuid(cpu_id, 0x80000000); u32 max_ex_fn = cpu_id[0]; if (!strcmp(brand_string, "GenuineIntel")) -- cgit v1.2.3