summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/prc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-09-28 22:01:49 +0000
committerKarl Berry <karl@freefriends.org>2009-09-28 22:01:49 +0000
commit4ffd67ef7a9a1a465d2a8cc35a785edb149de24a (patch)
tree3d4edc7989e1207e31f6df6da1cb6cc1172a0cd1 /Build/source/utils/asymptote/prc
parente2e3d91772c578b56fb93aa7c6b6e519034ae2a1 (diff)
asymptote 1.87
git-svn-id: svn://tug.org/texlive/trunk@15535 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/asymptote/prc')
-rw-r--r--Build/source/utils/asymptote/prc/PRCbitStream.cc14
-rw-r--r--Build/source/utils/asymptote/prc/PRCdouble.cc2
-rw-r--r--Build/source/utils/asymptote/prc/PRCdouble.h40
-rw-r--r--Build/source/utils/asymptote/prc/oPRCFile.cc4
4 files changed, 28 insertions, 32 deletions
diff --git a/Build/source/utils/asymptote/prc/PRCbitStream.cc b/Build/source/utils/asymptote/prc/PRCbitStream.cc
index 2aa6d73ce98..5df27320e45 100644
--- a/Build/source/utils/asymptote/prc/PRCbitStream.cc
+++ b/Build/source/utils/asymptote/prc/PRCbitStream.cc
@@ -198,22 +198,22 @@ PRCbitStream& PRCbitStream::operator <<(double value)
writeBit(1);
-#if defined(WORDS_LITTLE_ENDIAN)
- pb=((PRCbyte *)&value)+6;
-#elif defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
pb=((PRCbyte *)&value)+1;
+#else
+ pb=((PRCbyte *)&value)+6;
#endif
//add_bits((*pb)&0x0f,4 STAT_V STAT_DOUBLE);
writeBits((*pb)&0x0F,4);
NEXTBYTE(pb);
pbStart=pb;
-#if defined(WORDS_LITTLE_ENDIAN)
- pbEnd=
- pbStop= ((PRCbyte *)&value);
-#elif defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
pbEnd=
pbStop= ((PRCbyte *)(&value+1))-1;
+#else
+ pbEnd=
+ pbStop= ((PRCbyte *)&value);
#endif
if((fSaveAtEnd=(*pbStop!=*BEFOREBYTE(pbStop)))!=0)
diff --git a/Build/source/utils/asymptote/prc/PRCdouble.cc b/Build/source/utils/asymptote/prc/PRCdouble.cc
index c51dd6317da..9a1668ab007 100644
--- a/Build/source/utils/asymptote/prc/PRCdouble.cc
+++ b/Build/source/utils/asymptote/prc/PRCdouble.cc
@@ -22,7 +22,7 @@ int stCOFDOECompare(const void* pcofdoe1,const void* pcofdoe2)
EXPONENT(((const struct sCodageOfFrequentDoubleOrExponent *)pcofdoe2)->u2uod.Value));
}
-#if defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
void *memrchr(const void *buf,int c,size_t count)
{
unsigned char
diff --git a/Build/source/utils/asymptote/prc/PRCdouble.h b/Build/source/utils/asymptote/prc/PRCdouble.h
index 30d49ffd819..c21d33e5dc9 100644
--- a/Build/source/utils/asymptote/prc/PRCdouble.h
+++ b/Build/source/utils/asymptote/prc/PRCdouble.h
@@ -16,14 +16,13 @@ union ieee754_double
/* This is the IEEE 754 double-precision format. */
struct
{
-#if defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
unsigned int negative:1;
unsigned int exponent:11;
/* Together these comprise the mantissa. */
unsigned int mantissa0:20;
unsigned int mantissa1:32;
-#endif
-#if defined(WORDS_LITTLE_ENDIAN)
+#else
/* Together these comprise the mantissa. */
unsigned int mantissa1:32;
unsigned int mantissa0:20;
@@ -49,21 +48,7 @@ struct sCodageOfFrequentDoubleOrExponent
} u2uod;
};
-#if defined(WORDS_LITTLE_ENDIAN)
-# define DOUBLEWITHTWODWORD(upper,lower) lower,upper
-# define UPPERPOWER (1)
-# define LOWERPOWER (!UPPERPOWER)
-
-# define NEXTBYTE(pbd) ((pbd)--)
-# define PREVIOUSBYTE(pbd) ((pbd)++)
-# define MOREBYTE(pbd,pbend) ((pbd)>=(pbend))
-# define OFFSETBYTE(pbd,offset) ((pbd)-=offset)
-# define BEFOREBYTE(pbd) ((pbd)+1)
-# define DIFFPOINTERS(p1,p2) ((unsigned)((p2)-(p1)))
-# define SEARCHBYTE(pbstart,b,nb) (unsigned char *)memchr((pbstart),(b),(nb))
-# define BYTEAT(pb,i) *((pb)+(i))
-
-#elif defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
# define DOUBLEWITHTWODWORD(upper,lower) upper,lower
# define UPPERPOWER (0)
# define LOWERPOWER (!UPPERPOWER)
@@ -77,7 +62,18 @@ struct sCodageOfFrequentDoubleOrExponent
# define SEARCHBYTE(pbstart,b,nb) (unsigned char *)memrchr((pbstart),(b),(nb))
# define BYTEAT(pb,i) *((pb)-(i))
#else
-# error "Big/Little endian to be defined"
+# define DOUBLEWITHTWODWORD(upper,lower) lower,upper
+# define UPPERPOWER (1)
+# define LOWERPOWER (!UPPERPOWER)
+
+# define NEXTBYTE(pbd) ((pbd)--)
+# define PREVIOUSBYTE(pbd) ((pbd)++)
+# define MOREBYTE(pbd,pbend) ((pbd)>=(pbend))
+# define OFFSETBYTE(pbd,offset) ((pbd)-=offset)
+# define BEFOREBYTE(pbd) ((pbd)+1)
+# define DIFFPOINTERS(p1,p2) ((unsigned)((p2)-(p1)))
+# define SEARCHBYTE(pbstart,b,nb) (unsigned char *)memchr((pbstart),(b),(nb))
+# define BYTEAT(pb,i) *((pb)+(i))
#endif
#define MAXLENGTHFORCOMPRESSEDTYPE ((22+1+1+4+6*(1+8))+7)/8
@@ -95,9 +91,9 @@ extern PRCdword stadwZero[2],stadwNegativeZero[2];
#define NUMBEROFELEMENTINACOFDOE (2077)
-#if defined( WORDS_BIG_ENDIAN )
+#ifdef WORDS_BIGENDIAN
# define DOUBLEWITHTWODWORDINTREE(upper,lower) {upper,lower}
-#elif defined( WORDS_LITTLE_ENDIAN )
+#else
# define DOUBLEWITHTWODWORDINTREE(upper,lower) {lower,upper}
#endif
extern sCodageOfFrequentDoubleOrExponent acofdoe[NUMBEROFELEMENTINACOFDOE];
@@ -109,7 +105,7 @@ struct sCodageOfFrequentDoubleOrExponent* getcofdoe(unsigned,short);
int stCOFDOECompare(const void*,const void*);
-#if defined(WORDS_BIG_ENDIAN)
+#ifdef WORDS_BIGENDIAN
void *memrchr(const void *,int,size_t);
#endif
diff --git a/Build/source/utils/asymptote/prc/oPRCFile.cc b/Build/source/utils/asymptote/prc/oPRCFile.cc
index a9d6b2e2156..e65910d56dd 100644
--- a/Build/source/utils/asymptote/prc/oPRCFile.cc
+++ b/Build/source/utils/asymptote/prc/oPRCFile.cc
@@ -573,12 +573,12 @@ void makeAppUUID(uint32_t *UUID)
void writeUINT32_T(std::ostream &out, uint32_t data)
{
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
out.write(((char*)&data)+3,1);
out.write(((char*)&data)+2,1);
out.write(((char*)&data)+1,1);
out.write(((char*)&data)+0,1);
-#elif WORDS_LITTLE_ENDIAN
+#else
out.write(((char*)&data)+0,1);
out.write(((char*)&data)+1,1);
out.write(((char*)&data)+2,1);