[v0.98][Refactoring] Use int for peak performance, which makes code cleaner

This commit is contained in:
Dr-Noob
2021-08-06 11:04:29 +02:00
parent 6953d8dda5
commit c24dd7cbb6
9 changed files with 106 additions and 115 deletions

View File

@@ -446,9 +446,6 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
if(art == NULL)
return false;
double flops;
bool valid_pp = get_peak_performance(cpu, cpu->topo, get_freq(cpu->freq), &flops);
char* uarch = get_str_uarch(cpu);
char* manufacturing_process = get_str_process(cpu);
char* sockets = get_str_sockets(cpu->topo);
@@ -463,7 +460,7 @@ bool print_cpufetch_x86(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
char* l1d = get_str_l1d(cpu->cach);
char* l2 = get_str_l2(cpu->cach);
char* l3 = get_str_l3(cpu->cach);
char* pp = get_str_peak_performance(flops, valid_pp);
char* pp = get_str_peak_performance(cpu->peak_performance);
setAttribute(art,ATTRIBUTE_NAME,cpu_name);
if(cpu->hv->present) {
@@ -570,9 +567,6 @@ bool print_cpufetch_ppc(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
if(art == NULL)
return false;
double flops;
bool valid_pp = get_peak_performance(cpu, cpu->topo, get_freq(cpu->freq), &flops);
char* uarch = get_str_uarch(cpu);
char* manufacturing_process = get_str_process(cpu);
char* sockets = get_str_sockets(cpu->topo);
@@ -586,7 +580,7 @@ bool print_cpufetch_ppc(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
char* l1d = get_str_l1d(cpu->cach);
char* l2 = get_str_l2(cpu->cach);
char* l3 = get_str_l3(cpu->cach);
char* pp = get_str_peak_performance(flops, valid_pp);
char* pp = get_str_peak_performance(cpu->peak_performance);
if(cpu_name != NULL) {
setAttribute(art,ATTRIBUTE_NAME,cpu_name);
@@ -792,9 +786,7 @@ bool print_cpufetch_arm(struct cpuInfo* cpu, STYLE s, struct colors* cs) {
}
}
}
double flops;
bool valid_pp = get_peak_performance(cpu, &flops);
char* pp = get_str_peak_performance(flops, valid_pp);
char* pp = get_str_peak_performance(cpu->peak_performance);
setAttribute(art,ATTRIBUTE_PEAK,pp);
if(art->n_attributes_set > NUMBER_OF_LINES) {