Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-editors/fte/, app-editors/fte/files/
Date: Sat, 01 Oct 2016 20:11:47
Message-Id: 1475352673.0917103442096f6487409686fcfa29440587e040.soap@gentoo
1 commit: 0917103442096f6487409686fcfa29440587e040
2 Author: Kacper KoƂodziej <kacper <AT> kolodziej <DOT> in>
3 AuthorDate: Sun Sep 25 16:20:10 2016 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 1 20:11:13 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09171034
7
8 app-editors/fte: fix cpp14 compilation errors; bug #595048
9
10 Change config generating Perl script to cast int literals to char in default
11 config file to avoid narrowing conversions.
12 Closes: https://github.com/gentoo/gentoo/pull/2411
13
14 Signed-off-by: David Seifert <soap <AT> gentoo.org>
15
16 app-editors/fte/files/fte-cpp14.patch | 17 +++++++++++++++++
17 app-editors/fte/fte-20051115-r3.ebuild | 3 ++-
18 2 files changed, 19 insertions(+), 1 deletion(-)
19
20 diff --git a/app-editors/fte/files/fte-cpp14.patch b/app-editors/fte/files/fte-cpp14.patch
21 new file mode 100644
22 index 00000000..bea83b6
23 --- /dev/null
24 +++ b/app-editors/fte/files/fte-cpp14.patch
25 @@ -0,0 +1,17 @@
26 +Fix C++14 compilation errors. Add casting int literals to char in config
27 +generator to avoid narrowing conversions.
28 +Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=595048
29 +
30 +--- a/src/mkdefcfg.pl
31 ++++ b/src/mkdefcfg.pl
32 +@@ -24,8 +24,8 @@
33 +
34 + @c = split(//, $buf);
35 + for ($i = 0; $i < $len; $i++) {
36 +- $out .= sprintf("0x%02X", ord($c[$i]));
37 +- if ($n++ % 10) {
38 ++ $out .= sprintf("(char)0x%02X", ord($c[$i]));
39 ++ if ($n++ % 5) {
40 + $out .= ", ";
41 + } else {
42 + $out .= ",\n";
43
44 diff --git a/app-editors/fte/fte-20051115-r3.ebuild b/app-editors/fte/fte-20051115-r3.ebuild
45 index 4f8ff93..9818594 100644
46 --- a/app-editors/fte/fte-20051115-r3.ebuild
47 +++ b/app-editors/fte/fte-20051115-r3.ebuild
48 @@ -47,7 +47,8 @@ src_prepare() {
49 "${FILESDIR}"/fte-gcc34 \
50 "${FILESDIR}"/${PN}-new_keyword.patch \
51 "${FILESDIR}"/${PN}-slang.patch \
52 - "${FILESDIR}"/${PN}-interix.patch
53 + "${FILESDIR}"/${PN}-interix.patch \
54 + "${FILESDIR}"/${PN}-cpp14.patch # bug #595048
55
56 [[ -e /usr/include/linux/keyboard.h ]] && \
57 sed /usr/include/linux/keyboard.h -e '/wait.h/d' > src/hacked_keyboard.h