D Haley f9d723
diff -r f7be487d31b2 src/backend/APT/APTFileIO.cpp
D Haley f9d723
--- src/backend/APT/APTFileIO.cpp	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/backend/APT/APTFileIO.cpp	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -22,6 +22,7 @@
D Haley f9d723
 #include "../../common/stringFuncs.h"
D Haley f9d723
 #include "../../common/basics.h"
D Haley f9d723
 #include "../../common/translation.h"
D Haley f9d723
+#include "../../common/endianTest.h"
D Haley f9d723
 
D Haley f9d723
 
D Haley f9d723
 #include <cstring>
D Haley f9d723
@@ -1230,9 +1231,9 @@
D Haley f9d723
 			pt.switchEndian();
D Haley f9d723
 			h.setPos(pt);
D Haley f9d723
 
D Haley f9d723
-			uint16_t s;
D Haley f9d723
-			s =*( (uint16_t*)(buffer+12) );
D Haley f9d723
-			shortSwapBytes(s);
D Haley f9d723
+			uint16_t *s;
D Haley f9d723
+			s =( (uint16_t*)(buffer+12) );
D Haley f9d723
+			uint16_tSwapBytes(s);
D Haley f9d723
 
D Haley f9d723
 			
D Haley f9d723
 
D Haley f9d723
diff -r f7be487d31b2 src/backend/APT/ionhit.cpp
D Haley f9d723
--- src/backend/APT/ionhit.cpp	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/backend/APT/ionhit.cpp	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -75,14 +75,12 @@
D Haley f9d723
 	pos=p;
D Haley f9d723
 }
D Haley f9d723
 
D Haley f9d723
-#ifdef __LITTLE_ENDIAN__
D Haley f9d723
 void IonHit::switchEndian()
D Haley f9d723
 {
D Haley f9d723
 	
D Haley f9d723
 	pos.switchEndian();
D Haley f9d723
 	floatSwapBytes(&(massToCharge));
D Haley f9d723
 }
D Haley f9d723
-#endif
D Haley f9d723
 
D Haley f9d723
 const IonHit &IonHit::operator=(const IonHit &obj)
D Haley f9d723
 {
D Haley f9d723
diff -r f7be487d31b2 src/backend/APT/ionhit.h
D Haley f9d723
--- src/backend/APT/ionhit.h	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/backend/APT/ionhit.h	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -64,9 +64,8 @@
D Haley f9d723
 		//returns true if any of the 4 data pts are +-inf
D Haley f9d723
 		bool hasInf();
D Haley f9d723
 
D Haley f9d723
-#ifdef __LITTLE_ENDIAN__		
D Haley f9d723
+		//!Flip the endian of the point contained in this class
D Haley f9d723
 		void switchEndian();
D Haley f9d723
-#endif
D Haley f9d723
 		//this does the endian switch for you
D Haley f9d723
 		//but you must supply a valid array.
D Haley f9d723
 		void makePosData(float *floatArr) const;
D Haley f9d723
diff -r f7be487d31b2 src/common/endianTest.h
D Haley f9d723
--- src/common/endianTest.h	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/common/endianTest.h	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -25,10 +25,12 @@
D Haley f9d723
 #include <endian.h>
D Haley f9d723
 #endif
D Haley f9d723
 #endif
D Haley f9d723
+#include <stdint.h>
D Haley f9d723
 
D Haley f9d723
 #ifdef __BYTE_ORDER
D Haley f9d723
 //if both are not defined it is TRUE!
D Haley f9d723
-#if __BYTE_ORDER == __BIG_ENDIAN
D Haley f9d723
+// on F28 ppc64, is defined as __ORDER_BIG_ENDIAN
D Haley f9d723
+#if (__BYTE_ORDER == __BIG_ENDIAN) || (__BYTE_ORDER == __ORDER_BIG_ENDIAN)
D Haley f9d723
 #ifndef __BIG_ENDIAN__
D Haley f9d723
 #define __BIG_ENDIAN__
D Haley f9d723
 #endif
D Haley f9d723
@@ -69,14 +71,14 @@
D Haley f9d723
 
D Haley f9d723
 	*inFloat=fb.f;
D Haley f9d723
 }
D Haley f9d723
-inline void shortSwapBytes(short *inShort)
D Haley f9d723
+inline void uint16_tSwapBytes(uint16_t *inShort)
D Haley f9d723
 {
D Haley f9d723
 	//Use a union to avoid strict-aliasing error
D Haley f9d723
-	union ShortSwapUnion{
D Haley f9d723
-	   short s;
D Haley f9d723
+	union Uint16SwapUnion{
D Haley f9d723
+	   uint16_t s;
D Haley f9d723
 	   char c[2];
D Haley f9d723
 	} ;
D Haley f9d723
-	ShortSwapUnion sa,sb;
D Haley f9d723
+	Uint16SwapUnion sa,sb;
D Haley f9d723
 	sa.s = *inShort;
D Haley f9d723
 
D Haley f9d723
 	sb.c[0] = sa.c[1];
D Haley f9d723
diff -r f7be487d31b2 src/common/mathfuncs.cpp
D Haley f9d723
--- src/common/mathfuncs.cpp	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/common/mathfuncs.cpp	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -455,7 +455,6 @@
D Haley f9d723
 	return true;
D Haley f9d723
 }
D Haley f9d723
 
D Haley f9d723
-#ifdef __LITTLE_ENDIAN__
D Haley f9d723
 
D Haley f9d723
 void Point3D::switchEndian()
D Haley f9d723
 {
D Haley f9d723
@@ -463,7 +462,6 @@
D Haley f9d723
 	floatSwapBytes(&value[1]);
D Haley f9d723
 	floatSwapBytes(&value[2]);
D Haley f9d723
 }
D Haley f9d723
-#endif
D Haley f9d723
 
D Haley f9d723
 std::ostream& operator<<(std::ostream &stream, const Point3D &pt)
D Haley f9d723
 {
D Haley f9d723
diff -r f7be487d31b2 src/common/mathfuncs.h
D Haley f9d723
--- src/common/mathfuncs.h	Sun Aug 27 05:07:02 2017 +0100
D Haley f9d723
+++ src/common/mathfuncs.h	Sun Aug 27 05:08:00 2017 +0100
D Haley f9d723
@@ -174,10 +174,9 @@
D Haley f9d723
 		static Point3D centroid(const Point3D *p, unsigned int n);
D Haley f9d723
 		
D Haley f9d723
 		static Point3D centroid(const std::vector<Point3D> &p); 
D Haley f9d723
-#ifdef __LITTLE_ENDIAN__
D Haley f9d723
-                //!Flip the endian state for data stored in this point
D Haley f9d723
+
D Haley f9d723
+		//!Flip the endian state for data stored in this point
D Haley f9d723
                 void switchEndian();
D Haley f9d723
-#endif
D Haley f9d723
 };
D Haley f9d723
 
D Haley f9d723
 //IMPORTANT!!!