office-gobmx/external/box2d/fix-strict-aliasing-error.patch
Sarper Akdemir a46ab778d9 box2d: fix strict aliasing error and ignore -Wshadow
Adding two patches to static external library box2d
getting rid of strict aliasing error and ignoring
-Wshadow in b2Draw.h to get rid of errors while building.

Change-Id: I5752eb484d6aafe057c9102b1ed87aaf31d6555c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96559
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-06-20 01:41:37 +02:00

13 lines
567 B
Diff

diff -ru box2d/Box2D/Box2D/Common/b2Math.h box2d_patched/Box2D/Box2D/Common/b2Math.h
--- box2d/Box2D/Box2D/Common/b2Math.h 2014-04-06 03:43:12.000000000 +0300
+++ box2d_patched/Box2D/Box2D/Common/b2Math.h 2020-06-16 07:37:31.713248714 +0300
@@ -25,8 +25,7 @@
/// This function is used to ensure that a floating point number is not a NaN or infinity.
inline bool b2IsValid(float32 x)
{
- int32 ix = *reinterpret_cast<int32*>(&x);
- return (ix & 0x7f800000) != 0x7f800000;
+ return isfinite(x);
}
/// This is a approximate yet fast inverse square-root.