Object.st
changeset 17590 27334869fa8a
parent 17524 4a059f9d1dee
child 17677 4b68c0b48d73
--- a/Object.st	Thu Mar 05 13:44:33 2015 +0100
+++ b/Object.st	Fri Mar 06 13:17:29 2015 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -256,6 +258,7 @@
     "Modified: / 4.8.1999 / 08:54:06 / stefan"
 ! !
 
+
 !Object class methodsFor:'Compatibility-ST80'!
 
 rootError
@@ -494,6 +497,7 @@
     InfoPrinting := aBoolean
 ! !
 
+
 !Object class methodsFor:'queries'!
 
 isAbstract
@@ -516,6 +520,10 @@
 ! !
 
 
+
+
+
+
 !Object methodsFor:'Compatibility-Dolphin'!
 
 stbFixup: anSTBInFiler at: newObjectIndex
@@ -677,6 +685,8 @@
     "
 ! !
 
+
+
 !Object methodsFor:'accessing'!
 
 _at:index
@@ -2008,6 +2018,7 @@
     ^ aBlock ensure:[ self addDependent:someone ]
 ! !
 
+
 !Object methodsFor:'comparing'!
 
 = anObject
@@ -7868,6 +7879,7 @@
     ^ self
 ! !
 
+
 !Object methodsFor:'secure message sending'!
 
 ?:selector 
@@ -8473,6 +8485,7 @@
     "
 ! !
 
+
 !Object methodsFor:'synchronized evaluation'!
 
 freeSynchronizationSemaphore
@@ -8666,74 +8679,78 @@
     "check for UndefinedObject/SmallInteger receiver or newClass"
 %{
     {
-	OBJ other = otherClass;
-
-	if (__isNonNilObject(self)
-	 && __isNonNilObject(other)
-	 && (other != UndefinedObject)
-	 && (other != SmallInteger)) {
-	    ok = true;
-	} else {
-	    ok = false;
-	}
+        OBJ other = otherClass;
+
+        if (__isNonNilObject(self)
+         && __isNonNilObject(other)
+         && (other != UndefinedObject)
+         && (other != SmallInteger)) {
+            ok = true;
+        } else {
+            ok = false;
+        }
     }
 %}.
     ok ifTrue:[
-	ok := false.
-	myClass := self class.
-	myClass flags == otherClass flags ifTrue:[
-	    myClass instSize == otherClass instSize ifTrue:[
-		"same instance layout and types: its ok to do it"
-		ok := true.
-	    ] ifFalse:[
-		myClass isPointers ifTrue:[
-		    myClass isVariable ifTrue:[
-			ok := true
-		    ]
-		]
-	    ]
-	] ifFalse:[
-	    myClass isPointers ifTrue:[
-		"if newClass is a variable class, with instSize <= my instsize,
-		 we can do it (effectively mapping additional instvars into the
-		 variable part) - usefulness is questionable, though"
-
-		otherClass isPointers ifTrue:[
-		    otherClass isVariable ifTrue:[
-			otherClass instSize <= (myClass instSize + self basicSize)
-			ifTrue:[
-			    ok := true
-			]
-		    ] ifFalse:[
-			otherClass instSize == (myClass instSize + self basicSize)
-			ifTrue:[
-			    ok := true
-			]
-		    ]
-		] ifFalse:[
-		    "it does not make sense to convert pointers to bytes ..."
-		]
-	    ] ifFalse:[
-		"does it make sense, to convert bits ?"
-		"could allow byteArray->wordArray->longArray->floatArray->doubleArray here ..."
-		(myClass isBitsExtended and:[otherClass isBitsExtended]) ifTrue:[
-		    ok := true
-		]
-	    ]
-	]
+        ok := false.
+        myClass := self class.
+        myClass == otherClass ifTrue:[
+            "nothing to change"
+            ^ self.
+        ].
+        myClass flags == otherClass flags ifTrue:[
+            myClass instSize == otherClass instSize ifTrue:[
+                "same instance layout and types: its ok to do it"
+                ok := true.
+            ] ifFalse:[
+                myClass isPointers ifTrue:[
+                    myClass isVariable ifTrue:[
+                        ok := true
+                    ]
+                ]
+            ]
+        ] ifFalse:[
+            myClass isPointers ifTrue:[
+                "if newClass is a variable class, with instSize <= my instsize,
+                 we can do it (effectively mapping additional instvars into the
+                 variable part) - usefulness is questionable, though"
+
+                otherClass isPointers ifTrue:[
+                    otherClass isVariable ifTrue:[
+                        otherClass instSize <= (myClass instSize + self basicSize)
+                        ifTrue:[
+                            ok := true
+                        ]
+                    ] ifFalse:[
+                        otherClass instSize == (myClass instSize + self basicSize)
+                        ifTrue:[
+                            ok := true
+                        ]
+                    ]
+                ] ifFalse:[
+                    "it does not make sense to convert pointers to bytes ..."
+                ]
+            ] ifFalse:[
+                "does it make sense, to convert bits ?"
+                "could allow byteArray->wordArray->longArray->floatArray->doubleArray here ..."
+                (myClass isBitsExtended and:[otherClass isBitsExtended]) ifTrue:[
+                    ok := true
+                ]
+            ]
+        ]
     ].
     ok ifTrue:[
-	"now, change the receivers class ..."
+        "now, change the receivers class ..."
 %{
-	{
-	    OBJ me = self;
-
-	    // gcc4.4 does not like this:
-	    // __qClass(me) = otherClass;
-	    __objPtr(me)->o_class = (CLASS_OBJ)otherClass;
-	    __STORE(me, otherClass);
-	    RETURN (me);
-	}
+        {
+            OBJ me = self;
+
+            // gcc4.4 does not like this:
+            // __qClass(me) = otherClass;
+            __objPtr(me)->o_class = (CLASS_OBJ)otherClass;
+            __STORE(me, otherClass);
+            RETURN (me);
+        }
 %}.
     ].
 
@@ -10192,14 +10209,15 @@
     ^ aVisitor visitObject:self with:aParameter
 ! !
 
+
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.791 2015-02-20 21:31:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.792 2015-03-06 12:17:29 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.791 2015-02-20 21:31:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.792 2015-03-06 12:17:29 stefan Exp $'
 !
 
 version_SVN