[v0.96] Fix AMD ASCII art. Add third digit in frequency output

This commit is contained in:
Dr-Noob
2021-03-31 11:03:54 +02:00
parent 2f61ebd35a
commit 8abbd8f69f
3 changed files with 10 additions and 10 deletions

View File

@@ -12,10 +12,10 @@
\ \
\ \
@@@@ @@@ @@@ @@@@@@@@ ############ \ @@@@ @@@ @@@ @@@@@@@@ ############ \
@@@@@@ @@@@@ @@@@ @@@ @@@@ ########## \ @@@@@@ @@@@@ @@@@@ @@@ @@@ ########## \
@@@ @@@ @@@@@@@@@@@@@ @@@ @@ # #### \ @@@ @@@ @@@@@@@@@@@@@ @@@ @@ # ##### \
@@@ @@@ @@@ @@@ @@@ @@@ @@@ ### #### \ @@@ @@@ @@@ @@@ @@@ @@@ @@ ### ##### \
@@@@@@@@@@@@ @@@ @@@ @@@ @@@ #### ## ### \ @@@@@@@@@@@@ @@@ @@@ @@@ @@@ ######### ### \
@@@ @@@ @@@ @@@ @@@@@@@@@ ######## ## \ @@@ @@@ @@@ @@@ @@@@@@@@@ ######## ## \
\ \
\ \

View File

@@ -147,18 +147,18 @@ char* get_str_l3(struct cache* cach) {
char* get_str_freq(struct frequency* freq) { char* get_str_freq(struct frequency* freq) {
//Max 3 digits and 3 for '(M/G)Hz' plus 1 for '\0' //Max 3 digits and 3 for '(M/G)Hz' plus 1 for '\0'
uint32_t size = (4+3+1); uint32_t size = (5+1+3+1);
assert(strlen(STRING_UNKNOWN)+1 <= size); assert(strlen(STRING_UNKNOWN)+1 <= size);
char* string = malloc(sizeof(char)*size); char* string = malloc(sizeof(char)*size);
memset(string, 0, sizeof(char)*size); memset(string, 0, sizeof(char)*size);
if(freq->max == UNKNOWN_FREQ || freq->max < 0) if(freq->max == UNKNOWN_FREQ || freq->max < 0)
snprintf(string,strlen(STRING_UNKNOWN)+1,STRING_UNKNOWN); snprintf(string,strlen(STRING_UNKNOWN)+1,STRING_UNKNOWN);
else if(freq->max >= 1000) else if(freq->max >= 1000)
snprintf(string,size,"%.2f"STRING_GIGAHERZ,(float)(freq->max)/1000); snprintf(string,size,"%.3f "STRING_GIGAHERZ,(float)(freq->max)/1000);
else else
snprintf(string,size,"%d"STRING_MEGAHERZ,freq->max); snprintf(string,size,"%d "STRING_MEGAHERZ,freq->max);
return string; return string;
} }

View File

@@ -13,7 +13,7 @@
#include "../arm/midr.h" #include "../arm/midr.h"
#endif #endif
static const char* VERSION = "0.95"; static const char* VERSION = "0.96";
void print_help(char *argv[]) { void print_help(char *argv[]) {
printf("Usage: %s [--version] [--help] [--debug] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n", argv[0]); printf("Usage: %s [--version] [--help] [--debug] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n", argv[0]);