mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-25 07:50:40 +01:00
Fixed little bug in cache print and changed message when no cache level was found
This commit is contained in:
4
main.c
4
main.c
@@ -51,8 +51,8 @@ int main() {
|
|||||||
printf(TITLE_AES"%s\n",aes);
|
printf(TITLE_AES"%s\n",aes);
|
||||||
printf(TITLE_SHA"%s\n",sha);
|
printf(TITLE_SHA"%s\n",sha);
|
||||||
printf(TITLE_L1"%s\n",l1);
|
printf(TITLE_L1"%s\n",l1);
|
||||||
printf(TITLE_L3"%s\n",l2);
|
printf(TITLE_L2"%s\n",l2);
|
||||||
printf(TITLE_L2"%s\n",l3);
|
printf(TITLE_L3"%s\n",l3);
|
||||||
printf(TITLE_PEAK"%s\n","??? GFLOP/s");
|
printf(TITLE_PEAK"%s\n","??? GFLOP/s");
|
||||||
|
|
||||||
free(cpuName);
|
free(cpuName);
|
||||||
|
|||||||
14
udev.c
14
udev.c
@@ -115,20 +115,34 @@ char* getString_L1(struct cache* cach) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
char* getString_L2(struct cache* cach) {
|
char* getString_L2(struct cache* cach) {
|
||||||
|
if(cach->L2 == NO_CACHE) {
|
||||||
|
char* string = malloc(sizeof(char)*5);
|
||||||
|
snprintf(string,5,"None");
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
else {
|
||||||
//Max 4 digits and 2 for 'KB'
|
//Max 4 digits and 2 for 'KB'
|
||||||
int size = (4+2+1);
|
int size = (4+2+1);
|
||||||
char* string = malloc(sizeof(char)*size);
|
char* string = malloc(sizeof(char)*size);
|
||||||
snprintf(string,size,"%dKB",cach->L2/1024);
|
snprintf(string,size,"%dKB",cach->L2/1024);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char* getString_L3(struct cache* cach) {
|
char* getString_L3(struct cache* cach) {
|
||||||
|
if(cach->L3 == NO_CACHE) {
|
||||||
|
char* string = malloc(sizeof(char)*5);
|
||||||
|
snprintf(string,5,"None");
|
||||||
|
return string;
|
||||||
|
}
|
||||||
|
else {
|
||||||
//Max 4 digits and 2 for 'KB'
|
//Max 4 digits and 2 for 'KB'
|
||||||
int size = (4+2+1);
|
int size = (4+2+1);
|
||||||
char* string = malloc(sizeof(char)*size);
|
char* string = malloc(sizeof(char)*size);
|
||||||
snprintf(string,size,"%dKB",cach->L3/1024);
|
snprintf(string,size,"%dKB",cach->L3/1024);
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char* getString_MaxFrequency(struct frequency* freq) {
|
char* getString_MaxFrequency(struct frequency* freq) {
|
||||||
//Max 4 digits and 3 for 'MHz' plus 1 for '\0'
|
//Max 4 digits and 3 for 'MHz' plus 1 for '\0'
|
||||||
|
|||||||
Reference in New Issue
Block a user