umbrello: update to 16.12.1
Thanks to Albert Astals Cid for pointer on patch Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
From ce147ad93100a0d296f1c5958fcb7bf70c9d70af Mon Sep 17 00:00:00 2001
|
||||
From: Ralf Habacker <ralf.habacker@freenet.de>
|
||||
Date: Sat, 14 Jan 2017 11:45:46 +0100
|
||||
Subject: [PATCH] Use gcc buildin null pointer check to remove x86 limitation
|
||||
of previous implementation.
|
||||
|
||||
Thanks to Kevin Kofler for pointing out.
|
||||
|
||||
MSVC dynamic_cast null pointer support has been checked and proved by Daniel Wendt.
|
||||
|
||||
BUG:374530
|
||||
FIXED-IN:2.12.2 (KDE Applications 16.12.2)
|
||||
|
||||
Upstream-Status: Backport
|
||||
---
|
||||
CMakeLists.txt | 4 +++
|
||||
lib/cppparser/driver.h | 2 --
|
||||
umbrello/debug/debug_utils.h | 19 --------------
|
||||
umbrello/umlmodel/umlobject.cpp | 57 ++++++++++++++++++++---------------------
|
||||
4 files changed, 32 insertions(+), 50 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d9e7443..2faf930 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -23,6 +23,10 @@ include(Macros)
|
||||
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
+if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-delete-null-pointer-checks")
|
||||
+endif()
|
||||
+
|
||||
if(NOT BUILD_KF5)
|
||||
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
|
||||
|
||||
diff --git a/lib/cppparser/driver.h b/lib/cppparser/driver.h
|
||||
index 86dd03d..73989ed 100644
|
||||
--- a/lib/cppparser/driver.h
|
||||
+++ b/lib/cppparser/driver.h
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "ast.h"
|
||||
|
||||
-#include "debug_utils.h"
|
||||
#include "macro.h"
|
||||
#include <qpair.h>
|
||||
#include <QStringList>
|
||||
@@ -110,7 +109,6 @@ public:
|
||||
|
||||
TranslationUnitAST* operator -> () const
|
||||
{
|
||||
- uCheckPointerAndReturnIfZero(this);
|
||||
return (TranslationUnitAST*)m_translationUnit.data();
|
||||
}
|
||||
|
||||
diff --git a/umbrello/debug/debug_utils.h b/umbrello/debug/debug_utils.h
|
||||
index 5c0b921..4480ba5 100644
|
||||
--- a/umbrello/debug/debug_utils.h
|
||||
+++ b/umbrello/debug/debug_utils.h
|
||||
@@ -131,25 +131,6 @@ private:
|
||||
|
||||
#define uIgnoreZeroPointer(a) if (!a) { uDebug() << "zero pointer detected" << __FILE__ << __LINE__; continue; }
|
||||
|
||||
-/**
|
||||
- Check a pointer and return 0 if it is zero.
|
||||
-
|
||||
- This macros is implemented as asm code to prevent
|
||||
- removing by gcc optimizer for example in class methods
|
||||
- where 'this' pointer is attributed as "nonnull".
|
||||
-
|
||||
- @param p pointer to check
|
||||
- @return returns 0 is pointer is zero
|
||||
-*/
|
||||
-#define uCheckPointerAndReturnIfZero(p) \
|
||||
- asm goto ("test %0,%0; jne %l[next]" \
|
||||
- : /* No outputs. */ \
|
||||
- : "r"(p) \
|
||||
- : \
|
||||
- : next); \
|
||||
- return 0; \
|
||||
- next:
|
||||
-
|
||||
|
||||
/**
|
||||
* In a Q_OBJECT class define any enum as Q_ENUMS.
|
||||
diff --git a/umbrello/umlmodel/umlobject.cpp b/umbrello/umlmodel/umlobject.cpp
|
||||
index 224361a..bfd17ae 100644
|
||||
--- a/umbrello/umlmodel/umlobject.cpp
|
||||
+++ b/umbrello/umlmodel/umlobject.cpp
|
||||
@@ -669,7 +669,6 @@ void UMLObject::setUMLParent(UMLObject *parent)
|
||||
*/
|
||||
UMLObject *UMLObject::umlParent() const
|
||||
{
|
||||
- uCheckPointerAndReturnIfZero(this);
|
||||
return dynamic_cast<UMLObject *>(parent());
|
||||
}
|
||||
|
||||
@@ -1228,32 +1227,32 @@ QDebug operator<<(QDebug out, const UMLObject& obj)
|
||||
#include "usecase.h"
|
||||
|
||||
|
||||
-UMLActor* UMLObject::asUMLActor() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLActor*>(this); }
|
||||
-UMLArtifact* UMLObject::asUMLArtifact() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLArtifact*>(this); }
|
||||
-UMLAssociation* UMLObject::asUMLAssociation() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLAssociation*>(this); }
|
||||
-UMLAttribute* UMLObject::asUMLAttribute() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLAttribute*>(this); }
|
||||
-UMLCanvasObject* UMLObject::asUMLCanvasObject() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLCanvasObject*>(this); }
|
||||
-UMLCategory* UMLObject::asUMLCategory() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLCategory*>(this); }
|
||||
-UMLCheckConstraint* UMLObject::asUMLCheckConstraint() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLCheckConstraint*>(this); }
|
||||
-UMLClassifier* UMLObject::asUMLClassifier() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLClassifier*>(this); }
|
||||
-UMLClassifierListItem *UMLObject::asUMLClassifierListItem() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLClassifierListItem*>(this); }
|
||||
-UMLComponent* UMLObject::asUMLComponent() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLComponent*>(this); }
|
||||
-UMLDatatype *UMLObject::asUMLDatatype() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLDatatype*>(this); }
|
||||
-UMLEntity* UMLObject::asUMLEntity() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLEntity*>(this); }
|
||||
-UMLEntityAttribute* UMLObject::asUMLEntityAttribute() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLEntityAttribute*>(this); }
|
||||
-UMLEntityConstraint* UMLObject::asUMLEntityConstraint() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLEntityConstraint*>(this); }
|
||||
-UMLEnum* UMLObject::asUMLEnum() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLEnum*>(this); }
|
||||
-UMLEnumLiteral* UMLObject::asUMLEnumLiteral() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLEnumLiteral*>(this); }
|
||||
-UMLFolder* UMLObject::asUMLFolder() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLFolder*>(this); }
|
||||
-UMLForeignKeyConstraint* UMLObject::asUMLForeignKeyConstraint() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLForeignKeyConstraint*>(this); }
|
||||
-UMLNode* UMLObject::asUMLNode() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLNode*>(this); }
|
||||
-UMLObject* UMLObject::asUMLObject() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLObject*>(this); }
|
||||
-UMLOperation* UMLObject::asUMLOperation() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLOperation*>(this); }
|
||||
-UMLPackage* UMLObject::asUMLPackage() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLPackage*>(this); }
|
||||
-UMLPort* UMLObject::asUMLPort() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLPort*>(this); }
|
||||
-UMLRole* UMLObject::asUMLRole() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLRole*>(this); }
|
||||
-UMLStereotype* UMLObject::asUMLStereotype() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLStereotype*>(this); }
|
||||
-UMLTemplate* UMLObject::asUMLTemplate() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLTemplate*>(this); }
|
||||
-UMLUniqueConstraint* UMLObject::asUMLUniqueConstraint() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLUniqueConstraint*>(this); }
|
||||
-UMLUseCase* UMLObject::asUMLUseCase() { uCheckPointerAndReturnIfZero(this); return dynamic_cast<UMLUseCase*>(this); }
|
||||
+UMLActor* UMLObject::asUMLActor() { return dynamic_cast<UMLActor*>(this); }
|
||||
+UMLArtifact* UMLObject::asUMLArtifact() { return dynamic_cast<UMLArtifact*>(this); }
|
||||
+UMLAssociation* UMLObject::asUMLAssociation() { return dynamic_cast<UMLAssociation*>(this); }
|
||||
+UMLAttribute* UMLObject::asUMLAttribute() { return dynamic_cast<UMLAttribute*>(this); }
|
||||
+UMLCanvasObject* UMLObject::asUMLCanvasObject() { return dynamic_cast<UMLCanvasObject*>(this); }
|
||||
+UMLCategory* UMLObject::asUMLCategory() { return dynamic_cast<UMLCategory*>(this); }
|
||||
+UMLCheckConstraint* UMLObject::asUMLCheckConstraint() { return dynamic_cast<UMLCheckConstraint*>(this); }
|
||||
+UMLClassifier* UMLObject::asUMLClassifier() { return dynamic_cast<UMLClassifier*>(this); }
|
||||
+UMLClassifierListItem *UMLObject::asUMLClassifierListItem() { return dynamic_cast<UMLClassifierListItem*>(this); }
|
||||
+UMLComponent* UMLObject::asUMLComponent() { return dynamic_cast<UMLComponent*>(this); }
|
||||
+UMLDatatype *UMLObject::asUMLDatatype() { return dynamic_cast<UMLDatatype*>(this); }
|
||||
+UMLEntity* UMLObject::asUMLEntity() { return dynamic_cast<UMLEntity*>(this); }
|
||||
+UMLEntityAttribute* UMLObject::asUMLEntityAttribute() { return dynamic_cast<UMLEntityAttribute*>(this); }
|
||||
+UMLEntityConstraint* UMLObject::asUMLEntityConstraint() { return dynamic_cast<UMLEntityConstraint*>(this); }
|
||||
+UMLEnum* UMLObject::asUMLEnum() { return dynamic_cast<UMLEnum*>(this); }
|
||||
+UMLEnumLiteral* UMLObject::asUMLEnumLiteral() { return dynamic_cast<UMLEnumLiteral*>(this); }
|
||||
+UMLFolder* UMLObject::asUMLFolder() { return dynamic_cast<UMLFolder*>(this); }
|
||||
+UMLForeignKeyConstraint* UMLObject::asUMLForeignKeyConstraint() { return dynamic_cast<UMLForeignKeyConstraint*>(this); }
|
||||
+UMLNode* UMLObject::asUMLNode() { return dynamic_cast<UMLNode*>(this); }
|
||||
+UMLObject* UMLObject::asUMLObject() { return dynamic_cast<UMLObject*>(this); }
|
||||
+UMLOperation* UMLObject::asUMLOperation() { return dynamic_cast<UMLOperation*>(this); }
|
||||
+UMLPackage* UMLObject::asUMLPackage() { return dynamic_cast<UMLPackage*>(this); }
|
||||
+UMLPort* UMLObject::asUMLPort() { return dynamic_cast<UMLPort*>(this); }
|
||||
+UMLRole* UMLObject::asUMLRole() { return dynamic_cast<UMLRole*>(this); }
|
||||
+UMLStereotype* UMLObject::asUMLStereotype() { return dynamic_cast<UMLStereotype*>(this); }
|
||||
+UMLTemplate* UMLObject::asUMLTemplate() { return dynamic_cast<UMLTemplate*>(this); }
|
||||
+UMLUniqueConstraint* UMLObject::asUMLUniqueConstraint() { return dynamic_cast<UMLUniqueConstraint*>(this); }
|
||||
+UMLUseCase* UMLObject::asUMLUseCase() { return dynamic_cast<UMLUseCase*>(this); }
|
||||
|
||||
--
|
||||
2.5.5
|
||||
|
||||
@@ -25,9 +25,10 @@ DEPENDS += " \
|
||||
kxmlgui \
|
||||
"
|
||||
|
||||
PV = "16.12.0"
|
||||
SRC_URI[md5sum] = "d8262de2ca40e1143f2e7ecfbb5a1f07"
|
||||
SRC_URI[sha256sum] = "c61503074550ba4a4210bd7c2a009f49934f559ee7dcfe6f5518fc181ecdf307"
|
||||
PV = "${KDE_APP_VERSION}"
|
||||
SRC_URI += "file://0001-Use-gcc-buildin-null-pointer-check-to-remove-x86-lim.patch"
|
||||
SRC_URI[md5sum] = "d4cd9ef531b22ab14b3b6b1f6259ea8e"
|
||||
SRC_URI[sha256sum] = "2ccd645ab52544885e3b373b0da543ae171d8b41a0bdeb93ae45170f8cd30bb9"
|
||||
|
||||
EXTRA_OECMAKE += "-DBUILD_KF5=1"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user