mirror of
https://git.freebsd.org/ports.git
synced 2025-06-15 09:40:35 -04:00
During the exp-run in bug 208158, it was found that graphics/inkscape gives errors with libc++ 3.8.0: libavoid/connector.cpp:888:29: error: call to 'abs' is ambiguous COLA_ASSERT(abs(i->pathNext->id.objID - i->id.objID) != 2); ^~~ This is because abs() is called with unsigned arguments. Fix it by casting the arguments to the appropriate signed types. This mimics what happens with older libraries where the only version of abs() was the one in <stdlib.h>, which is prototyped: int abs(int) The expression used in ConnRef::generatePath() is not strictly correct because it depends on details of integer overflow that are undefined by the C++ standard. PR: 209675 Submitted by: dim
11 lines
467 B
C++
11 lines
467 B
C++
--- src/libavoid/connector.cpp.orig 2014-11-30 18:45:32 UTC
|
|
+++ src/libavoid/connector.cpp
|
|
@@ -885,7 +885,7 @@ bool ConnRef::generatePath(void)
|
|
{
|
|
// Check for consecutive points on opposite
|
|
// corners of two touching shapes.
|
|
- COLA_ASSERT(abs(i->pathNext->id.objID - i->id.objID) != 2);
|
|
+ COLA_ASSERT(abs((int)(i->pathNext->id.objID - i->id.objID)) != 2);
|
|
}
|
|
}
|
|
}
|