diff --git a/src/arm/midr.c b/src/arm/midr.c index f75ea8b..374e90a 100644 --- a/src/arm/midr.c +++ b/src/arm/midr.c @@ -141,7 +141,7 @@ void init_cpu_info(struct cpuInfo* cpu) { // true... // ARM32 https://elixir.bootlin.com/linux/latest/source/arch/arm/include/uapi/asm/hwcap.h // ARM64 https://elixir.bootlin.com/linux/latest/source/arch/arm64/include/uapi/asm/hwcap.h -struct features* get_features_info() { +struct features* get_features_info(void) { struct features* feat = emalloc(sizeof(struct features)); bool *ptr = &(feat->AES); for(uint32_t i = 0; i < sizeof(struct features)/sizeof(bool); i++, ptr++) { @@ -371,7 +371,7 @@ struct cpuInfo* get_cpu_info_mach(struct cpuInfo* cpu) { } #endif -struct cpuInfo* get_cpu_info() { +struct cpuInfo* get_cpu_info(void) { struct cpuInfo* cpu = malloc(sizeof(struct cpuInfo)); init_cpu_info(cpu); diff --git a/src/arm/midr.h b/src/arm/midr.h index 9da3bb6..a133ca0 100644 --- a/src/arm/midr.h +++ b/src/arm/midr.h @@ -3,7 +3,7 @@ #include "../common/cpu.h" -struct cpuInfo* get_cpu_info(); +struct cpuInfo* get_cpu_info(void); uint32_t get_nsockets(struct topology* topo); char* get_str_topology(struct cpuInfo* cpu, struct topology* topo, bool dual_socket); diff --git a/src/arm/soc.c b/src/arm/soc.c index 3a5c975..fa3d6f2 100644 --- a/src/arm/soc.c +++ b/src/arm/soc.c @@ -702,7 +702,7 @@ struct system_on_chip* guess_soc_apple(struct system_on_chip* soc) { } #endif -struct system_on_chip* get_soc() { +struct system_on_chip* get_soc(void) { struct system_on_chip* soc = emalloc(sizeof(struct system_on_chip)); soc->raw_name = NULL; soc->soc_vendor = SOC_VENDOR_UNKNOWN; diff --git a/src/arm/soc.h b/src/arm/soc.h index 257fc4a..5a0aae7 100644 --- a/src/arm/soc.h +++ b/src/arm/soc.h @@ -25,7 +25,7 @@ struct system_on_chip { char* raw_name; }; -struct system_on_chip* get_soc(); +struct system_on_chip* get_soc(void); char* get_soc_name(struct system_on_chip* soc); VENDOR get_soc_vendor(struct system_on_chip* soc); char* get_str_process(struct system_on_chip* soc); diff --git a/src/arm/udev.c b/src/arm/udev.c index 98c06b9..1fe0a1b 100644 --- a/src/arm/udev.c +++ b/src/arm/udev.c @@ -129,15 +129,15 @@ char* get_field_from_cpuinfo(char* CPUINFO_FIELD) { return hardware; } -char* get_hardware_from_cpuinfo() { +char* get_hardware_from_cpuinfo(void) { return get_field_from_cpuinfo(CPUINFO_HARDWARE_STR); } -char* get_revision_from_cpuinfo() { +char* get_revision_from_cpuinfo(void) { return get_field_from_cpuinfo(CPUINFO_REVISION_STR); } -bool is_raspberry_pi() { +bool is_raspberry_pi(void) { int filelen; char* buf; if((buf = read_file(_PATH_DEVICETREE_MODEL, &filelen)) == NULL) { diff --git a/src/arm/udev.h b/src/arm/udev.h index f3c52a0..e6ef072 100644 --- a/src/arm/udev.h +++ b/src/arm/udev.h @@ -4,11 +4,11 @@ #include "../common/udev.h" #define UNKNOWN -1 -int get_ncores_from_cpuinfo(); +int get_ncores_from_cpuinfo(void); uint32_t get_midr_from_cpuinfo(uint32_t core, bool* success); -char* get_hardware_from_cpuinfo(); -char* get_revision_from_cpuinfo(); -bool is_raspberry_pi(); +char* get_hardware_from_cpuinfo(void); +char* get_revision_from_cpuinfo(void); +bool is_raspberry_pi(void); #endif diff --git a/src/common/args.c b/src/common/args.c index 475855e..7da6194 100644 --- a/src/common/args.c +++ b/src/common/args.c @@ -71,59 +71,59 @@ const char *args_str[] = { static struct args_struct args; -STYLE get_style() { +STYLE get_style(void) { return args.style; } -struct color** get_colors() { +struct color** get_colors(void) { return args.colors; } -bool show_help() { +bool show_help(void) { return args.help_flag; } -bool show_version() { +bool show_version(void) { return args.version_flag; } -bool show_debug() { +bool show_debug(void) { return args.debug_flag; } -bool show_raw() { +bool show_raw(void) { return args.raw_flag; } -bool accurate_pp() { +bool accurate_pp(void) { return args.accurate_pp; } -bool show_full_cpu_name() { +bool show_full_cpu_name(void) { return args.full_cpu_name_flag; } -bool show_logo_long() { +bool show_logo_long(void) { return args.logo_long; } -bool show_logo_short() { +bool show_logo_short(void) { return args.logo_short; } -bool show_logo_intel_new() { +bool show_logo_intel_new(void) { return args.logo_intel_new; } -bool show_logo_intel_old() { +bool show_logo_intel_old(void) { return args.logo_intel_old; } -bool verbose_enabled() { +bool verbose_enabled(void) { return args.verbose_flag; } -int max_arg_str_length() { +int max_arg_str_length(void) { int max_len = -1; int len = sizeof(args_str) / sizeof(args_str[0]); for(int i=0; i < len; i++) { @@ -211,7 +211,7 @@ bool parse_color(char* optarg_str, struct color*** cs) { return true; } -char* build_short_options() { +char* build_short_options(void) { const char *c = args_chr; int len = sizeof(args_chr) / sizeof(args_chr[0]); char* str = (char *) emalloc(sizeof(char) * (len*2 + 1)); diff --git a/src/common/args.h b/src/common/args.h index 7e7c3a9..116c178 100644 --- a/src/common/args.h +++ b/src/common/args.h @@ -39,21 +39,21 @@ extern const char *args_str[]; #include "printer.h" -int max_arg_str_length(); +int max_arg_str_length(void); bool parse_args(int argc, char* argv[]); -bool show_help(); -bool accurate_pp(); -bool show_full_cpu_name(); -bool show_logo_long(); -bool show_logo_short(); -bool show_logo_intel_new(); -bool show_logo_intel_old(); -bool show_raw(); -bool show_debug(); -bool show_version(); -bool verbose_enabled(); +bool show_help(void); +bool accurate_pp(void); +bool show_full_cpu_name(void); +bool show_logo_long(void); +bool show_logo_short(void); +bool show_logo_intel_new(void); +bool show_logo_intel_old(void); +bool show_raw(void); +bool show_debug(void); +bool show_version(void); +bool verbose_enabled(void); void free_colors_struct(struct color** cs); -struct color** get_colors(); -STYLE get_style(); +struct color** get_colors(void); +STYLE get_style(void); #endif diff --git a/src/common/printer.c b/src/common/printer.c index c0e581f..16c58d2 100644 --- a/src/common/printer.c +++ b/src/common/printer.c @@ -909,7 +909,7 @@ bool print_cpufetch_arm(struct cpuInfo* cpu, STYLE s, struct color** cs, struct } #endif -struct terminal* get_terminal_size() { +struct terminal* get_terminal_size(void) { struct terminal* term = emalloc(sizeof(struct terminal)); #ifdef _WIN32 diff --git a/src/common/udev.c b/src/common/udev.c index 1f14c4c..66c1d52 100644 --- a/src/common/udev.c +++ b/src/common/udev.c @@ -3,7 +3,7 @@ #include "cpu.h" // https://www.kernel.org/doc/html/latest/core-api/cpu_hotplug.html -int get_ncores_from_cpuinfo() { +int get_ncores_from_cpuinfo(void) { // Examples: // 0-271 // 0-7 diff --git a/src/common/udev.h b/src/common/udev.h index ece967c..bf83493 100644 --- a/src/common/udev.h +++ b/src/common/udev.h @@ -36,6 +36,6 @@ long get_l1d_cache_size(uint32_t core); long get_l2_cache_size(uint32_t core); long get_l3_cache_size(uint32_t core); int get_num_caches_by_level(struct cpuInfo* cpu, uint32_t level); -int get_ncores_from_cpuinfo(); +int get_ncores_from_cpuinfo(void); #endif diff --git a/src/ppc/ppc.c b/src/ppc/ppc.c index 1a5d3d9..50b0897 100644 --- a/src/ppc/ppc.c +++ b/src/ppc/ppc.c @@ -111,7 +111,7 @@ struct topology* get_topology_info(struct cache* cach) { return topo; } -static inline uint32_t mfpvr() { +static inline uint32_t mfpvr(void) { uint32_t pvr; asm ("mfpvr %0" @@ -123,7 +123,7 @@ struct uarch* get_cpu_uarch(struct cpuInfo* cpu) { return get_uarch_from_pvr(cpu->pvr); } -struct frequency* get_frequency_info() { +struct frequency* get_frequency_info(void) { struct frequency* freq = emalloc(sizeof(struct frequency)); freq->max = get_max_freq_from_file(0); @@ -158,7 +158,7 @@ int64_t get_peak_performance(struct cpuInfo* cpu, struct topology* topo, int64_t return flops; } -struct cpuInfo* get_cpu_info() { +struct cpuInfo* get_cpu_info(void) { struct cpuInfo* cpu = emalloc(sizeof(struct cpuInfo)); struct features* feat = emalloc(sizeof(struct features)); cpu->feat = feat; diff --git a/src/ppc/ppc.h b/src/ppc/ppc.h index 87e8af2..7b827b1 100644 --- a/src/ppc/ppc.h +++ b/src/ppc/ppc.h @@ -3,7 +3,7 @@ #include "../common/cpu.h" -struct cpuInfo* get_cpu_info(); +struct cpuInfo* get_cpu_info(void); char* get_str_altivec(struct cpuInfo* cpu); char* get_str_topology(struct topology* topo, bool dual_socket); void print_debug(struct cpuInfo* cpu); diff --git a/src/x86/cpuid.c b/src/x86/cpuid.c index fdc8869..bbbcbac 100644 --- a/src/x86/cpuid.c +++ b/src/x86/cpuid.c @@ -70,7 +70,7 @@ void get_name_cpuid(char* name, uint32_t reg1, uint32_t reg2, uint32_t reg3) { name[c++] = (reg3>>24) & MASK; } -char* get_str_cpu_name_internal() { +char* get_str_cpu_name_internal(void) { uint32_t eax = 0; uint32_t ebx = 0; uint32_t ecx = 0; @@ -412,7 +412,7 @@ bool set_cpu_module(int m, int total_modules, int32_t* first_core) { return true; } -int32_t get_core_type() { +int32_t get_core_type(void) { uint32_t eax = 0x0000001A; uint32_t ebx = 0; uint32_t ecx = 0; @@ -430,7 +430,7 @@ int32_t get_core_type() { } } -struct cpuInfo* get_cpu_info() { +struct cpuInfo* get_cpu_info(void) { struct cpuInfo* cpu = emalloc(sizeof(struct cpuInfo)); cpu->peak_performance = -1; cpu->next_cpu = NULL; diff --git a/src/x86/cpuid.h b/src/x86/cpuid.h index 3b0e21b..a0a6a5c 100644 --- a/src/x86/cpuid.h +++ b/src/x86/cpuid.h @@ -3,7 +3,7 @@ #include "../common/cpu.h" -struct cpuInfo* get_cpu_info(); +struct cpuInfo* get_cpu_info(void); struct cache* get_cache_info(struct cpuInfo* cpu); struct frequency* get_frequency_info(struct cpuInfo* cpu); struct topology* get_topology_info(struct cpuInfo* cpu, struct cache* cach, int module); diff --git a/src/x86/freq/freq_avx.c b/src/x86/freq/freq_avx.c index 29bf667..04354eb 100644 --- a/src/x86/freq/freq_avx.c +++ b/src/x86/freq/freq_avx.c @@ -10,7 +10,7 @@ #include #include "freq.h" -void* compute_avx() { +void* compute_avx(void) { bool end = false; struct timeval begin, now; diff --git a/src/x86/freq/freq_avx.h b/src/x86/freq/freq_avx.h index 5a3de14..43858d1 100644 --- a/src/x86/freq/freq_avx.h +++ b/src/x86/freq/freq_avx.h @@ -1,6 +1,6 @@ #ifndef __FREQ_AVX__ #define __FREQ_AVX__ -void* compute_avx(); +void* compute_avx(void); #endif diff --git a/src/x86/freq/freq_avx512.c b/src/x86/freq/freq_avx512.c index df3ace1..e602159 100644 --- a/src/x86/freq/freq_avx512.c +++ b/src/x86/freq/freq_avx512.c @@ -10,7 +10,7 @@ #include #include "freq.h" -void* compute_avx512() { +void* compute_avx512(void) { bool end = false; struct timeval begin, now; diff --git a/src/x86/freq/freq_avx512.h b/src/x86/freq/freq_avx512.h index 53aefb3..388c19c 100644 --- a/src/x86/freq/freq_avx512.h +++ b/src/x86/freq/freq_avx512.h @@ -1,6 +1,6 @@ #ifndef __FREQ_AVX512__ #define __FREQ_AVX512__ -void* compute_avx512(); +void* compute_avx512(void); #endif diff --git a/src/x86/freq/freq_nov.c b/src/x86/freq/freq_nov.c index b351713..4fd09a7 100644 --- a/src/x86/freq/freq_nov.c +++ b/src/x86/freq/freq_nov.c @@ -10,7 +10,7 @@ #include #include "freq.h" -void* compute_nov() { +void* compute_nov(void) { bool end = false; struct timeval begin, now; diff --git a/src/x86/freq/freq_nov.h b/src/x86/freq/freq_nov.h index 1073e6c..304b800 100644 --- a/src/x86/freq/freq_nov.h +++ b/src/x86/freq/freq_nov.h @@ -1,6 +1,6 @@ #ifndef __FREQ_NO_VECTOR__ #define __FREQ_NO_VECTOR__ -void* compute_nov(); +void* compute_nov(void); #endif