1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2025-01-23 20:06:41 +00:00

Fix unused parameters

This commit is contained in:
The Tumultuous Unicorn Of Darkness 2022-11-11 17:50:34 +01:00
parent d8c3f3365a
commit feccd8f7c8
No known key found for this signature in database
GPG key ID: 1E55EE2EFF18BC1A
4 changed files with 10 additions and 14 deletions

View file

@ -30,7 +30,7 @@ if(UNIX)
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/lib")
set(includedir "\${prefix}/include")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wuninitialized -Wstrict-prototypes -Wformat -Wformat-security")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wuninitialized -Wstrict-prototypes -Wformat -Wformat-security -Wunused-parameter")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/libcpuid.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libcpuid.pc" ESCAPE_QUOTES
@ONLY)
install(FILES "${PROJECT_BINARY_DIR}/libcpuid.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")

View file

@ -246,10 +246,10 @@ void debug_print_lbits(int debuglevel, uint64_t mask)
int i, first = 0;
for (i = 0; i < 64; i++) if (mask & (((uint64_t) 1) << i)) {
if (first) first = 0;
else debugf(2, " + ");
debugf(2, "LBIT(%d)", i);
else debugf(debuglevel, " + ");
debugf(debuglevel, "LBIT(%d)", i);
}
debugf(2, "\n");
debugf(debuglevel, "\n");
}
/* Functions to manage cpu_affinity_mask_t type

View file

@ -596,7 +596,7 @@ static struct amd_code_and_bits_t decode_amd_codename_part1(const char *bs)
return result;
}
static void decode_amd_codename(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct internal_id_info_t* internal)
static void decode_amd_codename(struct cpu_id_t* data, struct internal_id_info_t* internal)
{
struct amd_code_and_bits_t code_and_bits = decode_amd_codename_part1(data->brand_str);
int i = 0;
@ -637,7 +637,7 @@ int cpuid_identify_amd(struct cpu_raw_data_t* raw, struct cpu_id_t* data, struct
else
decode_amd_cache_info(raw, data);
decode_amd_number_of_cores(raw, data);
decode_amd_codename(raw, data, internal);
decode_amd_codename(data, internal);
return 0;
}

View file

@ -622,9 +622,7 @@ static void decode_intel_oldstyle_cache_info(struct cpu_raw_data_t* raw, struct
}
}
static int decode_intel_extended_topology(struct cpu_raw_data_t* raw,
struct cpu_id_t* data,
struct internal_id_info_t* internal)
static int decode_intel_extended_topology(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
int i, level_type, num_smt = -1, num_core = -1;
@ -651,14 +649,12 @@ static int decode_intel_extended_topology(struct cpu_raw_data_t* raw,
return 1;
}
static void decode_intel_number_of_cores(struct cpu_raw_data_t* raw,
struct cpu_id_t* data,
struct internal_id_info_t* internal)
static void decode_intel_number_of_cores(struct cpu_raw_data_t* raw, struct cpu_id_t* data)
{
int logical_cpus = -1, num_cores = -1;
if (raw->basic_cpuid[0][EAX] >= 11) {
if (decode_intel_extended_topology(raw, data, internal)) return;
if (decode_intel_extended_topology(raw, data)) return;
}
if (raw->basic_cpuid[0][EAX] >= 1) {
@ -941,7 +937,7 @@ int cpuid_identify_intel(struct cpu_raw_data_t* raw, struct cpu_id_t* data, stru
} else if (raw->basic_cpuid[0][EAX] >= 2) {
decode_intel_oldstyle_cache_info(raw, data);
}
decode_intel_number_of_cores(raw, data, internal);
decode_intel_number_of_cores(raw, data);
data->purpose = cpuid_identify_purpose_intel(raw);
brand = get_brand_code_and_bits(data);