From c9bfaddccaea45cdb855f51af8cbeb58805435fc Mon Sep 17 00:00:00 2001 From: D Haley Date: Feb 11 2018 01:03:49 +0000 Subject: * remove old patches --- diff --git a/3Depict-0.0.21-s390_preprocessor_fix.patch b/3Depict-0.0.21-s390_preprocessor_fix.patch deleted file mode 100644 index d716174..0000000 --- a/3Depict-0.0.21-s390_preprocessor_fix.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -r 522fed67ed37 src/backend/APT/APTFileIO.cpp ---- src/backend/APT/APTFileIO.cpp Mon Aug 28 13:47:41 2017 +0100 -+++ src/backend/APT/APTFileIO.cpp Mon Aug 28 13:49:44 2017 +0100 -@@ -956,7 +956,7 @@ - ASSERT(forceEndian < 3); - #ifdef __LITTLE_ENDIAN__ - endianFlip=(forceEndian == 2); --#elif __BIG_ENDIAN -+#elif defined(__BIG_ENDIAN__) - endianFlip=(forceEndian == 1); - #endif - } -@@ -1225,7 +1225,7 @@ - - //assign the ID as the mass to charge - h.setMassToCharge(*( (short*)(buffer+12) )); --#elif __BIG_ENDIAN__ -+#elif defined(__BIG_ENDIAN__) - { - Point3D pt((float*)(buffer)); - pt.switchEndian(); diff --git a/3Depict-0.0.21-short_type_fix.patch b/3Depict-0.0.21-short_type_fix.patch deleted file mode 100644 index 434b8be..0000000 --- a/3Depict-0.0.21-short_type_fix.patch +++ /dev/null @@ -1,127 +0,0 @@ -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-0.0.21-tapsim-endian.patch b/3Depict-0.0.21-tapsim-endian.patch deleted file mode 100644 index 24282c2..0000000 --- a/3Depict-0.0.21-tapsim-endian.patch +++ /dev/null @@ -1,125 +0,0 @@ -diff -r cf4c3eefdead -r a369c6597982 src/backend/APT/APTFileIO.cpp ---- src/backend/APT/APTFileIO.cpp Sun Feb 05 14:33:21 2017 +0000 -+++ src/backend/APT/APTFileIO.cpp Sun Feb 05 18:27:46 2017 +0000 -@@ -24,7 +24,6 @@ - #include "../../common/translation.h" - - -- - #include - #include - -@@ -1123,7 +1122,7 @@ - return 0; - } - --//Load a TAPSIM Binfile -+//Load a TAPSIM Binfile, which is the input geometry format for TAPSIM - unsigned int loadTapsimBinFile(const char *fileName, unsigned int &progress, ATOMIC_BOOL &wantAbort, vector &posIons) - { - ifstream f(fileName,std::ios::binary); -@@ -1136,7 +1135,7 @@ - fileSize = f.tellg(); - f.seekg(0,std::ios::beg); - -- //TAPSIM's binary geometery input format is not totally clearly documented -+ //TAPSIM's binary geometry input format is not totally clearly documented - // but an example is provided. So best efforts are us. - - std::string str; -@@ -1202,7 +1201,7 @@ - return TAPSIM_ERR_FILE_FORMAT_FAIL; - } - -- //Contrary to docuemntation, ids appear to be "short", not "unsigned int" -+ //Contrary to documentation, ids appear to be "short", not "unsigned int" - size_t recordSize=( (numbersPresent ? 1:0 )*sizeof(unsigned int) + - 3*sizeof(float) + (idsPresent ?1:0)*sizeof(short)); - -@@ -1222,11 +1221,24 @@ - //Transfer position data - #ifdef __LITTLE_ENDIAN__ - h.setPos(Point3D((float*)(buffer))); --#elif __BIG_ENDIAN__ -- static_assert(false); //TODO: IMPLEMENT ME --#endif -+ - //assign the ID as the mass to charge - h.setMassToCharge(*( (short*)(buffer+12) )); -+#elif __BIG_ENDIAN__ -+ { -+ Point3D pt((float*)(buffer)); -+ pt.switchEndian(); -+ h.setPos(pt); -+ -+ uint16_t s; -+ s =*( (uint16_t*)(buffer+12) ); -+ shortSwapBytes(s); -+ -+ -+ -+ } -+ -+#endif - - posIons[ui]=h; - -@@ -1291,7 +1303,7 @@ - - if(!flip) - { -- //Fkip the endinanness -+ //Flip the endinanness - for(size_t ui=0;ui<4;ui++) - floatSwapBytes(buffer+ui); - } -@@ -1300,7 +1312,7 @@ - outF.write((char*)&intData,4); - - intData=3; -- //Write out verion num as "3" -+ //Write out version num as "3" - outF.write((char*)&intData,4); - - for(size_t ui=0;ui::epsilon())),"Checking read/write OK"); - //Load using auto-detection of endinanness - -- //Load, forcing assuming cont4ents are little endianness as requried -+ //Load, forcing assuming contents are little endianness as required - TEST(!LoadATOFile(filename.c_str(),ions,dummyProgress,wantAbort,1),"ATO load test (forced endianness)"); - TEST(ions.size() == 100,"ion size check"); - TEST((ions[0].getPos().sqrDist(Point3D(1,1,0)) < sqrtf(std::numeric_limits::epsilon())),"checking read/write OK"); -diff -r cf4c3eefdead -r a369c6597982 src/common/endianTest.h ---- src/common/endianTest.h Sun Feb 05 14:33:21 2017 +0000 -+++ src/common/endianTest.h Sun Feb 05 18:27:46 2017 +0000 -@@ -51,7 +51,7 @@ - - inline int is_littleendian() { return (*(char*)&ENDIAN_TEST) == 1 ;} - -- -+//this may fail on some compilers?? - inline void floatSwapBytes(float *inFloat) - { - //Use a union to avoid strict-aliasing error -@@ -69,5 +69,19 @@ - - *inFloat=fb.f; - } -+inline void shortSwapBytes(short *inShort) -+{ -+ //Use a union to avoid strict-aliasing error -+ union ShortSwapUnion{ -+ short s; -+ char c[2]; -+ } ; -+ ShortSwapUnion sa,sb; -+ sa.s = *inShort; - -+ sb.c[0] = sa.c[1]; -+ sb.c[1] = sa.c[0]; -+ -+ *inShort=sb.s; -+} - #endif