From 03d54ae61cbca2ea4954a238d6bea61176174dc0 Mon Sep 17 00:00:00 2001 From: Veselin Georgiev Date: Sat, 9 Jul 2016 05:48:35 +0300 Subject: [PATCH] Port to MSVC7.1: C89 compliance and project updates. --- libcpuid/libcpuid_vc71.vcproj | 9 +++++++++ libcpuid/rdmsr.c | 3 ++- libcpuid/recog_intel.c | 11 +++++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/libcpuid/libcpuid_vc71.vcproj b/libcpuid/libcpuid_vc71.vcproj index 4aeb103..94e43c4 100644 --- a/libcpuid/libcpuid_vc71.vcproj +++ b/libcpuid/libcpuid_vc71.vcproj @@ -178,15 +178,24 @@ Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> + + + + + + diff --git a/libcpuid/rdmsr.c b/libcpuid/rdmsr.c index cd364fa..2091312 100644 --- a/libcpuid/rdmsr.c +++ b/libcpuid/rdmsr.c @@ -802,7 +802,8 @@ int cpu_msrinfo(struct msr_driver_t* handle, cpu_msrinfo_request_t which) { struct cpu_raw_data_t raw; static struct cpu_id_t id; - static struct internal_id_info_t internal = { .score = -1 }; + static struct internal_id_info_t internal; + internal.score = -1; if (handle == NULL) return set_error(ERR_HANDLE); diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index dff6a0b..64651be 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -776,6 +776,11 @@ static intel_model_t get_model_code(struct cpu_id_t* data) int cpuid_identify_intel(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct internal_id_info_t* internal) { + intel_code_t brand_code; + intel_model_t model_code; + int i; + char* brand_code_str = NULL; + load_intel_features(raw, data); if (raw->basic_cpuid[0][0] >= 4) { /* Deterministic way is preferred, being more generic */ @@ -785,10 +790,8 @@ int cpuid_identify_intel(struct cpu_raw_data_t* raw, struct cpu_id_t* data, stru } decode_intel_number_of_cores(raw, data); - intel_code_t brand_code = get_brand_code(data); - intel_model_t model_code = get_model_code(data); - int i; - char* brand_code_str = NULL; + brand_code = get_brand_code(data); + model_code = get_model_code(data); for (i = 0; i < COUNT_OF(intel_bcode_str); i++) { if (brand_code == intel_bcode_str[i].code) { brand_code_str = intel_bcode_str[i].str;