1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-12-16 16:35:45 +00:00

Port to MSVC7.1: C89 compliance and project updates.

This commit is contained in:
Veselin Georgiev 2016-07-09 05:48:35 +03:00
parent 568db71156
commit 03d54ae61c
3 changed files with 18 additions and 5 deletions

View file

@ -178,15 +178,24 @@
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\amd_code_t.h">
</File>
<File
RelativePath=".\asm-bits.h">
</File>
<File
RelativePath=".\intel_code_t.h">
</File>
<File
RelativePath=".\libcpuid.h">
</File>
<File
RelativePath=".\libcpuid_constants.h">
</File>
<File
RelativePath=".\libcpuid_internal.h">
</File>
<File
RelativePath=".\libcpuid_types.h">
</File>

View file

@ -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);

View file

@ -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;