1 lib/vterm_states: fix C++11 compliance
3 In C++11, narrowing a type is no longer allowed in structure
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
23 #define ADDSAME(len) ((len) << 8)
24 +#define ENDSEQ { ((u16)-1) }
26 const VTerm::Sequence VTerm::control_sequences[] = {
31 { 0x9B, 0, ESsquare },
36 const VTerm::Sequence VTerm::escape_sequences[] = {
44 { '[', &VTerm::clear_param, ESsquare },
46 { '8', &VTerm::restore_cursor, ESnormal },
47 { '>', &VTerm::keypad_numeric, ESnormal },
48 { '=', &VTerm::keypad_application, ESnormal },
53 { '[', 0, ESfunckey },
55 { '`', &VTerm::cursor_position_col, ESnormal },
56 { ']', &VTerm::linux_specific, ESnormal },
57 { '}', &VTerm::fbterm_specific, ESnormal },
62 { '0' | ADDSAME(9), &VTerm::set_palette, ESkeep },
64 { 'a' | ADDSAME(5), &VTerm::set_palette, ESkeep },
65 { 'P', &VTerm::begin_set_palette, ESkeep },
66 { 'R', &VTerm::reset_palette, ESnormal },
71 { '@', &VTerm::clear_utf8, ESnormal },
72 { 'G', &VTerm::set_utf8, ESnormal },
73 { '8', &VTerm::set_utf8, ESnormal },
78 { '0', &VTerm::set_charset, ESnormal },
79 { 'B', &VTerm::set_charset, ESnormal },
80 { 'U', &VTerm::set_charset, ESnormal },
81 { 'K', &VTerm::set_charset, ESnormal },
86 { '8', &VTerm::screen_align, ESnormal },