[Bug 52008] synaescope and tippercanoe don't work with Sparc Solaris - endian problem
Charles Samuels
charles at kde.org
Mon Aug 11 05:47:26 BST 2003
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=52008
------- Additional Comments From charles at kde.org 2003-08-11 06:47 -------
Subject: kdeaddons/noatun-plugins/tippercanoe
CVS commit by charles:
fix endian according to 52008
(synaescope was fixed too)
CCMAIL:52008 at bugs.kde.org
M +14 -1 core.cpp 1.3
M +3 -0 syna.h 1.7
--- kdeaddons/noatun-plugins/tippercanoe/core.cpp #1.2:1.3
@@ -300,4 +300,7 @@ bool Core::calculate()
int clarity[NumSamples]; //Surround sound
int i,j,k;
+#ifndef LITTLE_ENDIAN
+ register sampleType temp;
+#endif
int brightFactor = int(Brightness * brightnessTwiddler /(starSize+0.01));
@@ -309,6 +312,16 @@ bool Core::calculate()
for(i=0;i<NumSamples;i++)
{
+# ifdef LITTLEENDIAN
x[i] = data[i*2];
y[i] = data[i*2+1];
+# else
+ // Need to convert to big-endian
+ temp = data[i*2];
+ temp = (temp >> 8) | (temp << 8);
+ x[i] = temp;
+ temp = data[i*2+1];
+ temp = (temp << 8) | (temp >> 8);
+ y[i] = temp;
+# endif
}
--- kdeaddons/noatun-plugins/tippercanoe/syna.h #1.6:1.7
@@ -61,4 +61,7 @@ typedef unsigned short sampleType;
#ifdef HAVE_ENDIAN_H
#include <endian.h>
+#elif defined(_BIG_ENDIAN)
+#define BIG_ENDIAN 1
+#define BYTE_ORDER BIG_ENDIAN
#endif
typedef short sampleType;
More information about the kde-multimedia
mailing list