commentary
authorClaus Gittinger <cg@exept.de>
Fri, 19 Apr 1996 16:34:24 +0200
changeset 1230 c349c4e9e594
parent 1229 ace799c5765e
child 1231 4f457f654e57
commentary
ByteArray.st
TwoByteString.st
--- a/ByteArray.st	Fri Apr 19 15:39:55 1996 +0200
+++ b/ByteArray.st	Fri Apr 19 16:34:24 1996 +0200
@@ -249,7 +249,8 @@
 !
 
 basicAt:index put:value
-    "set the indexed instance variable with index, anInteger to value
+    "set the indexed instance variable with index, anInteger to value.
+     Returns value (sigh).
      - redefined here to be slighly faster than the default in Object.
      Q: is it worth the extra code ?"
 
@@ -262,27 +263,29 @@
     REGISTER OBJ cls;
 
     if (__bothSmallInteger(index, value)) {
-	val = __intVal(value);
-	if ((unsigned)(val) <= 0xFF /* i.e. (val >= 0) && (val <= 255) */) {
-	    indx = __intVal(index) - 1;
-	    slf = self;
-	    if ((cls = __qClass(slf)) != @global(ByteArray)) {
-		if (((INT)__ClassInstPtr(cls)->c_flags & _MASKSMALLINT(ARRAYMASK))
-		    != _MASKSMALLINT(BYTEARRAY)) {
-		    goto fail;
-		}
-		indx += __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	    }
-	    nIndex = __byteArraySize(slf);
-	    if ((unsigned)indx < (unsigned)nIndex) {
-		__ByteArrayInstPtr(slf)->ba_element[indx] = val;
-		RETURN ( value );
-	    }
-	}
+        val = __intVal(value);
+        if ((unsigned)(val) <= 0xFF /* i.e. (val >= 0) && (val <= 255) */) {
+            indx = __intVal(index) - 1;
+            slf = self;
+            if ((cls = __qClass(slf)) != @global(ByteArray)) {
+                if (((INT)__ClassInstPtr(cls)->c_flags & _MASKSMALLINT(ARRAYMASK))
+                    != _MASKSMALLINT(BYTEARRAY)) {
+                    goto fail;
+                }
+                indx += __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+            }
+            nIndex = __byteArraySize(slf);
+            if ((unsigned)indx < (unsigned)nIndex) {
+                __ByteArrayInstPtr(slf)->ba_element[indx] = val;
+                RETURN ( value );
+            }
+        }
     }
   fail: ;
 %}.
     ^ super basicAt:index put:value
+
+    "Modified: 19.4.1996 / 11:14:40 / cg"
 !
 
 byteAt:index
@@ -2147,5 +2150,5 @@
 !ByteArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.52 1996-04-18 14:38:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.53 1996-04-19 14:33:41 cg Exp $'
 ! !
--- a/TwoByteString.st	Fri Apr 19 15:39:55 1996 +0200
+++ b/TwoByteString.st	Fri Apr 19 16:34:24 1996 +0200
@@ -77,7 +77,8 @@
 !
 
 basicAt:index put:aCharacter
-    "store the argument, aCharacter at position index, an Integer
+    "store the argument, aCharacter at position index, an Integer.
+     Returns aCharacter (sigh).
      - reimplemented here since we store 16-bit characters"
 
     |val|
@@ -86,7 +87,7 @@
     super basicAt:index put:val.
     ^ aCharacter
 
-    "Modified: 26.2.1996 / 17:02:22 / cg"
+    "Modified: 19.4.1996 / 11:16:22 / cg"
 ! !
 
 !TwoByteString methodsFor:'queries'!
@@ -98,6 +99,6 @@
 !TwoByteString class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.21 1996-04-18 16:17:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.22 1996-04-19 14:34:24 cg Exp $'
 ! !
 TwoByteString initialize!