Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jul 2018 12:01:13 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r475650 - head/comms/xmorse/files
Message-ID:  <201807291201.w6TC1DXH011923@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Sun Jul 29 12:01:13 2018
New Revision: 475650
URL: https://svnweb.freebsd.org/changeset/ports/475650

Log:
  comms/xmorse: Fix build with Clang 6
  
  Codebox.cxx:122:16: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
    char s[] = { c, '\0' };               //   A 1-char string version of c.
                 ^
  
  http://beefy12.nyi.freebsd.org/data/head-amd64-default/p475044_s336572/logs/xmorse-20041125_10.log

Added:
  head/comms/xmorse/files/patch-Codebox.cxx   (contents, props changed)

Added: head/comms/xmorse/files/patch-Codebox.cxx
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/comms/xmorse/files/patch-Codebox.cxx	Sun Jul 29 12:01:13 2018	(r475650)
@@ -0,0 +1,15 @@
+Codebox.cxx:122:16: error: non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list [-Wc++11-narrowing]
+  char s[] = { c, '\0' };               //   A 1-char string version of c.
+               ^
+
+--- Codebox.cxx.orig	2018-07-29 11:57:10 UTC
++++ Codebox.cxx
+@@ -119,7 +119,7 @@ int Codebox::handle(int event) {	// Called by FLTK whe
+  *  moved to the end of the line, and the character is inserted there.
+  */
+ void Codebox::append(int c) {		// Append character to displayed line
+-  char s[] = { c, '\0' };		//   A 1-char string version of c.
++  char s[] = { static_cast<char>(c), '\0' };		//   A 1-char string version of c.
+   if (size() >= maximum_size())		//   If no room for character,
+      cut(0,1);				//     discard one off left side
+   position(maximum_size());		//   Return to right end of buffer



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807291201.w6TC1DXH011923>