diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-25 21:34:46 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-25 21:34:46 +0200 |
commit | b2a76ec06bb1130cfb632bdfef64e479fa55dd5c (patch) | |
tree | 42527fd8fe944b251a85a3045166549554b46187 /src/libvterm | |
parent | 1c84493bbeda1d58b70e9b2b7723ce92fb2a49d4 (diff) | |
download | vim-git-b2a76ec06bb1130cfb632bdfef64e479fa55dd5c.tar.gz |
patch 8.0.0772: other stdbool.h dependencies in libvtermv8.0.0772
Problem: Other stdbool.h dependencies in libvterm.
Solution: Remove the dependency and use TRUE/FALSE/int. (Ken Takata)
Diffstat (limited to 'src/libvterm')
-rw-r--r-- | src/libvterm/bin/unterm.c | 2 | ||||
-rw-r--r-- | src/libvterm/include/vterm.h | 8 | ||||
-rw-r--r-- | src/libvterm/src/mouse.c | 2 | ||||
-rw-r--r-- | src/libvterm/src/pen.c | 14 | ||||
-rw-r--r-- | src/libvterm/t/harness.c | 4 |
5 files changed, 17 insertions, 13 deletions
diff --git a/src/libvterm/bin/unterm.c b/src/libvterm/bin/unterm.c index acaf2d2d4..b8fe37c9a 100644 --- a/src/libvterm/bin/unterm.c +++ b/src/libvterm/bin/unterm.c @@ -265,7 +265,7 @@ int main(int argc, char *argv[]) } vt = vterm_new(rows, cols); - vterm_set_utf8(vt, true); + vterm_set_utf8(vt, TRUE); vts = vterm_obtain_screen(vt); vterm_screen_set_callbacks(vts, &cb_screen, NULL); diff --git a/src/libvterm/include/vterm.h b/src/libvterm/include/vterm.h index 5bc47e513..ccd10c511 100644 --- a/src/libvterm/include/vterm.h +++ b/src/libvterm/include/vterm.h @@ -10,10 +10,12 @@ extern "C" { #include <stdint.h> #include <stdlib.h> -#include <stdbool.h> #include "vterm_keycodes.h" +#define TRUE 1 +#define FALSE 0 + typedef struct VTerm VTerm; typedef struct VTermState VTermState; typedef struct VTermScreen VTermScreen; @@ -183,7 +185,7 @@ void vterm_keyboard_start_paste(VTerm *vt); void vterm_keyboard_end_paste(VTerm *vt); void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod); -void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod); +void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod); /* ------------ * Parser layer @@ -235,6 +237,8 @@ typedef struct { int (*erase)(VTermRect rect, int selective, void *user); int (*initpen)(void *user); int (*setpenattr)(VTermAttr attr, VTermValue *val, void *user); + /* Callback for setting various properties. Must return 1 if the property + * was accepted, 0 otherwise. */ int (*settermprop)(VTermProp prop, VTermValue *val, void *user); int (*bell)(void *user); int (*resize)(int rows, int cols, VTermPos *delta, void *user); diff --git a/src/libvterm/src/mouse.c b/src/libvterm/src/mouse.c index 9962e4f55..ba17aa466 100644 --- a/src/libvterm/src/mouse.c +++ b/src/libvterm/src/mouse.c @@ -70,7 +70,7 @@ void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod) } } -void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod) +void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod) { VTermState *state = vt->state; diff --git a/src/libvterm/src/pen.c b/src/libvterm/src/pen.c index d7ea9b114..81987f6bc 100644 --- a/src/libvterm/src/pen.c +++ b/src/libvterm/src/pen.c @@ -33,17 +33,17 @@ static int ramp24[] = { 0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF, }; -static bool lookup_colour_ansi(const VTermState *state, long index, VTermColor *col) +static int lookup_colour_ansi(const VTermState *state, long index, VTermColor *col) { if(index >= 0 && index < 16) { *col = state->colors[index]; - return true; + return TRUE; } - return false; + return FALSE; } -static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col) +static int lookup_colour_palette(const VTermState *state, long index, VTermColor *col) { if(index >= 0 && index < 16) { /* Normal 8 colours or high intensity - parse as palette 0 */ @@ -57,7 +57,7 @@ static bool lookup_colour_palette(const VTermState *state, long index, VTermColo col->green = ramp6[index/6 % 6]; col->red = ramp6[index/6/6 % 6]; - return true; + return TRUE; } else if(index >= 232 && index < 256) { /* 24 greyscales */ @@ -67,10 +67,10 @@ static bool lookup_colour_palette(const VTermState *state, long index, VTermColo col->green = ramp24[index]; col->red = ramp24[index]; - return true; + return TRUE; } - return false; + return FALSE; } static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index) diff --git a/src/libvterm/t/harness.c b/src/libvterm/t/harness.c index 2b2246442..2ba77f01c 100644 --- a/src/libvterm/t/harness.c +++ b/src/libvterm/t/harness.c @@ -351,7 +351,7 @@ static int screen_damage(VTermRect rect, void *user) rect.start_row, rect.end_row, rect.start_col, rect.end_col); if(want_screen_damage_cells) { - bool equals = false; + int equals = FALSE; int row; int col; @@ -373,7 +373,7 @@ static int screen_damage(VTermRect rect, void *user) break; if(!equals) - printf(" ="), equals = true; + printf(" ="), equals = TRUE; printf(" %d<", row); for(col = rect.start_col; col < eol; col++) { |