forked from aniani/vim
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)
This commit is contained in:
parent
1c84493bbe
commit
b2a76ec06b
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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++) {
|
||||
|
@ -769,6 +769,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
772,
|
||||
/**/
|
||||
771,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user