reading short floats fixed
authorClaus Gittinger <cg@exept.de>
Mon, 16 Jun 2003 11:22:20 +0200
changeset 7358 7df7aa75e77a
parent 7357 cde54b45c469
child 7359 67d55d0086fb
reading short floats fixed
Behavior.st
--- a/Behavior.st	Mon Jun 16 11:18:21 2003 +0200
+++ b/Behavior.st	Mon Jun 16 11:22:20 2003 +0200
@@ -881,6 +881,7 @@
     "Modified: 23.4.1996 / 15:55:52 / cg"
 ! !
 
+
 !Behavior methodsFor:'Compatibility-Dolphin'!
 
 allSubinstances
@@ -977,15 +978,6 @@
     ^ self nameWithoutPrefix
 ! !
 
-!Behavior methodsFor:'RefactoringBrowser'!
-
-parseTreeFor: aSymbol 
-	"parse a method given a selector - return a perseTree"
-
-	^RBParser 
-	    parseMethod: (self sourceCodeAt: aSymbol)
-	    onError: [:aString :pos | ^nil]
-! !
 
 !Behavior methodsFor:'accessing'!
 
@@ -1288,16 +1280,16 @@
      basicSize "{ Class: SmallInteger }" |
 
     self isPointers ifTrue: [
-	"/
-	"/ inst size not needed - if you uncomment the line below,
-	"/ also uncomment the corresponding line in
-	"/ Object>>storeBinaryDefinitionOn:manager:
-	"/
-	"/ stream next. "skip instSize"
-	self isVariable ifTrue: [
-	    ^ self basicNew:(stream nextNumber:3)
-	].
-	^ self basicNew
+        "/
+        "/ inst size not needed - if you uncomment the line below,
+        "/ also uncomment the corresponding line in
+        "/ Object>>storeBinaryDefinitionOn:manager:
+        "/
+        "/ stream next. "skip instSize"
+        self isVariable ifTrue: [
+            ^ self basicNew:(stream nextNumber:3)
+        ].
+        ^ self basicNew
     ].
 
     "
@@ -1308,37 +1300,37 @@
     obj := self basicNew:basicSize.
 
     self isBytes ifTrue: [
-	stream nextBytes:basicSize into:obj
+        stream nextBytes:basicSize into:obj
     ] ifFalse: [
-	self isWords ifTrue: [
-	    1 to:basicSize do:[:i |
-		obj basicAt:i put:(stream nextNumber:2)
-	    ]
-	] ifFalse:[
-	    self isLongs ifTrue: [
-		1 to:basicSize do:[:i |
-		    obj basicAt:i put:(stream nextNumber:4)
-		]
-	    ] ifFalse:[
-		self isFloats ifTrue: [
-		    "could do it in one big read on machines which use IEEE floats ..."
-		    t := Float basicNew.
-		    1 to:basicSize do:[:i |
-			Float readBinaryIEEESingleFrom:stream into:t.
-			obj basicAt:i put: t
-		    ]
-		] ifFalse:[
-		    self isDoubles ifTrue: [
-			"could do it in one big read on machines which use IEEE doubles ..."
-			t := Float basicNew.
-			1 to:basicSize do:[:i |
-			    Float readBinaryIEEEDoubleFrom:stream into:t.
-			    obj basicAt:i put: t
-			]
-		    ]
-		]
-	    ]
-	]
+        self isWords ifTrue: [
+            1 to:basicSize do:[:i |
+                obj basicAt:i put:(stream nextNumber:2)
+            ]
+        ] ifFalse:[
+            self isLongs ifTrue: [
+                1 to:basicSize do:[:i |
+                    obj basicAt:i put:(stream nextNumber:4)
+                ]
+            ] ifFalse:[
+                self isFloats ifTrue: [
+                    "could do it in one big read on machines which use IEEE floats ..."
+                    t := ShortFloat basicNew.
+                    1 to:basicSize do:[:i |
+                        ShortFloat readBinaryIEEESingleFrom:stream into:t.
+                        obj basicAt:i put: t
+                    ]
+                ] ifFalse:[
+                    self isDoubles ifTrue: [
+                        "could do it in one big read on machines which use IEEE doubles ..."
+                        t := Float basicNew.
+                        1 to:basicSize do:[:i |
+                            Float readBinaryIEEEDoubleFrom:stream into:t.
+                            obj basicAt:i put: t
+                        ]
+                    ]
+                ]
+            ]
+        ]
     ].
     ^obj
 !
@@ -4430,5 +4422,5 @@
 !Behavior class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.226 2003-06-05 13:12:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Behavior.st,v 1.227 2003-06-16 09:22:20 cg Exp $'
 ! !