--- a/ShortFloat.st Wed Apr 20 20:11:13 2016 +0100
+++ b/ShortFloat.st Thu Apr 21 07:59:19 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 1996 by Claus Gittinger
All Rights Reserved
@@ -348,6 +346,7 @@
^ Epsilon
! !
+
!ShortFloat class methodsFor:'binary storage'!
readBinaryIEEESingleFrom:aStream
@@ -384,22 +383,22 @@
"Modified: / 23-08-2006 / 16:01:47 / cg"
!
-readBinaryIEEESingleFrom:aStream into:aFloat
+readBinaryIEEESingleFrom:aStream into:aBasicNewShortFloat
"read a float value from the binary stream, aStream,
interpreting the next bytes as an IEEE formatted 4-byte float.
The bytes are read in the native byte order (i.e.lsb on intel)"
- ^ self readBinaryIEEESingleFrom:aStream into:aFloat MSB:(UninterpretedBytes isBigEndian)
+ ^ self readBinaryIEEESingleFrom:aStream into:aBasicNewShortFloat MSB:(UninterpretedBytes isBigEndian)
"Modified: / 23-08-2006 / 16:01:52 / cg"
!
-readBinaryIEEESingleFrom:aStream into:aFloat MSB:msb
+readBinaryIEEESingleFrom:aStream into:aBasicNewShortFloat MSB:msb
"read a float value from the binary stream, aStream,
interpreting the next bytes as an IEEE formatted 4-byte float.
If msb is true, the stream bytes are most-significant-first."
- aFloat class == self ifFalse:[self error:'no a ShortFloat'].
+ aBasicNewShortFloat class == self ifFalse:[self error:'no a ShortFloat'].
"
this implementation is wrong: does not work on non-IEEE machines
@@ -409,14 +408,14 @@
self isIEEEFormat ifFalse:[self error:'unsupported operation'].
(UninterpretedBytes isBigEndian == msb) ifFalse:[
- "swap the bytes"
- 4 to:1 by:-1 do:[:i |
- aFloat basicAt:i put:(aStream next)
- ].
- ^ self
+ "swap the bytes"
+ 4 to:1 by:-1 do:[:i |
+ aBasicNewShortFloat basicAt:i put:(aStream next)
+ ].
+ ^ self
].
1 to:4 do:[:i |
- aFloat basicAt:i put:aStream next
+ aBasicNewShortFloat basicAt:i put:aStream next
]
"not part of libboss, as this is also used by others (TIFFReader)"