]> granicus.if.org Git - vim/commitdiff
patch 8.0.0772: other stdbool.h dependencies in libvterm v8.0.0772
authorBram Moolenaar <Bram@vim.org>
Tue, 25 Jul 2017 19:34:46 +0000 (21:34 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 25 Jul 2017 19:34:46 +0000 (21:34 +0200)
Problem:    Other stdbool.h dependencies in libvterm.
Solution:   Remove the dependency and use TRUE/FALSE/int. (Ken Takata)

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

index acaf2d2d44f85b2bb90d6ac56cb1727836db9745..b8fe37c9afb1beaae5cbf2aaf1a54913acb6a0bd 100644 (file)
@@ -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);
index 5bc47e5131c649d7d2c7363b0e2013b8f7bd86f3..ccd10c511e0e4654643dc777c869c065b0311071 100644 (file)
@@ -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);
index 9962e4f55aadef5b9dc32d67a5a50055f393b35e..ba17aa466fda01fc9c9350c531fb0792bf74e7c1 100644 (file)
@@ -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;
 
index d7ea9b1146024600e02a5f85bfbc124c89982fef..81987f6bc17f156e154f6f03401d9784c3030e65 100644 (file)
@@ -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)
index 2b2246442de78b64fc26832d59f1033718839ae1..2ba77f01cf53688e1c86f744e50b6cd95bd85ef5 100644 (file)
@@ -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++) {
index 10189f4897454c4042b7ab182821522447f579c2..1553a90c08345508ca2555dbc9b35542e48ad639 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    772,
 /**/
     771,
 /**/