• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/fbterm/0003-C++11-compliance.patch
Yann E. MORINYann E. MORIN committed cbe01f6756013 Aug 2016
Raw file
Source viewDiff to previous
 
1
lib/vterm_states: fix C++11 compliance
2
​
3
In C++11, narrowing a type is no longer allowed in structure
4
initializers:
5
​
6
    struct foo { u16 u; };
7
    foo f[] = { {0}, {-1} };
8
​
9
results in the gcc-6 to whine out loudly, and fail:
10
​
11
    error: narrowing conversion of ‘-1’ from ‘int’ to ‘u16 {aka short unsigned int}’ inside { } [-Wnarrowing]
12
     };
13
     ^
14
​
15
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
16
​
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"
22
 
23
 #define ADDSAME(len) ((len) << 8)
24
+#define ENDSEQ  { ((u16)-1) }
25
 
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
34
 };
35
 
36
 const VTerm::Sequence VTerm::escape_sequences[] = {
37
    {   0, 0, ESnormal },
38
 
39
    // ESnormal
40
-   { -1 },
41
+   ENDSEQ,
42
 
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,
51
 
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,
60
 
61
    // ESnonstd
62
    { '0' | ADDSAME(9), &VTerm::set_palette,    ESkeep },
63
@@ -112,25 +113,25 @@
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.