From ee884630791da5961df93bb1ca2b41aaf113f4b1 Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Tue, 18 Oct 2016 02:15:36 +0200 Subject: [PATCH] Fix a compilation error on MSVC. --- libcpuid/recog_intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index e16c2bf..f8b1403 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -824,6 +824,7 @@ static void decode_intel_sgx_features(const struct cpu_raw_data_t* raw, struct c struct cpu_epc_t cpuid_get_epc(int index, const struct cpu_raw_data_t* raw) { uint32_t regs[4]; + struct cpu_epc_t retval = {0, 0}; if (raw && index < MAX_INTELFN12H_LEVEL - 2) { // this was queried already, use the data: memcpy(regs, raw->intel_fn12h[2 + index], sizeof(regs)); @@ -836,7 +837,6 @@ struct cpu_epc_t cpuid_get_epc(int index, const struct cpu_raw_data_t* raw) } // decode values: - struct cpu_epc_t retval = {0, 0}; if ((regs[0] & 0xf) == 0x1) { retval.start_addr |= (regs[0] & 0xfffff000); // bits [12, 32) -> bits [12, 32) retval.start_addr |= ((uint64_t) (regs[1] & 0x000fffff)) << 32; // bits [0, 20) -> bits [32, 52)