Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jan 2018 11:57:50 +0000 (UTC)
From:      "Tobias C. Berner" <tcberner@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r458314 - in head/x11/kdelibs4: . files
Message-ID:  <201801071157.w07BvoK5026230@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tcberner
Date: Sun Jan  7 11:57:50 2018
New Revision: 458314
URL: https://svnweb.freebsd.org/changeset/ports/458314

Log:
  x11/kdelibs4 fix build with clang6
  
  PR:		224945

Added:
  head/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp   (contents, props changed)
  head/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp   (contents, props changed)
  head/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp   (contents, props changed)
  head/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h   (contents, props changed)
  head/x11/kdelibs4/files/patch-kinit_kinit.cpp   (contents, props changed)
Modified:
  head/x11/kdelibs4/Makefile

Modified: head/x11/kdelibs4/Makefile
==============================================================================
--- head/x11/kdelibs4/Makefile	Sun Jan  7 11:33:58 2018	(r458313)
+++ head/x11/kdelibs4/Makefile	Sun Jan  7 11:57:50 2018	(r458314)
@@ -3,7 +3,7 @@
 
 PORTNAME=	kdelibs
 PORTVERSION=	${KDE4_KDELIBS_VERSION}
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	x11 kde kde-applications
 
 MAINTAINER=	kde@FreeBSD.org

Added: head/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/kdelibs4/files/patch-dnssd_servicemodel.cpp	Sun Jan  7 11:57:50 2018	(r458314)
@@ -0,0 +1,23 @@
+Backport of
+
+rom 80b43aaae27cfdf543483cd55d9012e37219350a Mon Sep 17 00:00:00 2001
+From: Alex Richardson <arichardson.kde@gmail.com>
+Date: Wed, 29 Jan 2014 21:56:27 +0100
+Subject: [PATCH] Fix build with clang
+
+If we don't cast to unsigned int clang complains with following message:
+
+error: case value evaluates to 2690980318, which cannot be narrowed to
+type 'int'
+
+--- dnssd/servicemodel.cpp.orig	2018-01-07 11:07:50 UTC
++++ dnssd/servicemodel.cpp
+@@ -80,7 +80,7 @@ QVariant ServiceModel::data(const QModelIndex& index, 
+     if (!index.isValid()) return QVariant();
+     if (!hasIndex(index.row(), index.column(), index.parent())) return QVariant();
+     const QList<RemoteService::Ptr> srv=d->m_browser->services();
+-    switch (role) {
++    switch ((uint)role) {
+ 	case Qt::DisplayRole: 
+ 	    switch (index.column()) {
+ 		case ServiceName: return srv[index.row()]->serviceName();

Added: head/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/kdelibs4/files/patch-kdeui_icons_kiconcache.cpp	Sun Jan  7 11:57:50 2018	(r458314)
@@ -0,0 +1,15 @@
+error: invalid suffix on literal; C++11 requires a space between literal and identifier 
+[-Wreserved-user-defined-literal]
+    d->mUpdatesFile  = KGlobal::dirs()->locateLocal("cache", "kpc/"KDE_ICONCACHE_NAME".updated");
+                                                                   ^
+--- kdeui/icons/kiconcache.cpp.orig	2018-01-07 10:31:47 UTC
++++ kdeui/icons/kiconcache.cpp
+@@ -103,7 +103,7 @@ class KIconCache::Private (public)
+ KIconCache::KIconCache()
+     : KPixmapCache(KDE_ICONCACHE_NAME), d(new Private(this))
+ {
+-    d->mUpdatesFile  = KGlobal::dirs()->locateLocal("cache", "kpc/"KDE_ICONCACHE_NAME".updated");
++    d->mUpdatesFile  = KGlobal::dirs()->locateLocal("cache", "kpc/" KDE_ICONCACHE_NAME ".updated");
+     // Set limit to 10 MB
+     setCacheLimit(10 * 1024);
+ }

Added: head/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/kdelibs4/files/patch-khtml_misc_AtomicString.cpp	Sun Jan  7 11:57:50 2018	(r458314)
@@ -0,0 +1,40 @@
+Backport of:
+
+From 7ed8ac1ae23a31d2eb227ffa15d68b2beaf8f37d Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Wed, 26 Feb 2014 22:37:29 +0100
+Subject: [PATCH] Fix compiler error when using clang:
+
+src/misc/AtomicString.cpp:175:28: error: non-constant-expression
+ cannot be narrowed from type 'int' to 'unsigned int' in initializer
+ list [-Wc++11-narrowing]
+    UCharBuffer buf = { s, length };
+                           ^~~~~~
+src/misc/AtomicString.cpp:175:28: note: override this message by
+ inserting an explicit cast
+    UCharBuffer buf = { s, length };
+                           ^~~~~~
+                           static_cast<unsigned int>( )
+
+REVIEW: 116541
+
+--- khtml/misc/AtomicString.cpp.orig	2018-01-07 11:32:56 UTC
++++ khtml/misc/AtomicString.cpp
+@@ -160,7 +160,7 @@ DOMStringImpl* AtomicString::add(const QChar* s, int l
+         return DOMStringImpl::empty();
+    
+     init();
+-    UCharBuffer buf = { s, length }; 
++    UCharBuffer buf = { s, static_cast<uint>(length) }; 
+     std::pair<HashSet<DOMStringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+     if (!addResult.second)
+         return *addResult.first;
+@@ -180,7 +180,7 @@ DOMStringImpl* AtomicString::add(const QChar* s)
+         return DOMStringImpl::empty();
+ 
+     init();
+-    UCharBuffer buf = {s, length}; 
++    UCharBuffer buf = {s, static_cast<uint>(length) }; 
+     std::pair<HashSet<DOMStringImpl*>::iterator, bool> addResult = stringTable->add<UCharBuffer, UCharBufferTranslator>(buf);
+     if (!addResult.second)
+         return *addResult.first;

Added: head/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/kdelibs4/files/patch-khtml_xml_dom__stringimpl.h	Sun Jan  7 11:57:50 2018	(r458314)
@@ -0,0 +1,31 @@
+Backport of
+
+From 6c4f7f84dd1326853475d10e503f220e4555e5e2 Mon Sep 17 00:00:00 2001
+From: Milian Wolff <mail@milianw.de>
+Date: Sun, 2 Mar 2014 21:48:20 +0100
+Subject: [PATCH] Fix clang compilation warning:
+
+khtml/src/xml/dom_stringimpl.h:60:13: warning: cast from 'char *'
+to 'QChar *' increases required alignment from 1 to 2 [-Wcast-align
+        s = (QChar*) new cha sizeof(QChar)*( havestr ? len : 1 ) ;
+            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Note that this line of code is pretty odd I have to say. It this
+supposed to be an optimization to prevent the default ctor/dtor of
+QChar to be called? Is it really worth it here?
+
+REVIEW: 116544
+
+--- khtml/xml/dom_stringimpl.h.orig	2018-01-07 11:19:19 UTC
++++ khtml/xml/dom_stringimpl.h
+@@ -32,8 +32,8 @@
+ #include "misc/khtmllayout.h"
+ #include "misc/shared.h"
+ 
+-#define QT_ALLOC_QCHAR_VEC( N ) (QChar*) new char[ sizeof(QChar)*( N ) ]
+-#define QT_DELETE_QCHAR_VEC( P ) delete[] ((char*)( P ))
++#define QT_ALLOC_QCHAR_VEC( N ) reinterpret_cast<QChar*>(new char[ sizeof(QChar)*( N ) ])
++#define QT_DELETE_QCHAR_VEC( P ) delete[] (reinterpret_cast<char*>( P ))
+ 
+ namespace DOM {
+ 

Added: head/x11/kdelibs4/files/patch-kinit_kinit.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/kdelibs4/files/patch-kinit_kinit.cpp	Sun Jan  7 11:57:50 2018	(r458314)
@@ -0,0 +1,15 @@
+error: invalid suffix on literal; C++11 requires a space between literal and identifier 
+[-Wreserved-user-defined-literal]
+     fprintf(stderr, "kdeinit4: Aborting. $"DISPLAY" is not set.\n");
+
+--- kinit/kinit.cpp.orig	2018-01-07 10:44:53 UTC
++++ kinit/kinit.cpp
+@@ -1478,7 +1478,7 @@ static void kdeinit_library_path()
+    if (display.isEmpty())
+    {
+ #if defined(Q_WS_X11) || defined(Q_WS_QWS)
+-     fprintf(stderr, "kdeinit4: Aborting. $"DISPLAY" is not set.\n");
++     fprintf(stderr, "kdeinit4: Aborting. $" DISPLAY " is not set.\n");
+      exit(255);
+ #endif
+    }



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