summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/main.c b/main.c
index 568dd78..0f3cf31 100644
--- a/main.c
+++ b/main.c
@@ -63,7 +63,7 @@
/* colors */
#define CPAIR_ENUM_X(cp, fg, bg, name) cp,
-#define CPAIR_NAME_X(cp, fg, bg, name) S(name),
+#define CPAIR_NAME_X(cp, fg, bg, name) Ss(name),
#define CPAIR_INIT_X(cp, fg, bg, name) init_pair(cp, fg, bg);
#define CPAIR_OPT_X(cp, f, b, name) [cp] = { .fg = f, .bg = b, .init = 1 },
#define COLOR_NORM -1
@@ -91,7 +91,7 @@ typedef enum {
} ColorPair;
Str cpair_name[CPAIR_MAX] = {
- S("default"),
+ Ss("default"),
CPAIR_LIST(CPAIR_NAME_X)
};
@@ -1021,18 +1021,20 @@ int parse_color(Str s) {
Str s;
int v;
} color_map[] = {
- { S("default"), -1 },
- { S("black"), COLOR_BLACK },
- { S("red"), COLOR_RED },
- { S("green"), COLOR_GREEN },
- { S("yellow"), COLOR_YELLOW },
- { S("blue"), COLOR_BLUE },
- { S("magenta"), COLOR_MAGENTA },
- { S("cyan"), COLOR_CYAN },
- { S("white"), COLOR_WHITE },
+ { Ss("default"), -1 },
+ { Ss("black"), COLOR_BLACK },
+ { Ss("red"), COLOR_RED },
+ { Ss("green"), COLOR_GREEN },
+ { Ss("yellow"), COLOR_YELLOW },
+ { Ss("blue"), COLOR_BLUE },
+ { Ss("magenta"), COLOR_MAGENTA },
+ { Ss("cyan"), COLOR_CYAN },
+ { Ss("white"), COLOR_WHITE },
};
for (size_t i = 0; i < sizeof color_map / sizeof *color_map; i++) {
- if (str_eql(s, color_map[i].s)) return color_map[i].v;
+ if (str_eql(s, color_map[i].s)) {
+ return color_map[i].v;
+ }
}
return BAD_COLOR;
}