harfbuzz: security bump to version 1.4.4
[buildroot-gz.git] / package / fbterm / 0003-C++11-compliance.patch
blob1a06da3d1628149ee93cc18cefa10eb44493cf14
1 lib/vterm_states: fix C++11 compliance
3 In C++11, narrowing a type is no longer allowed in structure
4 initializers:
6 struct foo { u16 u; };
7 foo f[] = { {0}, {-1} };
9 results in the gcc-6 to whine out loudly, and fail:
11 error: narrowing conversion of ‘-1’ from ‘int’ to ‘u16 {aka short unsigned int}’ inside { } [-Wnarrowing]
15 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
17 diff -durN fbterm-1.7.0.orig/src/lib/vterm_states.cpp fbterm-1.7.0/src/lib/vterm_states.cpp
18 --- fbterm-1.7.0.orig/src/lib/vterm_states.cpp 2010-10-06 06:23:08.000000000 +0200
19 +++ fbterm-1.7.0/src/lib/vterm_states.cpp 2016-08-13 16:54:29.495451127 +0200
20 @@ -22,6 +22,7 @@
21 #include "vterm.h"
23 #define ADDSAME(len) ((len) << 8)
24 +#define ENDSEQ { ((u16)-1) }
26 const VTerm::Sequence VTerm::control_sequences[] = {
27 { 0, 0, ESkeep },
28 @@ -39,14 +40,14 @@
29 { 0x1B, 0, ESesc },
30 { 0x7F, 0, ESkeep },
31 { 0x9B, 0, ESsquare },
32 - { -1}
33 + ENDSEQ
36 const VTerm::Sequence VTerm::escape_sequences[] = {
37 { 0, 0, ESnormal },
39 // ESnormal
40 - { -1 },
41 + ENDSEQ,
43 // ESesc
44 { '[', &VTerm::clear_param, ESsquare },
45 @@ -65,7 +66,7 @@
46 { '8', &VTerm::restore_cursor, ESnormal },
47 { '>', &VTerm::keypad_numeric, ESnormal },
48 { '=', &VTerm::keypad_application, ESnormal },
49 - { -1 },
50 + ENDSEQ,
52 // ESsquare
53 { '[', 0, ESfunckey },
54 @@ -104,7 +105,7 @@
55 { '`', &VTerm::cursor_position_col, ESnormal },
56 { ']', &VTerm::linux_specific, ESnormal },
57 { '}', &VTerm::fbterm_specific, ESnormal },
58 - { -1 },
59 + ENDSEQ,
61 // ESnonstd
62 { '0' | ADDSAME(9), &VTerm::set_palette, ESkeep },
63 @@ -112,25 +113,25 @@
64 { 'a' | ADDSAME(5), &VTerm::set_palette, ESkeep },
65 { 'P', &VTerm::begin_set_palette, ESkeep },
66 { 'R', &VTerm::reset_palette, ESnormal },
67 - { -1 },
68 + ENDSEQ,
70 // ESpercent
71 { '@', &VTerm::clear_utf8, ESnormal },
72 { 'G', &VTerm::set_utf8, ESnormal },
73 { '8', &VTerm::set_utf8, ESnormal },
74 - { -1 },
75 + ENDSEQ,
77 // EScharset
78 { '0', &VTerm::set_charset, ESnormal },
79 { 'B', &VTerm::set_charset, ESnormal },
80 { 'U', &VTerm::set_charset, ESnormal },
81 { 'K', &VTerm::set_charset, ESnormal },
82 - { -1 },
83 + ENDSEQ,
85 // EShash
86 { '8', &VTerm::screen_align, ESnormal },
87 - { -1 },
88 + ENDSEQ,
90 // ESfunckey
91 - { -1 },
92 + ENDSEQ,