comparison src/libvterm/src/pen.c @ 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 b8299e742f41
children 4dfebc1b2674
comparison
equal deleted inserted replaced
11779:8c6f35d0ee28 11780:c76b672df584
31 static int ramp24[] = { 31 static int ramp24[] = {
32 0x00, 0x0B, 0x16, 0x21, 0x2C, 0x37, 0x42, 0x4D, 0x58, 0x63, 0x6E, 0x79, 32 0x00, 0x0B, 0x16, 0x21, 0x2C, 0x37, 0x42, 0x4D, 0x58, 0x63, 0x6E, 0x79,
33 0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF, 33 0x85, 0x90, 0x9B, 0xA6, 0xB1, 0xBC, 0xC7, 0xD2, 0xDD, 0xE8, 0xF3, 0xFF,
34 }; 34 };
35 35
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)
37 { 37 {
38 if(index >= 0 && index < 16) { 38 if(index >= 0 && index < 16) {
39 *col = state->colors[index]; 39 *col = state->colors[index];
40 return true; 40 return TRUE;
41 } 41 }
42 42
43 return false; 43 return FALSE;
44 } 44 }
45 45
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)
47 { 47 {
48 if(index >= 0 && index < 16) { 48 if(index >= 0 && index < 16) {
49 /* Normal 8 colours or high intensity - parse as palette 0 */ 49 /* Normal 8 colours or high intensity - parse as palette 0 */
50 return lookup_colour_ansi(state, index, col); 50 return lookup_colour_ansi(state, index, col);
51 } 51 }
55 55
56 col->blue = ramp6[index % 6]; 56 col->blue = ramp6[index % 6];
57 col->green = ramp6[index/6 % 6]; 57 col->green = ramp6[index/6 % 6];
58 col->red = ramp6[index/6/6 % 6]; 58 col->red = ramp6[index/6/6 % 6];
59 59
60 return true; 60 return TRUE;
61 } 61 }
62 else if(index >= 232 && index < 256) { 62 else if(index >= 232 && index < 256) {
63 /* 24 greyscales */ 63 /* 24 greyscales */
64 index -= 232; 64 index -= 232;
65 65
66 col->blue = ramp24[index]; 66 col->blue = ramp24[index];
67 col->green = ramp24[index]; 67 col->green = ramp24[index];
68 col->red = ramp24[index]; 68 col->red = ramp24[index];
69 69
70 return true; 70 return TRUE;
71 } 71 }
72 72
73 return false; 73 return FALSE;
74 } 74 }
75 75
76 static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index) 76 static int lookup_colour(const VTermState *state, int palette, const long args[], int argcount, VTermColor *col, int *index)
77 { 77 {
78 switch(palette) { 78 switch(palette) {