diff --git a/CMakeLists.txt b/CMakeLists.txt index 40c352d..4aa6f53 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/libcpuid/libcpuid_util.c b/libcpuid/libcpuid_util.c index 4362cc7..f2281f8 100644 --- a/libcpuid/libcpuid_util.c +++ b/libcpuid/libcpuid_util.c @@ -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 diff --git a/libcpuid/recog_amd.c b/libcpuid/recog_amd.c index c961d7a..81cf3f9 100644 --- a/libcpuid/recog_amd.c +++ b/libcpuid/recog_amd.c @@ -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; } diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index 428885a..c4dd9d9 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -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);