mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
a13312ac35
commit
f9ce7b42ab
2 changed files with 5 additions and 5 deletions
|
@ -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*)∈
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue