fix build on SunOS (math is ambiguous)

This commit is contained in:
wiedi 2014-02-08 12:53:32 +00:00
parent aae967c02b
commit 53b8b1727f
3 changed files with 29 additions and 1 deletions

View file

@ -1,5 +1,7 @@
$NetBSD: distinfo,v 1.6 2014/02/02 07:19:29 markd Exp $
$NetBSD: distinfo,v 1.7 2014/02/08 12:53:32 wiedi Exp $
SHA1 (umbrello-4.11.5.tar.xz) = f0c3565fd98059fa0c051b2c7c18f5ca80bf28df
RMD160 (umbrello-4.11.5.tar.xz) = 41ce65a4d6537936ced8b37597570ab7791136cd
Size (umbrello-4.11.5.tar.xz) = 1455256 bytes
SHA1 (patch-umbrello_widgets_associationwidget.cpp) = 6b14315f341dffa25e0f8e96175c6c397e57d3f8
SHA1 (patch-umbrello_widgets_floatingdashlinewidget.cpp) = 9e77c211f5d8aed1679dfab6fa6ce131831f9c11

View file

@ -0,0 +1,13 @@
$NetBSD: patch-umbrello_widgets_associationwidget.cpp,v 1.1 2014/02/08 12:53:32 wiedi Exp $
--- umbrello/widgets/associationwidget.cpp.orig 2014-01-02 19:37:28.000000000 +0000
+++ umbrello/widgets/associationwidget.cpp
@@ -2561,7 +2561,7 @@ void AssociationWidget::constrainTextPos
const int y0 = p0.y();
const int x1 = p1.x();
const int y1 = p1.y();
- double r = sqrt((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) / 2;
+ double r = sqrt((double) ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0))) / 2;
if (textWidth > r)
r = textWidth;
// swap textCenter{X,Y} to convert from Qt coord.system.

View file

@ -0,0 +1,13 @@
$NetBSD: patch-umbrello_widgets_floatingdashlinewidget.cpp,v 1.1 2014/02/08 12:53:32 wiedi Exp $
--- umbrello/widgets/floatingdashlinewidget.cpp.orig 2014-01-02 19:37:28.000000000 +0000
+++ umbrello/widgets/floatingdashlinewidget.cpp
@@ -86,7 +86,7 @@ void FloatingDashLineWidget::setText(con
bool FloatingDashLineWidget::onLine(const UMLScenePoint &point)
{
// check if the given point is the start or end point of the line
- if (( (abs( y() + height() - point.y() )) <= POINT_DELTA) || (abs( y() - point.y() ) <= POINT_DELTA)) {
+ if (( (abs( (long) (y() + height() - point.y()) )) <= POINT_DELTA) || (abs( (long) (y() - point.y()) ) <= POINT_DELTA)) {
return true;
}
// check if the given point is the start or end point of the line