Mercurial > vim
changeset 11780:c76b672df584 v8.0.0772
patch 8.0.0772: other stdbool.h dependencies in libvterm
commit https://github.com/vim/vim/commit/b2a76ec06bb1130cfb632bdfef64e479fa55dd5c
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jul 25 21:34:46 2017 +0200
patch 8.0.0772: other stdbool.h dependencies in libvterm
Problem: Other stdbool.h dependencies in libvterm.
Solution: Remove the dependency and use TRUE/FALSE/int. (Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 25 Jul 2017 21:45:04 +0200 |
parents | 8c6f35d0ee28 |
children | c56c413f83a1 |
files | src/libvterm/bin/unterm.c src/libvterm/include/vterm.h src/libvterm/src/mouse.c src/libvterm/src/pen.c src/libvterm/t/harness.c src/version.c |
diffstat | 6 files changed, 19 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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 *v 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);
--- a/src/libvterm/src/mouse.c +++ b/src/libvterm/src/mouse.c @@ -70,7 +70,7 @@ void vterm_mouse_move(VTerm *vt, int row } } -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;
--- 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 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 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)
--- a/src/libvterm/t/harness.c +++ b/src/libvterm/t/harness.c @@ -351,7 +351,7 @@ static int screen_damage(VTermRect rect, 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, break; if(!equals) - printf(" ="), equals = true; + printf(" ="), equals = TRUE; printf(" %d<", row); for(col = rect.start_col; col < eol; col++) {