diff options
author | wrmr | 2025-10-08 19:29:10 -0400 |
---|---|---|
committer | wrmr | 2025-10-08 19:29:10 -0400 |
commit | e9d374f44300f67d4f3974c043b0c0588bfdb869 (patch) | |
tree | 3f5da92ba0acd9eee3e43d51ceaf2dcee44d3ed8 | |
parent | 46a9842938333a58a051d031e724f35f5caf56de (diff) |
changes to make GCC shut up
-rw-r--r-- | main.c | 26 | ||||
-rw-r--r-- | str.h | 3 |
2 files changed, 16 insertions, 13 deletions
@@ -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; } @@ -15,7 +15,8 @@ typedef struct { Str head, tail; } Cut; -#define S(s) (Str){s,sizeof(s)-1} +#define Ss(s) {s,sizeof(s)-1} +#define S(s) (Str)Ss(s) char *str_to_cstr(Str s, Arena *a); Str str_from_cstr(const char *s); |