Skip to content

Commit b2a76ec

Browse files
committed
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)
1 parent 1c84493 commit b2a76ec

6 files changed

Lines changed: 19 additions & 13 deletions

File tree

src/libvterm/bin/unterm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ int main(int argc, char *argv[])
265265
}
266266

267267
vt = vterm_new(rows, cols);
268-
vterm_set_utf8(vt, true);
268+
vterm_set_utf8(vt, TRUE);
269269

270270
vts = vterm_obtain_screen(vt);
271271
vterm_screen_set_callbacks(vts, &cb_screen, NULL);

src/libvterm/include/vterm.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ extern "C" {
1010

1111
#include <stdint.h>
1212
#include <stdlib.h>
13-
#include <stdbool.h>
1413

1514
#include "vterm_keycodes.h"
1615

16+
#define TRUE 1
17+
#define FALSE 0
18+
1719
typedef struct VTerm VTerm;
1820
typedef struct VTermState VTermState;
1921
typedef struct VTermScreen VTermScreen;
@@ -183,7 +185,7 @@ void vterm_keyboard_start_paste(VTerm *vt);
183185
void vterm_keyboard_end_paste(VTerm *vt);
184186

185187
void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod);
186-
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod);
188+
void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod);
187189

188190
/* ------------
189191
* Parser layer
@@ -235,6 +237,8 @@ typedef struct {
235237
int (*erase)(VTermRect rect, int selective, void *user);
236238
int (*initpen)(void *user);
237239
int (*setpenattr)(VTermAttr attr, VTermValue *val, void *user);
240+
/* Callback for setting various properties. Must return 1 if the property
241+
* was accepted, 0 otherwise. */
238242
int (*settermprop)(VTermProp prop, VTermValue *val, void *user);
239243
int (*bell)(void *user);
240244
int (*resize)(int rows, int cols, VTermPos *delta, void *user);

src/libvterm/src/mouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void vterm_mouse_move(VTerm *vt, int row, int col, VTermModifier mod)
7070
}
7171
}
7272

73-
void vterm_mouse_button(VTerm *vt, int button, bool pressed, VTermModifier mod)
73+
void vterm_mouse_button(VTerm *vt, int button, int pressed, VTermModifier mod)
7474
{
7575
VTermState *state = vt->state;
7676

src/libvterm/src/pen.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ static int ramp24[] = {
3333
0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF,
3434
};
3535

36-
static bool lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
36+
static int lookup_colour_ansi(const VTermState *state, long index, VTermColor *col)
3737
{
3838
if(index >= 0 && index < 16) {
3939
*col = state->colors[index];
40-
return true;
40+
return TRUE;
4141
}
4242

43-
return false;
43+
return FALSE;
4444
}
4545

46-
static bool lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
46+
static int lookup_colour_palette(const VTermState *state, long index, VTermColor *col)
4747
{
4848
if(index >= 0 && index < 16) {
4949
/* 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
5757
col->green = ramp6[index/6 % 6];
5858
col->red = ramp6[index/6/6 % 6];
5959

60-
return true;
60+
return TRUE;
6161
}
6262
else if(index >= 232 && index < 256) {
6363
/* 24 greyscales */
@@ -67,10 +67,10 @@ static bool lookup_colour_palette(const VTermState *state, long index, VTermColo
6767
col->green = ramp24[index];
6868
col->red = ramp24[index];
6969

70-
return true;
70+
return TRUE;
7171
}
7272

73-
return false;
73+
return FALSE;
7474
}
7575

7676
static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index)

src/libvterm/t/harness.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static int screen_damage(VTermRect rect, void *user)
351351
rect.start_row, rect.end_row, rect.start_col, rect.end_col);
352352

353353
if(want_screen_damage_cells) {
354-
bool equals = false;
354+
int equals = FALSE;
355355
int row;
356356
int col;
357357

@@ -373,7 +373,7 @@ static int screen_damage(VTermRect rect, void *user)
373373
break;
374374

375375
if(!equals)
376-
printf(" ="), equals = true;
376+
printf(" ="), equals = TRUE;
377377

378378
printf(" %d<", row);
379379
for(col = rect.start_col; col < eol; col++) {

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
772,
772774
/**/
773775
771,
774776
/**/

0 commit comments

Comments
 (0)