diff --git a/3Depict-0.0.20-short_type_fix.patch b/3Depict-0.0.20-short_type_fix.patch new file mode 100644 index 0000000..434b8be --- /dev/null +++ b/3Depict-0.0.20-short_type_fix.patch @@ -0,0 +1,127 @@ +diff -r f7be487d31b2 src/backend/APT/APTFileIO.cpp +--- src/backend/APT/APTFileIO.cpp Sun Aug 27 05:07:02 2017 +0100 ++++ src/backend/APT/APTFileIO.cpp Sun Aug 27 05:08:00 2017 +0100 +@@ -22,6 +22,7 @@ + #include "../../common/stringFuncs.h" + #include "../../common/basics.h" + #include "../../common/translation.h" ++#include "../../common/endianTest.h" + + + #include +@@ -1230,9 +1231,9 @@ + pt.switchEndian(); + h.setPos(pt); + +- uint16_t s; +- s =*( (uint16_t*)(buffer+12) ); +- shortSwapBytes(s); ++ uint16_t *s; ++ s =( (uint16_t*)(buffer+12) ); ++ uint16_tSwapBytes(s); + + + +diff -r f7be487d31b2 src/backend/APT/ionhit.cpp +--- src/backend/APT/ionhit.cpp Sun Aug 27 05:07:02 2017 +0100 ++++ src/backend/APT/ionhit.cpp Sun Aug 27 05:08:00 2017 +0100 +@@ -75,14 +75,12 @@ + pos=p; + } + +-#ifdef __LITTLE_ENDIAN__ + void IonHit::switchEndian() + { + + pos.switchEndian(); + floatSwapBytes(&(massToCharge)); + } +-#endif + + const IonHit &IonHit::operator=(const IonHit &obj) + { +diff -r f7be487d31b2 src/backend/APT/ionhit.h +--- src/backend/APT/ionhit.h Sun Aug 27 05:07:02 2017 +0100 ++++ src/backend/APT/ionhit.h Sun Aug 27 05:08:00 2017 +0100 +@@ -64,9 +64,8 @@ + //returns true if any of the 4 data pts are +-inf + bool hasInf(); + +-#ifdef __LITTLE_ENDIAN__ ++ //!Flip the endian of the point contained in this class + void switchEndian(); +-#endif + //this does the endian switch for you + //but you must supply a valid array. + void makePosData(float *floatArr) const; +diff -r f7be487d31b2 src/common/endianTest.h +--- src/common/endianTest.h Sun Aug 27 05:07:02 2017 +0100 ++++ src/common/endianTest.h Sun Aug 27 05:08:00 2017 +0100 +@@ -25,10 +25,12 @@ + #include + #endif + #endif ++#include + + #ifdef __BYTE_ORDER + //if both are not defined it is TRUE! +-#if __BYTE_ORDER == __BIG_ENDIAN ++// on F28 ppc64, is defined as __ORDER_BIG_ENDIAN ++#if (__BYTE_ORDER == __BIG_ENDIAN) || (__BYTE_ORDER == __ORDER_BIG_ENDIAN) + #ifndef __BIG_ENDIAN__ + #define __BIG_ENDIAN__ + #endif +@@ -69,14 +71,14 @@ + + *inFloat=fb.f; + } +-inline void shortSwapBytes(short *inShort) ++inline void uint16_tSwapBytes(uint16_t *inShort) + { + //Use a union to avoid strict-aliasing error +- union ShortSwapUnion{ +- short s; ++ union Uint16SwapUnion{ ++ uint16_t s; + char c[2]; + } ; +- ShortSwapUnion sa,sb; ++ Uint16SwapUnion sa,sb; + sa.s = *inShort; + + sb.c[0] = sa.c[1]; +diff -r f7be487d31b2 src/common/mathfuncs.cpp +--- src/common/mathfuncs.cpp Sun Aug 27 05:07:02 2017 +0100 ++++ src/common/mathfuncs.cpp Sun Aug 27 05:08:00 2017 +0100 +@@ -455,7 +455,6 @@ + return true; + } + +-#ifdef __LITTLE_ENDIAN__ + + void Point3D::switchEndian() + { +@@ -463,7 +462,6 @@ + floatSwapBytes(&value[1]); + floatSwapBytes(&value[2]); + } +-#endif + + std::ostream& operator<<(std::ostream &stream, const Point3D &pt) + { +diff -r f7be487d31b2 src/common/mathfuncs.h +--- src/common/mathfuncs.h Sun Aug 27 05:07:02 2017 +0100 ++++ src/common/mathfuncs.h Sun Aug 27 05:08:00 2017 +0100 +@@ -174,10 +174,9 @@ + static Point3D centroid(const Point3D *p, unsigned int n); + + static Point3D centroid(const std::vector &p); +-#ifdef __LITTLE_ENDIAN__ +- //!Flip the endian state for data stored in this point ++ ++ //!Flip the endian state for data stored in this point + void switchEndian(); +-#endif + }; + + //IMPORTANT!!! diff --git a/3Depict.spec b/3Depict.spec index b6d48d0..92936f0 100644 --- a/3Depict.spec +++ b/3Depict.spec @@ -40,6 +40,8 @@ Patch1: %{name}-%{version}-font-path.patch #Implementes tapsim loading for big-endian # this is to fix a failed scratch build on ppc64 Patch2: %{name}-%{version}-tapsim-endian.patch +#More fixes for ppc64 build failures +Patch3: %{name}-%{version}-short_type_fix.patch %description This software is designed to help users visualize and analyze 3D point clouds @@ -54,6 +56,7 @@ useful for general scalar valued point data purposes. %patch0 %patch1 %patch2 +%patch3 %if 0%{?fedora} > 24 # Installation directory has changed