Skip to content

Commit

Permalink
app-editors/fte: fix cpp14 compilation errors; bug #595048
Browse files Browse the repository at this point in the history
Change config generating Perl script to cast int literals to char in default
config file to avoid narrowing conversions.
Closes: gentoo#2411

Signed-off-by: David Seifert <[email protected]>
  • Loading branch information
Kacper Kołodziej authored and SoapGentoo committed Oct 1, 2016
1 parent 1403a28 commit 0917103
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions app-editors/fte/files/fte-cpp14.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Fix C++14 compilation errors. Add casting int literals to char in config
generator to avoid narrowing conversions.
Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=595048

--- a/src/mkdefcfg.pl
+++ b/src/mkdefcfg.pl
@@ -24,8 +24,8 @@

@c = split(//, $buf);
for ($i = 0; $i < $len; $i++) {
- $out .= sprintf("0x%02X", ord($c[$i]));
- if ($n++ % 10) {
+ $out .= sprintf("(char)0x%02X", ord($c[$i]));
+ if ($n++ % 5) {
$out .= ", ";
} else {
$out .= ",\n";
3 changes: 2 additions & 1 deletion app-editors/fte/fte-20051115-r3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ src_prepare() {
"${FILESDIR}"/fte-gcc34 \
"${FILESDIR}"/${PN}-new_keyword.patch \
"${FILESDIR}"/${PN}-slang.patch \
"${FILESDIR}"/${PN}-interix.patch
"${FILESDIR}"/${PN}-interix.patch \
"${FILESDIR}"/${PN}-cpp14.patch # bug #595048

[[ -e /usr/include/linux/keyboard.h ]] && \
sed /usr/include/linux/keyboard.h -e '/wait.h/d' > src/hacked_keyboard.h
Expand Down

0 comments on commit 0917103

Please sign in to comment.