ncmetric: tighten up PREFIXFWIDTH macros

This commit is contained in:
nick black 2020-05-22 09:14:21 -04:00
parent bec9691999
commit 24dae2cf15
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -2352,9 +2352,9 @@ API struct ncplane* nctablet_ncplane(struct nctablet* t);
#define PREFIXFWIDTH(x) ((int)(strlen(x) - mbswidth(x) + PREFIXCOLUMNS))
#define IPREFIXFWIDTH(x) ((int)(strlen(x) - mbswidth(x) + IPREFIXCOLUMNS))
#define BPREFIXFWIDTH(x) ((int)(strlen(x) - mbswidth(x) + BPREFIXCOLUMNS))
#define PREFIXFMT(x) PREFIXFWIDTH(x), x
#define IPREFIXFMT(x) IPREFIXFWIDTH(x), x
#define BPREFIXFMT(x) BPREFIXFWIDTH(x), x
#define PREFIXFMT(x) PREFIXFWIDTH(x), (x)
#define IPREFIXFMT(x) IPREFIXFWIDTH(x), (x)
#define BPREFIXFMT(x) BPREFIXFWIDTH(x), (x)
// Takes an arbitrarily large number, and prints it into a fixed-size buffer by
// adding the necessary SI suffix. Usually, pass a |[IB]PREFIXSTRLEN+1|-sized