sled

Једноставни уређивач текста
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

чување ad0624a201e13d30df839fae959cab2133b7c6d4
родитељ a7ff1293346920871e45465f731bb1dc15b0df09
Аутор: Страхиња Радић <contact@strahinja.org>
Датум:   Sun,  5 Jun 2022 01:30:44 +0200

Fix compilation in non-GCC compilers

Signed-off-by: Страхиња Радић <contact@strahinja.org>

Diffstat:
Mdraw.h | 12++++++------
Msled.c | 2+-
Msled.do | 2+-
Mutil.c | 4++--
измењених датотека: 4, додавања: 10(+), брисања: 10(-)

diff --git a/draw.h b/draw.h @@ -7,12 +7,12 @@ #define TB_OPT_V1_COMPAT #include "termbox.h" -#define BORDER_NW ((uint32_t)L'\u250c') -#define BORDER_NE ((uint32_t)L'\u2510') -#define BORDER_SW ((uint32_t)L'\u2514') -#define BORDER_SE ((uint32_t)L'\u2518') -#define BORDER_VER ((uint32_t)L'\u2502') -#define BORDER_HOR ((uint32_t)L'\u2500') +#define BORDER_NW ((uint32_t)0x250c) +#define BORDER_NE ((uint32_t)0x2510) +#define BORDER_SW ((uint32_t)0x2514) +#define BORDER_SE ((uint32_t)0x2518) +#define BORDER_VER ((uint32_t)0x2502) +#define BORDER_HOR ((uint32_t)0x2500) #define HELP_WIDTH 60 #define HELP_HEIGHT 22 diff --git a/sled.c b/sled.c @@ -267,7 +267,7 @@ handle_key_event(struct tb_event* ev, struct DrawState* state) { if ((IN(state->mode, M_INPUT_NUM) && u32_strchr( - (const uint32_t*)L"0123456789", + (const uint32_t*)"0123456789", ev->ch)) || !IN(state->mode, M_INPUT_NUM)) input_insert_char(state, ev->ch); diff --git a/sled.do b/sled.do @@ -5,4 +5,4 @@ for f in *.h *.c; do echo $f echo $f | sed -e's/\.c$/.o/g' done | xargs redo-ifchange -${SLED_CC:-gcc -g} -Wall -std=c99 -o $3 sled.o draw.o util.o +${SLED_CC:-gcc -g} -Wall -std=c99 -o $3 sled.o draw.o util.o >/dev/null diff --git a/util.c b/util.c @@ -206,8 +206,8 @@ int u32_is_word_boundary(const uint32_t ch, const int strictly_whitespace) { return strictly_whitespace - ? u32_strchr((uint32_t*)L" \v\t", ch) != NULL - : u32_strchr((uint32_t*)L" \v\t()[]{},.;:/\\", ch) != NULL; + ? u32_strchr((uint32_t*)" \v\t", ch) != NULL + : u32_strchr((uint32_t*)" \v\t()[]{},.;:/\\", ch) != NULL; } const int