From 39b420e17d4a0ea0848d7d94e70ad891b35ae3a4 Mon Sep 17 00:00:00 2001 From: D Haley Date: Feb 11 2018 01:03:11 +0000 Subject: * Update to 0.0.21 --- diff --git a/.gitignore b/.gitignore index db1a723..f53c1de 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /3Depict-0.0.18.tar.gz /3Depict-0.0.19.tar.gz /3Depict-0.0.20.tar.gz +/3Depict-0.0.21.tar.gz diff --git a/3Depict-0.0.20-font-path.patch b/3Depict-0.0.20-font-path.patch deleted file mode 100644 index 9a52b58..0000000 --- a/3Depict-0.0.20-font-path.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- src/wx/wxcomponents.cpp -+++ src/wx/wxcomponents.cpp -@@ -555,16 +555,17 @@ std::string TTFFinder::nxFindFont(const char *fontFile) - //(Oh look Ma, I'm autoconf!) - - const char *dirs[] = { ".", -- "/usr/share/fonts/truetype", //Old debian -+ "/usr/local/share/fonts/truetype", // User fonts - "/usr/share/fonts/truetype/freefont", // New debian - "/usr/share/fonts/truetype/ttf-dejavu", //New debian -- "/usr/local/share/fonts/truetype", // User fonts -+ "/usr/share/fonts/truetype", //Old debian -+ "/usr/share/fonts/dejavu", //Fedora - "/usr/X11R6/lib/X11/fonts/truetype", - "/usr/X11R6/lib64/X11/fonts/truetype", -- "/usr/lib/X11/fonts/truetype",// Fedora 32 -- "/usr/lib64/X11/fonts/truetype", //Fedora 64 -- "/usr/local/lib/X11/fonts/truetype", // Fedora 32 new -- "/usr/local/lib64/X11/fonts/truetype",// Fedora 64 new -+ "/usr/lib/X11/fonts/truetype", -+ "/usr/lib64/X11/fonts/truetype", -+ "/usr/local/lib/X11/fonts/truetype", -+ "/usr/local/lib64/X11/fonts/truetype", - "", - }; //MUST end with "". - diff --git a/3Depict-0.0.20-manual-pdf-loc.patch b/3Depict-0.0.20-manual-pdf-loc.patch deleted file mode 100644 index b2d23c4..0000000 --- a/3Depict-0.0.20-manual-pdf-loc.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- src/gui/mainFrame.cpp -+++ src/gui/mainFrame.cpp -@@ -2904,9 +2904,9 @@ void MainWindowFrame::OnHelpHelp(wxCommandEvent &event) - string s; - s=locateDataFile("3Depict-manual.pdf"); - -- //Also Debian makes us use the lowercase "D", so check there too. -- if(!s.size()) -- s=locateDataFile("3depict-manual.pdf"); -+ //Also Fedora has diff dir -+ if(!wxFileExists(s)) -+ s="/usr/share/doc/3Depict-0.0.8/3Depict-0.0.8-manual.pdf"; - - //FIXME: under windows, currently we use "manual.pdf" - if(!s.size()) diff --git a/3Depict-0.0.20-s390_preprocessor_fix.patch b/3Depict-0.0.20-s390_preprocessor_fix.patch deleted file mode 100644 index d716174..0000000 --- a/3Depict-0.0.20-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.20-short_type_fix.patch b/3Depict-0.0.20-short_type_fix.patch deleted file mode 100644 index 434b8be..0000000 --- a/3Depict-0.0.20-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.20-tapsim-endian.patch b/3Depict-0.0.20-tapsim-endian.patch deleted file mode 100644 index 24282c2..0000000 --- a/3Depict-0.0.20-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 diff --git a/3Depict-0.0.21-font-path.patch b/3Depict-0.0.21-font-path.patch new file mode 100644 index 0000000..9a52b58 --- /dev/null +++ b/3Depict-0.0.21-font-path.patch @@ -0,0 +1,26 @@ +--- src/wx/wxcomponents.cpp ++++ src/wx/wxcomponents.cpp +@@ -555,16 +555,17 @@ std::string TTFFinder::nxFindFont(const char *fontFile) + //(Oh look Ma, I'm autoconf!) + + const char *dirs[] = { ".", +- "/usr/share/fonts/truetype", //Old debian ++ "/usr/local/share/fonts/truetype", // User fonts + "/usr/share/fonts/truetype/freefont", // New debian + "/usr/share/fonts/truetype/ttf-dejavu", //New debian +- "/usr/local/share/fonts/truetype", // User fonts ++ "/usr/share/fonts/truetype", //Old debian ++ "/usr/share/fonts/dejavu", //Fedora + "/usr/X11R6/lib/X11/fonts/truetype", + "/usr/X11R6/lib64/X11/fonts/truetype", +- "/usr/lib/X11/fonts/truetype",// Fedora 32 +- "/usr/lib64/X11/fonts/truetype", //Fedora 64 +- "/usr/local/lib/X11/fonts/truetype", // Fedora 32 new +- "/usr/local/lib64/X11/fonts/truetype",// Fedora 64 new ++ "/usr/lib/X11/fonts/truetype", ++ "/usr/lib64/X11/fonts/truetype", ++ "/usr/local/lib/X11/fonts/truetype", ++ "/usr/local/lib64/X11/fonts/truetype", + "", + }; //MUST end with "". + diff --git a/3Depict-0.0.21-manual-pdf-loc.patch b/3Depict-0.0.21-manual-pdf-loc.patch new file mode 100644 index 0000000..b2d23c4 --- /dev/null +++ b/3Depict-0.0.21-manual-pdf-loc.patch @@ -0,0 +1,15 @@ +--- src/gui/mainFrame.cpp ++++ src/gui/mainFrame.cpp +@@ -2904,9 +2904,9 @@ void MainWindowFrame::OnHelpHelp(wxCommandEvent &event) + string s; + s=locateDataFile("3Depict-manual.pdf"); + +- //Also Debian makes us use the lowercase "D", so check there too. +- if(!s.size()) +- s=locateDataFile("3depict-manual.pdf"); ++ //Also Fedora has diff dir ++ if(!wxFileExists(s)) ++ s="/usr/share/doc/3Depict-0.0.8/3Depict-0.0.8-manual.pdf"; + + //FIXME: under windows, currently we use "manual.pdf" + if(!s.size()) diff --git a/3Depict-0.0.21-qhull.patch b/3Depict-0.0.21-qhull.patch new file mode 100644 index 0000000..835831b --- /dev/null +++ b/3Depict-0.0.21-qhull.patch @@ -0,0 +1,12 @@ +diff -r 031db7992cf7 src/backend/filters/algorithms/convexHull.h +--- src/backend/filters/algorithms/convexHull.h Sun Feb 11 00:27:02 2018 +0000 ++++ src/backend/filters/algorithms/convexHull.h Sun Feb 11 00:34:47 2018 +0000 +@@ -35,7 +35,7 @@ + #endif + extern "C" + { +- #include ++ #include + } + #ifdef __POWERPC__ + #pragma pop_macro("__POWERPC__") diff --git a/3Depict-0.0.21-s390_preprocessor_fix.patch b/3Depict-0.0.21-s390_preprocessor_fix.patch new file mode 100644 index 0000000..d716174 --- /dev/null +++ b/3Depict-0.0.21-s390_preprocessor_fix.patch @@ -0,0 +1,21 @@ +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 new file mode 100644 index 0000000..434b8be --- /dev/null +++ b/3Depict-0.0.21-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-0.0.21-tapsim-endian.patch b/3Depict-0.0.21-tapsim-endian.patch new file mode 100644 index 0000000..24282c2 --- /dev/null +++ b/3Depict-0.0.21-tapsim-endian.patch @@ -0,0 +1,125 @@ +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 diff --git a/3Depict.spec b/3Depict.spec index 66fda80..4935d6d 100644 --- a/3Depict.spec +++ b/3Depict.spec @@ -1,6 +1,6 @@ Name: 3Depict -Version: 0.0.20 -Release: 7%{?dist} +Version: 0.0.21 +Release: 1%{?dist} Summary: Valued 3D point cloud visualization and analysis Group: Applications/Engineering @@ -37,13 +37,8 @@ BuildRequires: qhull-devel Patch0: %{name}-%{version}-manual-pdf-loc.patch #Fedora specific font dir 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 -#Fixes for build under s390/ppc64, due to endianness problems -Patch3: %{name}-%{version}-s390_preprocessor_fix.patch -#Fixes for build under s390/ppc64, due to type problems -Patch4: %{name}-%{version}-short_type_fix.patch +#Qhull dir has changed +Patch2: %{name}-%{version}-qhull.patch %description This software is designed to help users visualize and analyze 3D point clouds @@ -58,8 +53,6 @@ useful for general scalar valued point data purposes. %patch0 %patch1 %patch2 -%patch3 -%patch4 %if 0%{?fedora} > 24 # Installation directory has changed @@ -125,6 +118,9 @@ mv docs/manual-latex/manual.pdf %{name}-%{version}-manual.pdf %changelog +* Sat Feb 10 2018 D Haley - 0.0.21-1 +- Update to 0.0.21 + * Wed Feb 07 2018 Fedora Release Engineering - 0.0.20-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild diff --git a/sources b/sources index 2039ffd..cac1c82 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (3Depict-0.0.20.tar.gz) = e9a68e57c56a0fc9246a70b0bb031a40c54726ba38663fddc9f92995826bc17641fa6cb6872773de39b762e340f03f114a1509ed640bcfc06b266260f1e17654 +SHA512 (3Depict-0.0.21.tar.gz) = 7f9ed4813675c7977df9fd5cc83af3c03e2c91f8d724ebe497d120bd5db0b25843bfdb8d01d495be08f86ed63117755f87be9a81bb4c6b48246c9b7144dec984