paleofetch

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit a110e67fe4858b4ea20a95ccb5b000428c31a642
parent e178652c3b11740421e85dc26e3a7a89f17e364f
Author: sam-barr <samfbarr@outlook.com>
Date:   Fri, 24 Apr 2020 09:53:24 -0500

removed need to specify string length

Diffstat:
Mconfig.h | 20+++++++++-----------
Mpaleofetch.c | 1-
Mpaleofetch.h | 1+
3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/config.h b/config.h @@ -26,19 +26,17 @@ #define CPU_REMOVE \ { \ - /* string length */ \ - { "(R)", 3 }, \ - { "(TM)", 4 }, \ - { "Dual-Core", 9 }, \ - { "Quad-Core", 9 }, \ - { "Six-Core", 8 }, \ - { "Eight-Core", 10 }, \ - { "Core", 4 }, \ - { "CPU", 3 }, \ + REMOVE("(R)"), \ + REMOVE("(TM)"), \ + REMOVE("Dual-Core"), \ + REMOVE("Quad-Core"), \ + REMOVE("Six-Core"), \ + REMOVE("Eight-Core"), \ + REMOVE("Core"), \ + REMOVE("CPU"), \ }; #define GPU_REMOVE \ { \ - /* string length */ \ - { "Corporation", 11 }, \ + REMOVE("Corporation"), \ }; diff --git a/paleofetch.c b/paleofetch.c @@ -17,7 +17,6 @@ #define BUF_SIZE 150 #define COUNT(x) (int)(sizeof x / sizeof *x) -#define REMOVE_CONST_STRING(A, B) remove_substring((A), (B), sizeof(B) - 1) struct conf { char *label, *(*function)(); diff --git a/paleofetch.h b/paleofetch.h @@ -20,3 +20,4 @@ char *get_title(), *spacer(); #define SPACER {"", spacer, false}, +#define REMOVE(A) { (A), sizeof(A) }