Fixe byte swapping error in double.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3091 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1998-10-20 15:33:50 +00:00
parent a13312ac35
commit f9ce7b42ab
2 changed files with 5 additions and 5 deletions

View file

@ -228,7 +228,7 @@ static inline unsigned long long
NSSwapLongLong(unsigned long long in)
{
union swap {
unsigned long num;
unsigned long long num;
unsigned char byt[8];
} dst;
union swap *src = (union swap*)∈

View file

@ -704,8 +704,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len, NSZone* zone)
NSSwappedFloat nf;
[self deserializeBytes: &nf
length: sizeof(NSSwappedFloat)
atCursor: cursor];
length: sizeof(NSSwappedFloat)
atCursor: cursor];
*(float*)data = NSSwapBigFloatToHost(nf);
break;
}
@ -713,8 +713,8 @@ readContentsOfFile(NSString* path, void** buf, unsigned* len, NSZone* zone)
NSSwappedDouble nd;
[self deserializeBytes: &nd
length: sizeof(NSSwappedDouble)
atCursor: cursor];
length: sizeof(NSSwappedDouble)
atCursor: cursor];
*(double*)data = NSSwapBigDoubleToHost(nd);
break;
}