Skip to content

Commit

Permalink
vo_tct: fix bstr initializer is not constant
Browse files Browse the repository at this point in the history
  • Loading branch information
na-na-hi committed Apr 7, 2024
1 parent 74b8395 commit 0a78ed3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions misc/bstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static inline struct bstr bstrdup(void *talloc_ctx, struct bstr str)
}

#define bstr0_s(s) (struct bstr){(unsigned char *)(s), (s) ? strlen(s) : 0}
#define bstr0_lit(s) {(unsigned char *)(s), (s) ? sizeof(s) - 1 : 0}

static inline struct bstr bstr0(const char *s)
{
Expand Down
12 changes: 6 additions & 6 deletions video/out/vo_tct.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
#define DEFAULT_WIDTH 80
#define DEFAULT_HEIGHT 25

static const bstr TERM_ESC_CLEAR_COLORS = bstr0_s("\033[0m");
static const bstr TERM_ESC_COLOR256_BG = bstr0_s("\033[48;5");
static const bstr TERM_ESC_COLOR256_FG = bstr0_s("\033[38;5");
static const bstr TERM_ESC_COLOR24BIT_BG = bstr0_s("\033[48;2");
static const bstr TERM_ESC_COLOR24BIT_FG = bstr0_s("\033[38;2");
static const bstr TERM_ESC_CLEAR_COLORS = bstr0_lit("\033[0m");
static const bstr TERM_ESC_COLOR256_BG = bstr0_lit("\033[48;5");
static const bstr TERM_ESC_COLOR256_FG = bstr0_lit("\033[38;5");
static const bstr TERM_ESC_COLOR24BIT_BG = bstr0_lit("\033[48;2");
static const bstr TERM_ESC_COLOR24BIT_FG = bstr0_lit("\033[38;2");

static const bstr UNICODE_LOWER_HALF_BLOCK = bstr0_s("\xe2\x96\x84");
static const bstr UNICODE_LOWER_HALF_BLOCK = bstr0_lit("\xe2\x96\x84");

#define WRITE_STR(str) fwrite((str), strlen(str), 1, stdout)

Expand Down

0 comments on commit 0a78ed3

Please sign in to comment.