diff options
author | V3n3RiX <venerix@koprulu.sector> | 2024-05-10 00:01:14 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2024-05-10 00:01:14 +0100 |
commit | 17e5f1ea4a2e1c5664f96480ca46348d008e8711 (patch) | |
tree | 7166d1b58a582290a4ad23ff5882cca911b8035c /x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch | |
parent | a0ce545d52f231499bf9f3644493113d8af58ec9 (diff) |
gentoo auto-resync : 10:05:2024 - 00:01:13
Diffstat (limited to 'x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch')
-rw-r--r-- | x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch b/x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch new file mode 100644 index 000000000000..e95b1f6a1a7d --- /dev/null +++ b/x11-misc/rss-glx/files/rss-glx-0.9.1-strict-aliasing.patch @@ -0,0 +1,36 @@ +Fix strict aliasing violation in FMotion.cpp + +Bug: https://bugs.gentoo.org/928251 + +--- a/src/FMotion.cpp ++++ b/src/FMotion.cpp +@@ -22,6 +22,7 @@ + */ + + #include <stdio.h> ++#include <string.h> + #include <cmath> + + // In case cmath doesn't pull in all the usual suspects from math.h +@@ -54,15 +55,19 @@ + #define FLOATTOINTCONST2 (((65536.0*16))) + inline int f2int2 (float f) + { ++ int i; + f += FLOATTOINTCONST2; +- return ((*((int *)(void *)&f)) & 0x007fffff) - 0x00400000; ++ memcpy(&i, &f, sizeof(i)); ++ return (i & 0x007fffff) - 0x00400000; + } + + #define FLOATTOINTCONST (((1.5*65536*256))) + inline int f2int (float f) + { ++ int i; + f += FLOATTOINTCONST; +- return ((*((int *)(void *)&f)) & 0x007fffff) - 0x00400000; ++ memcpy(&i, &f, sizeof(i)); ++ return (i & 0x007fffff) - 0x00400000; + } + + #define Float2Int(f) (f2int(f)) |