*** empty log message ***
authorsr
Fri, 15 Sep 2017 17:11:53 +0200
changeset 22261 aed33b3ee44e
parent 22260 067e256d2340
child 22262 e587cdd22868
*** empty log message ***
UninterpretedBytes.st
--- a/UninterpretedBytes.st	Fri Sep 15 17:02:36 2017 +0200
+++ b/UninterpretedBytes.st	Fri Sep 15 17:11:53 2017 +0200
@@ -2,7 +2,7 @@
 
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -37,26 +37,38 @@
 #define __fetchBytePointerAndSize__(o, pPtr, pSize) \
     {\
       if (__isNonNilObject(o)) { \
-        if (__isByteArrayLike(o)) { \
-          *(pPtr) = (unsigned char *)__ByteArrayInstPtr(o)->ba_element; \
-          *(pSize) = __byteArraySize(o); \
-        } else if (__qIsExternalBytesLike(o)) { \
-          OBJ __sz__ = __externalBytesSize(o); \
-          if (__isSmallInteger(__sz__)) { \
-            *(pSize) = __intVal(__sz__); \
-            *(pPtr) = (unsigned char *)(__externalBytesAddress(o)); \
-          } else { \
-            *(pSize) = 0; \
-            *(pPtr) = (unsigned char *)0; \
-          } \
-        } else { \
-            *(pSize) /* nInstBytes */ = OHDR_SIZE + __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(o))->c_ninstvars)); \
-            *(pPtr) = (char *)(__InstPtr(self)) + *(pSize) /* nInstBytes */; \
-            *(pSize) = __qSize(self) - *(pSize) /* nInstBytes */; \
-        } \
+	if (__isByteArrayLike(o)) { \
+	  *(pPtr) = (unsigned char *)__ByteArrayInstPtr(o)->ba_element; \
+	  *(pSize) = __byteArraySize(o); \
+	} else if (__qIsExternalBytesLike(o)) { \
+	  OBJ __sz__ = __externalBytesSize(o); \
+	  if (__isSmallInteger(__sz__)) { \
+	    *(pSize) = __intVal(__sz__); \
+	    *(pPtr) = (unsigned char *)(__externalBytesAddress(o)); \
+	  } else { \
+	    *(pSize) = 0; \
+	    *(pPtr) = (unsigned char *)0; \
+	  } \
+	} else { \
+	    if (__isFloatArray(o)) { \
+		*(pSize) = sizeof(struct __FloatArray) - sizeof(float) + __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(o))->c_ninstvars)); \
+	    } else { \
+		if (__isDoubleArray(o)) { \
+		    *(pSize) = sizeof(struct __DoubleArray) - sizeof(double) + __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(o))->c_ninstvars)); \
+		} else { \
+		    if (__isLongLongsOrSignedLongLongs(o)) { \
+			*(pSize) = sizeof(struct __LongIntegerArray) - sizeof(__uint64__) + __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(o))->c_ninstvars)); \
+		    } else { \
+			*(pSize) /* nInstBytes */ = OHDR_SIZE + __OBJS2BYTES__(__intVal(__ClassInstPtr(__qClass(o))->c_ninstvars)); \
+		    } \
+		} \
+	    } \
+	    *(pPtr) = (char *)(__InstPtr(self)) + *(pSize) /* nInstBytes */; \
+	    *(pSize) = __qSize(self) - *(pSize) /* nInstBytes */; \
+	} \
       } else { \
-        *(pSize) = 0; \
-        *(pPtr) = (unsigned char *)0; \
+	*(pSize) = 0; \
+	*(pPtr) = (unsigned char *)0; \
       } \
     }
 
@@ -68,7 +80,7 @@
 copyright
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
-              All Rights Reserved
+	      All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -83,28 +95,28 @@
 "
     UninterpretedBytes provides the common protocol for byte-storage
     containers; concrete subclasses are
-        ByteArray (which store the bytes within the Smalltalk object memory)
-        String    (knows that the bytes represent characters)
+	ByteArray (which store the bytes within the Smalltalk object memory)
+	String    (knows that the bytes represent characters)
     and
-        ExternalBytes (which store the bytes in the malloc-heap).
+	ExternalBytes (which store the bytes in the malloc-heap).
 
     UninterpretedBytes itself is abstract, so no instances of it can be created.
 
     [See also:]
-        ByteArray String ExternalBytes
+	ByteArray String ExternalBytes
 
     [author:]
-        Claus Gittinger
+	Claus Gittinger
 
     [Notice:]
-        Notice the confusion due to multiple methods with the same
-        functionality (i.e. 'xxxx:MSB:' vs. 'xxxx:bigEndian:').
-        The reason is that at the time this class was written,
-        ST80 did not offer protocol to specify the byteOrder, and
-        ST/X provided methods ending in 'MSB:' for this.
-        In the meanwhile, VW added protocol ending in 'bigEndian:',
-        which has been added here for compatibility.
-        (certainly a point, where an ansi-standard will help)
+	Notice the confusion due to multiple methods with the same
+	functionality (i.e. 'xxxx:MSB:' vs. 'xxxx:bigEndian:').
+	The reason is that at the time this class was written,
+	ST80 did not offer protocol to specify the byteOrder, and
+	ST/X provided methods ending in 'MSB:' for this.
+	In the meanwhile, VW added protocol ending in 'bigEndian:',
+	which has been added here for compatibility.
+	(certainly a point, where an ansi-standard will help)
 "
 ! !
 
@@ -144,9 +156,9 @@
     bytes := self new: sz // 2.
     s := aString readStream.
     1 to: sz // 2 do: [ :idx |
-        hi := s next digitValue.
-        lo := s next digitValue.
-        bytes at:idx put: ((hi bitShift:4) bitOr: lo)
+	hi := s next digitValue.
+	lo := s next digitValue.
+	bytes at:idx put: ((hi bitShift:4) bitOr: lo)
     ].
     ^ bytes
 
@@ -161,7 +173,7 @@
     "
     "
      Time millisecondsToRun:[
-        1000000 timesRepeat:[ ByteArray fromHexString:'1234FEFF1234FEFF1234FEFF1234FEFF' ]
+	1000000 timesRepeat:[ ByteArray fromHexString:'1234FEFF1234FEFF1234FEFF1234FEFF' ]
      ].
     "
 
@@ -174,17 +186,17 @@
      See also fromHexString:, which does something similar, but does not allow for spaces"
 
     ^ self streamContents:[:outStream |
-        |inStream h|
-
-        inStream := aString readStream.
-
-        [
-            inStream skipSeparators.
-            inStream atEnd
-        ] whileFalse:[
-            h := inStream next:2.
-            outStream nextPut:(Integer readFrom:h base:16).
-        ].
+	|inStream h|
+
+	inStream := aString readStream.
+
+	[
+	    inStream skipSeparators.
+	    inStream atEnd
+	] whileFalse:[
+	    h := inStream next:2.
+	    outStream nextPut:(Integer readFrom:h base:16).
+	].
     ].
 
     "
@@ -224,47 +236,47 @@
 
     last := aString last codePoint.
     last > 96 ifTrue:[
-        stop := stop - 3 + (last - 96)
+	stop := stop - 3 + (last - 96)
     ].
     bytes := self new:stop.
 
     index := 1. dstIndex := 1.
     [dstIndex <= stop] whileTrue:[
-        "/ take 4 characters ...
-        "/ allow a line break before each group of 4
-        sixBits := (aString at:index) codePoint.
-        [sixBits < 32] whileTrue:[
-            index := index + 1.
-            sixBits := (aString at:index) codePoint.
-        ].
-        sixBits := sixBits bitAnd:16r3F.
-        n := sixBits.
-
-        "/ self assert:(aString at:index+1) codePoint >= 32.
-        sixBits := (aString at:index+1) codePoint bitAnd:16r3F.
-        n := (n bitShift:6) + sixBits.
-
-        "/ self assert:(aString at:index+2) codePoint >= 32.
-        sixBits := (aString at:index+2) codePoint bitAnd:16r3F.
-        n := (n bitShift:6) + sixBits.
-
-        "/ self assert:(aString at:index+3) codePoint >= 32.
-        sixBits := (aString at:index+3) codePoint bitAnd:16r3F.
-        n := (n bitShift:6) + sixBits.
-
-        index := index + 4.
-
-        "/ now have 24 bits in n
-
-        bytes at:dstIndex put:(n bitShift:-16).
-
-        dstIndex < stop ifTrue:[
-            bytes at:dstIndex+1 put:((n bitShift:-8) bitAnd:16rFF).
-            dstIndex+2 <= stop ifTrue:[
-                bytes at:dstIndex+2 put:(n bitAnd:16rFF).
-            ]
-        ].
-        dstIndex := dstIndex + 3.
+	"/ take 4 characters ...
+	"/ allow a line break before each group of 4
+	sixBits := (aString at:index) codePoint.
+	[sixBits < 32] whileTrue:[
+	    index := index + 1.
+	    sixBits := (aString at:index) codePoint.
+	].
+	sixBits := sixBits bitAnd:16r3F.
+	n := sixBits.
+
+	"/ self assert:(aString at:index+1) codePoint >= 32.
+	sixBits := (aString at:index+1) codePoint bitAnd:16r3F.
+	n := (n bitShift:6) + sixBits.
+
+	"/ self assert:(aString at:index+2) codePoint >= 32.
+	sixBits := (aString at:index+2) codePoint bitAnd:16r3F.
+	n := (n bitShift:6) + sixBits.
+
+	"/ self assert:(aString at:index+3) codePoint >= 32.
+	sixBits := (aString at:index+3) codePoint bitAnd:16r3F.
+	n := (n bitShift:6) + sixBits.
+
+	index := index + 4.
+
+	"/ now have 24 bits in n
+
+	bytes at:dstIndex put:(n bitShift:-16).
+
+	dstIndex < stop ifTrue:[
+	    bytes at:dstIndex+1 put:((n bitShift:-8) bitAnd:16rFF).
+	    dstIndex+2 <= stop ifTrue:[
+		bytes at:dstIndex+2 put:(n bitAnd:16rFF).
+	    ]
+	].
+	dstIndex := dstIndex + 3.
     ].
     ^ bytes
 
@@ -283,13 +295,13 @@
      ByteArray fromPackedString:((ByteArray new:64) asPackedString)
 
      0 to:256 do:[:l |
-        |orig copy|
-
-        0 to:255 do:[:fill |
-            orig := ByteArray new:l withAll:fill.
-            copy := ByteArray fromPackedString:(orig asPackedString).
-            self assert:(orig = copy).
-         ]
+	|orig copy|
+
+	0 to:255 do:[:fill |
+	    orig := ByteArray new:l withAll:fill.
+	    copy := ByteArray fromPackedString:(orig asPackedString).
+	    self assert:(orig = copy).
+	 ]
      ]
     "
 
@@ -316,72 +328,72 @@
     REGISTER OBJ *op;
 
     if (__isSmallInteger(anInteger)) {
-        nindexedinstvars = __intVal(anInteger);
-        if (nindexedinstvars >= 0) {
-            if (self == ByteArray) {
-                /*
-                 * the most common case
-                 */
-                instsize = OHDR_SIZE + nindexedinstvars;
-                if (__CanDoQuickNew(instsize)) {        /* OBJECT ALLOCATION */
-                    __qCheckedNew(newobj, instsize);
-                    __InstPtr(newobj)->o_class = self;
-                    __qSTORE(newobj, self);
-                    RETURN (newobj );
-                }
-            } else {
-                /*
-                 * Take care for subclasses like TwoByteString
-                 */
-                switch (__smallIntegerVal(__ClassInstPtr(self)->c_flags) & ARRAYMASK) {
-                case BYTEARRAY:
-                    break;
-
-                case WORDARRAY:
-                case SWORDARRAY:
-                    nindexedinstvars *= 2;
-                    break;
-
-                case LONGARRAY:
-                case SLONGARRAY:
-                    nindexedinstvars *= 4;
-                    break;
-
-                default:
-                    /* don't know about this array type, delegate to super */
-                    goto out;
-                }
-            }
-            nInstVars = __intVal(__ClassInstPtr(self)->c_ninstvars);
-            instsize = OHDR_SIZE + __OBJS2BYTES__(nInstVars) + nindexedinstvars;
-            __PROTECT_CONTEXT__
-            __qNew(newobj, instsize);   /* OBJECT ALLOCATION */
-            __UNPROTECT_CONTEXT__
-            if (newobj != nil) {
-                __InstPtr(newobj)->o_class = self;
-                __qSTORE(newobj, self);
-                if (nInstVars) {
-                    /*
-                     * still have to nil out named instvars ...
-                     */
+	nindexedinstvars = __intVal(anInteger);
+	if (nindexedinstvars >= 0) {
+	    if (self == ByteArray) {
+		/*
+		 * the most common case
+		 */
+		instsize = OHDR_SIZE + nindexedinstvars;
+		if (__CanDoQuickNew(instsize)) {        /* OBJECT ALLOCATION */
+		    __qCheckedNew(newobj, instsize);
+		    __InstPtr(newobj)->o_class = self;
+		    __qSTORE(newobj, self);
+		    RETURN (newobj );
+		}
+	    } else {
+		/*
+		 * Take care for subclasses like TwoByteString
+		 */
+		switch (__smallIntegerVal(__ClassInstPtr(self)->c_flags) & ARRAYMASK) {
+		case BYTEARRAY:
+		    break;
+
+		case WORDARRAY:
+		case SWORDARRAY:
+		    nindexedinstvars *= 2;
+		    break;
+
+		case LONGARRAY:
+		case SLONGARRAY:
+		    nindexedinstvars *= 4;
+		    break;
+
+		default:
+		    /* don't know about this array type, delegate to super */
+		    goto out;
+		}
+	    }
+	    nInstVars = __intVal(__ClassInstPtr(self)->c_ninstvars);
+	    instsize = OHDR_SIZE + __OBJS2BYTES__(nInstVars) + nindexedinstvars;
+	    __PROTECT_CONTEXT__
+	    __qNew(newobj, instsize);   /* OBJECT ALLOCATION */
+	    __UNPROTECT_CONTEXT__
+	    if (newobj != nil) {
+		__InstPtr(newobj)->o_class = self;
+		__qSTORE(newobj, self);
+		if (nInstVars) {
+		    /*
+		     * still have to nil out named instvars ...
+		     */
 #if defined(memset4) && defined(FAST_OBJECT_MEMSET4)
-                    memset4(__InstPtr(newobj)->i_instvars, nil, nInstVars);
+		    memset4(__InstPtr(newobj)->i_instvars, nil, nInstVars);
 #else
 # if defined(FAST_MEMSET) && !defined(NEGATIVE_ADDRESSES)
-                    /*
-                     * knowing that nil is 0
-                     */
-                    memset(__InstPtr(newobj)->i_instvars, 0, instsize - OHDR_SIZE);
+		    /*
+		     * knowing that nil is 0
+		     */
+		    memset(__InstPtr(newobj)->i_instvars, 0, instsize - OHDR_SIZE);
 # else
-                    op = __InstPtr(newobj)->i_instvars;
-                    while (nInstVars--)
-                        *op++ = nil;
+		    op = __InstPtr(newobj)->i_instvars;
+		    while (nInstVars--)
+			*op++ = nil;
 # endif
 #endif
-                }
-                RETURN ( newobj );
-            }
-        }
+		}
+		RETURN ( newobj );
+	    }
+	}
     }
 out:;
 %}.
@@ -408,7 +420,7 @@
 
 readHexFrom:aString
     "same as fromHexString: for squeak/Pharo compatibility"
-    
+
     ^ self fromHexString:aString
 
     "
@@ -434,7 +446,7 @@
      I.e. false for vax, intel; true for m68k, sun.
 
      Notice: UninterpretedBytes isBigEndian
-             this is inlined both by stc and the jit compiler"
+	     this is inlined both by stc and the jit compiler"
 
 %{  /* NOCONTEXT */
 
@@ -455,8 +467,8 @@
      *    constant for systems where this is known.
      */
     union {
-        unsigned int   u_l;
-        char           u_c[sizeof(int)];
+	unsigned int   u_l;
+	char           u_c[sizeof(int)];
     } u;
 
     u.u_l = 0x87654321;
@@ -827,7 +839,7 @@
      The index is a smalltalk index (i.e. 1-based).
      Depending on msb, the value is retrieved MSB or LSB-first."
 
-   ^ self unsignedInt64At:index MSB:msb 
+   ^ self unsignedInt64At:index MSB:msb
 
     "
      |b|
@@ -1359,9 +1371,9 @@
      The index is a smalltalk index (i.e. 1-based).
      The value is retrieved MSB (high 8 bits at lower index) if msb is true;
      LSB-first (i.e. low 8-bits at lower byte index) if it's false.
-     Notice: 
-        the index is a byte index; thus, this allows for unaligned access to
-        words on any boundary.
+     Notice:
+	the index is a byte index; thus, this allows for unaligned access to
+	words on any boundary.
      Question: should it be retrieve signed values ? (see ByteArray>>signedWordAt:)"
 
     ^ self unsignedInt16At:index MSB:msb
@@ -1520,7 +1532,7 @@
 
     w := self unsignedInt128At:index MSB:msb.
     (w > (16r7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)) ifTrue:[
-        ^ w - (16r100000000000000000000000000000000)
+	^ w - (16r100000000000000000000000000000000)
     ].
     ^ w
 
@@ -1542,7 +1554,7 @@
 
     v := anInteger.
     anInteger < 0 ifTrue:[
-        v := v + 16r100000000000000000000000000000000
+	v := v + 16r100000000000000000000000000000000
     ].
     self unsignedInt128At:byteIndex put:v MSB:msb.
     ^ anInteger
@@ -1568,15 +1580,15 @@
 
     l := LargeInteger basicNew numberOfDigits:16.
     msb ifTrue:[
-        bIdx := byteIndex + 15.
-        delta := -1
+	bIdx := byteIndex + 15.
+	delta := -1
     ] ifFalse:[
-        bIdx := byteIndex.
-        delta := 1
+	bIdx := byteIndex.
+	delta := 1
     ].
     1 to:16 do:[:i |
-        l digitAt:i put:(self byteAt:bIdx).
-        bIdx := bIdx + delta
+	l digitAt:i put:(self byteAt:bIdx).
+	bIdx := bIdx + delta
     ].
     ^ l compressed
 
@@ -1599,21 +1611,21 @@
     |bIdx  "{ Class: SmallInteger }"
      delta "{ Class: SmallInteger }"|
 
-    ((anInteger < 0) 
+    ((anInteger < 0)
      or:[anInteger > 16rFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF]) ifTrue:[
-        ^ self elementBoundsError:anInteger
+	^ self elementBoundsError:anInteger
     ].
 
     msb ifTrue:[
-        bIdx := byteIndex + 15.
-        delta := -1
+	bIdx := byteIndex + 15.
+	delta := -1
     ] ifFalse:[
-        bIdx := byteIndex.
-        delta := 1
+	bIdx := byteIndex.
+	delta := 1
     ].
     1 to:16 do:[:i |
-        self byteAt:bIdx put:(anInteger digitAt:i).
-        bIdx := bIdx + delta.
+	self byteAt:bIdx put:(anInteger digitAt:i).
+	bIdx := bIdx + delta.
     ].
     ^ anInteger
 
@@ -1630,7 +1642,7 @@
 !UninterpretedBytes methodsFor:'accessing-arbitrary-long ints'!
 
 nativeIntAt:index
-    "return the 4- or 8-bytes (depending on the native integer/pointer size) 
+    "return the 4- or 8-bytes (depending on the native integer/pointer size)
      starting at index as a signed Integer.
      The index is a smalltalk index (i.e. 1-based).
      The value is retrieved in the machine's natural byte order,
@@ -1644,40 +1656,40 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            unsigned INT idx = ((unsigned INT)__intVal(index)) - 1;
-
-            if ((idx+(sizeof(INT)-1)) < sz) {
-                cp += idx;
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    unsigned INT idx = ((unsigned INT)__intVal(index)) - 1;
+
+	    if ((idx+(sizeof(INT)-1)) < sz) {
+		cp += idx;
 #if defined(__i386__)
-                /*
-                 * aligned or not, we don't care (i386 can do both)
-                 */
-                {
-                    INT iVal = ((INT *)cp)[0];
-
-                    RETURN (__MKINT(iVal));
-                }
+		/*
+		 * aligned or not, we don't care (i386 can do both)
+		 */
+		{
+		    INT iVal = ((INT *)cp)[0];
+
+		    RETURN (__MKINT(iVal));
+		}
 #else
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(INT)-1)) == 0) {
-                    INT iVal = ((INT *)cp)[0];
-
-                    RETURN (__MKINT(iVal));
-                }
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(INT)-1)) == 0) {
+		    INT iVal = ((INT *)cp)[0];
+
+		    RETURN (__MKINT(iVal));
+		}
 #endif
-            }
-        }
+	    }
+	}
     }
 %}.
     SmallInteger maxBytes == 8 ifTrue:[
-        ^ self signedInt64At:index
+	^ self signedInt64At:index
     ].
     ^ self signedInt32At:index
 
@@ -1701,46 +1713,46 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            unsigned INT idx = ((unsigned INT)__intVal(index)) - 1;
-
-            if ((idx+(sizeof(INT)-1)) < sz) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(INT)-1)) == 0) {
-                    INT __v;
-
-                    if (__isSmallInteger(value)) {
-                        // how about a range check?
-                        ((INT *)cp)[0] = (INT)(__intVal(value));
-                        RETURN (value);
-                    }
-                    if ((__v = __signedLongIntVal(value)) != 0) {
-                        // how about a range check?
-                        ((INT *)cp)[0] = (INT)(__v);
-                        RETURN (value);
-                    }
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    unsigned INT idx = ((unsigned INT)__intVal(index)) - 1;
+
+	    if ((idx+(sizeof(INT)-1)) < sz) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(INT)-1)) == 0) {
+		    INT __v;
+
+		    if (__isSmallInteger(value)) {
+			// how about a range check?
+			((INT *)cp)[0] = (INT)(__intVal(value));
+			RETURN (value);
+		    }
+		    if ((__v = __signedLongIntVal(value)) != 0) {
+			// how about a range check?
+			((INT *)cp)[0] = (INT)(__v);
+			RETURN (value);
+		    }
+		}
+	    }
+	}
     }
 %}.
     SmallInteger maxBytes == 8 ifTrue:[
-        ^ self signedInt64At:index put:value MSB:IsBigEndian
+	^ self signedInt64At:index put:value MSB:IsBigEndian
     ].
-    ^ self signedInt32At:index put:value MSB:IsBigEndian    
+    ^ self signedInt32At:index put:value MSB:IsBigEndian
 
     "
      |b|
      b := ByteArray new:8.
      b nativeIntAt:1 put:SmallInteger maxVal.
-     (b nativeIntAt:1) 
+     (b nativeIntAt:1)
     "
 !
 
@@ -1759,36 +1771,36 @@
 
     val := 0.
     bigEndian ifTrue:[
-        highByte := self at:iIndex.
-        iIndex to:last do:[:i |
-            val := (val<<8) + (self byteAt:i)
-        ]
+	highByte := self at:iIndex.
+	iIndex to:last do:[:i |
+	    val := (val<<8) + (self byteAt:i)
+	]
     ] ifFalse:[
-        highByte := self at:last.
-        last to:iIndex by:-1 do:[:i |
-            val := (val<<8) + (self byteAt:i)
-        ]
+	highByte := self at:last.
+	last to:iIndex by:-1 do:[:i |
+	    val := (val<<8) + (self byteAt:i)
+	]
     ].
     (highByte bitTest:16r80) ifTrue:[
-        ^ val - (1 bitShift:(len*8))
-    ].    
+	^ val - (1 bitShift:(len*8))
+    ].
     ^ val
 
     "
      |b|
      b := #[ 16r01 16rFF 16r00 16r04 16r05 ].
      (b signedIntegerAt:2 length:2 bigEndian:false). ' -> 255 (00FF) '.
-     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> -256 (FF00) '.   
+     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> -256 (FF00) '.
 
      b := #[ 16r01 16r00 16rFF 16r04 16r05 ].
      (b signedIntegerAt:2 length:2 bigEndian:false). ' -> -256 (FF00) '.
-     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> 255 (00FF) '.   
+     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> 255 (00FF) '.
 
      b := #[ 16r01 16r7F 16r00 16r04 16r05 ].
      (b signedIntegerAt:2 length:2 bigEndian:false). ' -> 127 (007F) '.
-     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> 32512 (7F00) '.      
-    "
-    
+     (b signedIntegerAt:2 length:2 bigEndian:true).  ' -> 32512 (7F00) '.
+    "
+
     "
      |b|
      b := #[ 16r01 16r02 16r03 16r04 16r05 ].
@@ -1820,13 +1832,13 @@
 
     val := 0.
     bigEndian ifTrue:[
-        iIndex to:last do:[:i |
-            val := (val<<8) + (self byteAt:i)
-        ]
+	iIndex to:last do:[:i |
+	    val := (val<<8) + (self byteAt:i)
+	]
     ] ifFalse:[
-        last to:iIndex by:-1 do:[:i |
-            val := (val<<8) + (self byteAt:i)
-        ]
+	last to:iIndex by:-1 do:[:i |
+	    val := (val<<8) + (self byteAt:i)
+	]
     ].
     ^ val
 
@@ -1855,15 +1867,15 @@
 
     val := newValue.
     bigEndian ifTrue:[
-        iIndex to:last do:[:i |
-            self byteAt:i put:(val bitAnd:16rFF).
-            val := val bitShift:-8.
-        ]
+	iIndex to:last do:[:i |
+	    self byteAt:i put:(val bitAnd:16rFF).
+	    val := val bitShift:-8.
+	]
     ] ifFalse:[
-        last to:iIndex by:-1 do:[:i |
-            self byteAt:i put:(val bitAnd:16rFF).
-            val := val bitShift:-8.
-        ]
+	last to:iIndex by:-1 do:[:i |
+	    self byteAt:i put:(val bitAnd:16rFF).
+	    val := val bitShift:-8.
+	]
     ].
 
     "
@@ -1886,8 +1898,8 @@
     ^ (self byteAt:index) decodeFromBCD
 
     "
-     #[ 16r55 ] bcdByteAt:1 
-     #[ 16r99 ] bcdByteAt:1  
+     #[ 16r55 ] bcdByteAt:1
+     #[ 16r99 ] bcdByteAt:1
      #[ 16rAA ] bcdByteAt:1
     "
 
@@ -1900,7 +1912,7 @@
      (i.e. the value n is encoded as: ((n // 10) * 16) + (n \\ 10)"
 
     (aNumber between:0 and:99) ifFalse:[
-        self elementBoundsError:aNumber.
+	self elementBoundsError:aNumber.
     ].
     ^ self byteAt:index put:aNumber encodeAsBCD
 
@@ -1921,18 +1933,18 @@
 
 %{ /* NOCONTEXT */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
-
-            if (idx < sz) {
-                unsigned char ch = cp[idx] & 0xFF;
-                RETURN (__mkSmallInteger( ch ));
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
+
+	    if (idx < sz) {
+		unsigned char ch = cp[idx] & 0xFF;
+		RETURN (__mkSmallInteger( ch ));
+	    }
+	}
     }
 %}.
 
@@ -1944,18 +1956,18 @@
      b byteAt:1 put:16rFF.
      b byteAt:2 put:16r7F.
      b byteAt:3 put:16r80.
-     b byteAt:1.    
-     b byteAt:2.     
-     b byteAt:3.     
+     b byteAt:1.
+     b byteAt:2.
+     b byteAt:3.
 
      |b|
      b := ExternalBytes new:3.
      b byteAt:1 put:16rFF.
      b byteAt:2 put:16r7F.
      b byteAt:3 put:16r80.
-     b byteAt:1.    
-     b byteAt:2.     
-     b byteAt:3.     
+     b byteAt:1.
+     b byteAt:2.
+     b byteAt:3.
     "
 
     "Modified: / 01-07-1996 / 21:13:53 / cg"
@@ -1969,21 +1981,21 @@
 
 %{ /* NOCONTEXT */
     if (__isSmallInteger(byteIndex) && __isSmallInteger(anInteger)) {
-        unsigned char *cp;
-        INT sz;
-        INT val = __intVal(anInteger);
-
-        if ( ((unsigned INT)val) <= 0xFF ) {
-            __fetchBytePointerAndSize__(self, &cp, &sz);
-            if (cp) {
-                unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
-
-                if (idx < sz) {
-                    cp[idx] = val & 0xFF;
-                    RETURN (anInteger);
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+	INT val = __intVal(anInteger);
+
+	if ( ((unsigned INT)val) <= 0xFF ) {
+	    __fetchBytePointerAndSize__(self, &cp, &sz);
+	    if (cp) {
+		unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
+
+		if (idx < sz) {
+		    cp[idx] = val & 0xFF;
+		    RETURN (anInteger);
+		}
+	    }
+	}
     }
 %}.
 
@@ -1995,9 +2007,9 @@
      b byteAt:1 put:16rFF.
      b byteAt:2 put:16r7F.
      b byteAt:3 put:16r80.
-     b byteAt:1.    
-     b byteAt:2.     
-     b byteAt:3.     
+     b byteAt:1.
+     b byteAt:2.
+     b byteAt:3.
     "
 
     "Modified (comment): / 07-02-2017 / 19:32:26 / stefan"
@@ -2013,25 +2025,25 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
-            char ch;
-
-            if (idx < sz) {
-                cp += idx;
-                ch = cp[0];
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    unsigned INT idx = ((unsigned INT)__intVal(byteIndex)) - 1;
+	    char ch;
+
+	    if (idx < sz) {
+		cp += idx;
+		ch = cp[0];
 # ifndef HAS_SIGNED_CHAR
-                if ( (unsigned int)ch >= 0x80 ) {
-                    ch = ch - 0x100;                
-                }
+		if ( (unsigned int)ch >= 0x80 ) {
+		    ch = ch - 0x100;
+		}
 #endif
-                RETURN (__mkSmallInteger( ch ));
-            }
-        }
+		RETURN (__mkSmallInteger( ch ));
+	    }
+	}
     }
 %}.
 
@@ -2043,9 +2055,9 @@
      b at:1 put:16rFF.
      b at:2 put:16r7F.
      b at:3 put:16r80.
-     b signedByteAt:1.    
-     b signedByteAt:2.     
-     b signedByteAt:3.     
+     b signedByteAt:1.
+     b signedByteAt:2.
+     b signedByteAt:3.
     "
 
     "Modified: / 01-07-1996 / 21:13:53 / cg"
@@ -2062,7 +2074,7 @@
 
     b := aSignedByteValue.
     b < 0 ifTrue:[
-        b := 16r100 + b
+	b := 16r100 + b
     ].
     self byteAt:byteIndex put:b.
     ^ aSignedByteValue
@@ -2101,33 +2113,33 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(index) - 1;
-
-            if ((idx >= 0) && ((idx+(sizeof(double)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(double)-1)) == 0) {
-                    double dVal = ((double *)cp)[0];
-                    OBJ f;
-
-                    __qMKFLOAT(f, dVal);
-                    RETURN (f);
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(index) - 1;
+
+	    if ((idx >= 0) && ((idx+(sizeof(double)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(double)-1)) == 0) {
+		    double dVal = ((double *)cp)[0];
+		    OBJ f;
+
+		    __qMKFLOAT(f, dVal);
+		    RETURN (f);
+		}
+	    }
+	}
     }
 %}.
 
     newFloat := Float basicNew.
     1 to:8 do:[:destIndex|
-        newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 
@@ -2152,12 +2164,12 @@
     |newFloat|
 
     msb == IsBigEndian ifTrue:[
-        ^ self doubleAt:index.
+	^ self doubleAt:index.
     ].
 
     newFloat := Float basicNew.
     1 to:8 do:[:destIndex|
-        newFloat basicAt:(9-destIndex) put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:(9-destIndex) put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 
@@ -2180,40 +2192,40 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(index) - 1;
-
-            if ((idx >= 0) && ((idx+(sizeof(double)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(double)-1)) == 0) {
-                    if (__isFloat(aFloat)) {
-                        ((double *)cp)[0] = __floatVal(aFloat);
-                        RETURN (aFloat);
-                    }
-                    if (__isShortFloat(aFloat)) {
-                        ((double *)cp)[0] = (double)(__shortFloatVal(aFloat));
-                        RETURN (aFloat);
-                    }
-                    if (__isSmallInteger(aFloat)) {
-                        ((double *)cp)[0] = (double)(__intVal(aFloat));
-                        RETURN (aFloat);
-                    }
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(index) - 1;
+
+	    if ((idx >= 0) && ((idx+(sizeof(double)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(double)-1)) == 0) {
+		    if (__isFloat(aFloat)) {
+			((double *)cp)[0] = __floatVal(aFloat);
+			RETURN (aFloat);
+		    }
+		    if (__isShortFloat(aFloat)) {
+			((double *)cp)[0] = (double)(__shortFloatVal(aFloat));
+			RETURN (aFloat);
+		    }
+		    if (__isSmallInteger(aFloat)) {
+			((double *)cp)[0] = (double)(__intVal(aFloat));
+			RETURN (aFloat);
+		    }
+		}
+	    }
+	}
     }
 %}.
 
     flt := aFloat asFloat.
     1 to:8 do:[:srcIndex|
-        self byteAt:(index - 1 + srcIndex) put:(flt basicAt:srcIndex)
+	self byteAt:(index - 1 + srcIndex) put:(flt basicAt:srcIndex)
     ].
     ^ aFloat
 !
@@ -2230,12 +2242,12 @@
     |flt|
 
     msb == IsBigEndian ifTrue:[
-        ^ self doubleAt:index put:aFloat.
+	^ self doubleAt:index put:aFloat.
     ].
 
     flt := aFloat asFloat.
     1 to:8 do:[:srcIndex|
-        self byteAt:(index - 1 + srcIndex) put:(flt basicAt:(9-srcIndex))
+	self byteAt:(index - 1 + srcIndex) put:(flt basicAt:(9-srcIndex))
     ].
     ^ aFloat
 
@@ -2260,33 +2272,33 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(index) - 1;
-
-            if ((idx >= 0) && ((idx+(sizeof(float)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(float)-1)) == 0) {
-                    float fVal = ((float *)cp)[0];
-                    OBJ f;
-
-                    __qMKSFLOAT(f, fVal);
-                    RETURN (f);
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(index) - 1;
+
+	    if ((idx >= 0) && ((idx+(sizeof(float)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(float)-1)) == 0) {
+		    float fVal = ((float *)cp)[0];
+		    OBJ f;
+
+		    __qMKSFLOAT(f, fVal);
+		    RETURN (f);
+		}
+	    }
+	}
     }
 %}.
 
     newFloat := ShortFloat basicNew.
     1 to:4 do:[:destIndex|
-        newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 !
@@ -2304,12 +2316,12 @@
     |newFloat|
 
     msb == IsBigEndian ifTrue:[
-        ^ self floatAt:index
+	^ self floatAt:index
     ].
 
     newFloat := ShortFloat basicNew.
     1 to:4 do:[:destIndex|
-        newFloat basicAt:(5-destIndex) put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:(5-destIndex) put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 
@@ -2333,41 +2345,41 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(index)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(index) - 1;
-
-            if ((idx >= 0) && ((idx+(sizeof(float)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(float)-1)) == 0) {
-                    if (__isShortFloat(aFloat)) {
-                        ((float *)cp)[0] = __shortFloatVal(aFloat);
-                        RETURN (self);
-                    }
-                    if (__isFloat(aFloat)) {
-                        ((float *)cp)[0] = (float)__floatVal(aFloat);
-                        RETURN (self);
-                    }
-                    if (__isSmallInteger(aFloat)) {
-                        ((float *)cp)[0] = (float)__intVal(aFloat);
-                        RETURN (self);
-                    }
-                    // bail out to smalltalk code
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(index) - 1;
+
+	    if ((idx >= 0) && ((idx+(sizeof(float)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(float)-1)) == 0) {
+		    if (__isShortFloat(aFloat)) {
+			((float *)cp)[0] = __shortFloatVal(aFloat);
+			RETURN (self);
+		    }
+		    if (__isFloat(aFloat)) {
+			((float *)cp)[0] = (float)__floatVal(aFloat);
+			RETURN (self);
+		    }
+		    if (__isSmallInteger(aFloat)) {
+			((float *)cp)[0] = (float)__intVal(aFloat);
+			RETURN (self);
+		    }
+		    // bail out to smalltalk code
+		}
+	    }
+	}
     }
 %}.
 
     sflt := aFloat asShortFloat.
     1 to:4 do:[:srcIndex|
-        self byteAt:index - 1 + srcIndex put:(sflt basicAt:srcIndex)
+	self byteAt:index - 1 + srcIndex put:(sflt basicAt:srcIndex)
     ].
 !
 
@@ -2383,13 +2395,13 @@
     |sflt|
 
     msb == IsBigEndian ifTrue:[
-        self floatAt:index put:aFloat.
-        ^ self.
+	self floatAt:index put:aFloat.
+	^ self.
     ].
 
     sflt := aFloat asShortFloat.
     1 to:4 do:[:srcIndex|
-        self byteAt:(index - 1 + srcIndex) put:(sflt basicAt:(5-srcIndex))
+	self byteAt:(index - 1 + srcIndex) put:(sflt basicAt:(5-srcIndex))
     ].
 
     "Created: / 15.5.1998 / 17:20:41 / cg"
@@ -2459,8 +2471,8 @@
     "store the value of the argument, aFloat into the receiver
      starting at index, which is a smalltalk index (i.e. 1-based).
      Storage is in IEEE floating point single precision format.
-     (i.e. 4 bytes are stored in the native byte order). 
-     Since ST/X floats are really doubles, 
+     (i.e. 4 bytes are stored in the native byte order).
+     Since ST/X floats are really doubles,
      the low- order 4 bytes of the precision are lost."
 
     "
@@ -2483,10 +2495,10 @@
 
      Notice, that the C-type long double might have different sizes on different
      machines and may only use part of the 16 bytes;
-     i.e. 10bytes (80bit) as on intel CPUS, 12 bytes (96bits) or 16 bytes (128bits).    
+     i.e. 10bytes (80bit) as on intel CPUS, 12 bytes (96bits) or 16 bytes (128bits).
 
      Notice also, that the bytes are expected to be in this machine's
-     long double representation and byte order 
+     long double representation and byte order
      - if the bytearray originated from another
      machine, some conversion is usually needed."
 
@@ -2494,7 +2506,7 @@
 
     newFloat := LongFloat basicNew.
     1 to:16 do:[:destIndex|
-        newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:destIndex put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 
@@ -2516,7 +2528,7 @@
 
      Notice, that the C-type long double has different sizes on different
      machines and may only use part of the 16 bytes;
-     i.e. 10bytes (80bit) as on intel CPUS, 12 bytes (96bits) or 16 bytes (128bits).    
+     i.e. 10bytes (80bit) as on intel CPUS, 12 bytes (96bits) or 16 bytes (128bits).
 
      Notice also, that the bytes are expected to be in this machine's
      long double representation - if the bytearray originated from another
@@ -2525,12 +2537,12 @@
     |newFloat|
 
     msb == IsBigEndian ifTrue:[
-        ^ self longDoubleAt:index.
+	^ self longDoubleAt:index.
     ].
 
     newFloat := LongFloat basicNew.
     1 to:16 do:[:destIndex|
-        newFloat basicAt:(17-destIndex) put:(self byteAt:(index - 1 + destIndex))
+	newFloat basicAt:(17-destIndex) put:(self byteAt:(index - 1 + destIndex))
     ].
     ^ newFloat.
 
@@ -2542,7 +2554,7 @@
      starting at index.
      The index is a smalltalk index (i.e. 1-based).
      LongFloats are the machine's long double numbers.
-     
+
      Notice that the bytes are expected to be in this machine's
      float representation and byte order - if the bytearray originated from another
      machine, some conversion is usually needed."
@@ -2551,7 +2563,7 @@
 
     flt := aLongFloat asLongFloat.
     1 to:16 do:[:srcIndex|
-        self byteAt:(index - 1 + srcIndex) put:(flt basicAt:srcIndex)
+	self byteAt:(index - 1 + srcIndex) put:(flt basicAt:srcIndex)
     ].
     ^ aLongFloat
 
@@ -2569,12 +2581,12 @@
     |flt|
 
     msb == IsBigEndian ifTrue:[
-        ^ self longDoubleAt:index put:aLongFloat.
+	^ self longDoubleAt:index put:aLongFloat.
     ].
 
     flt := aLongFloat asLongFloat.
     1 to:16 do:[:srcIndex|
-        self byteAt:(index - 1 + srcIndex) put:(flt basicAt:(17-srcIndex))
+	self byteAt:(index - 1 + srcIndex) put:(flt basicAt:(17-srcIndex))
     ].
     ^ aLongFloat
 
@@ -2593,7 +2605,7 @@
 
     w := self unsignedInt64At:index MSB:(UninterpretedBytes isBigEndian).
     (w > (16r7FFFFFFFFFFFFFFF)) ifTrue:[
-        ^ w - (16r10000000000000000)
+	^ w - (16r10000000000000000)
     ].
     ^ w
 
@@ -2619,7 +2631,7 @@
 
     w := self unsignedInt64At:index MSB:msb.
     (w > (16r7FFFFFFFFFFFFFFF)) ifTrue:[
-        ^ w - (16r10000000000000000)
+	^ w - (16r10000000000000000)
     ].
     ^ w
 
@@ -2636,7 +2648,7 @@
     "Modified (comment): / 04-08-2017 / 11:29:59 / cg"
 !
 
-signedInt64At:byteIndex put:anInteger 
+signedInt64At:byteIndex put:anInteger
     "store a signed longLong (64bit) integer.
      The index is a smalltalk index (i.e. 1-based).
      The value is stored in the machine's natural byte order.
@@ -2656,7 +2668,7 @@
 
     v := anInteger.
     anInteger < 0 ifTrue:[
-        v := v + 16r10000000000000000
+	v := v + 16r10000000000000000
     ].
     self unsignedInt64At:byteIndex put:v MSB:msb.
     ^ anInteger
@@ -2728,15 +2740,15 @@
 
     l := LargeInteger basicNew numberOfDigits:8.
     msb ifTrue:[
-        bIdx := byteIndex + 7.
-        delta := -1
+	bIdx := byteIndex + 7.
+	delta := -1
     ] ifFalse:[
-        bIdx := byteIndex.
-        delta := 1
+	bIdx := byteIndex.
+	delta := 1
     ].
     1 to:8 do:[:i |
-        l digitAt:i put:(self byteAt:bIdx).
-        bIdx := bIdx + delta
+	l digitAt:i put:(self byteAt:bIdx).
+	bIdx := bIdx + delta
     ].
     ^ l compressed
 
@@ -2746,7 +2758,7 @@
      b := ByteArray withAll:#(1 2 3 4 5 6 7 8).
      (b unsignedInt64At:1 MSB:false) printStringRadix:16
     "
-    
+
     "
      |b|
      b := ByteArray new:8.
@@ -2759,7 +2771,7 @@
     "Modified (comment): / 04-08-2017 / 11:30:34 / cg"
 !
 
-unsignedInt64At:byteIndex put:anInteger 
+unsignedInt64At:byteIndex put:anInteger
     "set the 8-bytes starting at index from the (unsigned) Integer value.
      The index is a smalltalk index (i.e. 1-based).
      The value must be in the range 0 to 16rFFFFFFFFFFFFFFFF.
@@ -2787,22 +2799,22 @@
     |bIdx  "{ Class: SmallInteger }"
      delta "{ Class: SmallInteger }"|
 
-    ((anInteger < 0) 
-     or:[anInteger class ~~ SmallInteger 
-         and:[anInteger > 16rFFFFFFFFFFFFFFFF]]) ifTrue:[
-        ^ self elementBoundsError:anInteger
+    ((anInteger < 0)
+     or:[anInteger class ~~ SmallInteger
+	 and:[anInteger > 16rFFFFFFFFFFFFFFFF]]) ifTrue:[
+	^ self elementBoundsError:anInteger
     ].
 
     msb ifTrue:[
-        bIdx := byteIndex + 7.
-        delta := -1
+	bIdx := byteIndex + 7.
+	delta := -1
     ] ifFalse:[
-        bIdx := byteIndex.
-        delta := 1
+	bIdx := byteIndex.
+	delta := 1
     ].
     1 to:8 do:[:i |
-        self byteAt:bIdx put:(anInteger digitAt:i).
-        bIdx := bIdx + delta.
+	self byteAt:bIdx put:(anInteger digitAt:i).
+	bIdx := bIdx + delta.
     ].
     ^ anInteger
 
@@ -2868,77 +2880,77 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+(4-1)) < sz)) {
-                int iVal;
-
-                cp += idx;
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+(4-1)) < sz)) {
+		int iVal;
+
+		cp += idx;
 #if defined(__i386__)
-                /*
-                 * aligned or not, we don't care (i386 can do both)
-                 */
-                {
-                    iVal = ((int *)cp)[0];
-                    RETURN (__MKINT(iVal));
-                }
+		/*
+		 * aligned or not, we don't care (i386 can do both)
+		 */
+		{
+		    iVal = ((int *)cp)[0];
+		    RETURN (__MKINT(iVal));
+		}
 #else
 # if defined(__x86_64__)
-                /*
-                 * aligned or not, we don't care (i386 can do both)
-                 */
-                {
-                    iVal = ((int *)cp)[0];
-                    RETURN (__mkSmallInteger(iVal));
-                }
+		/*
+		 * aligned or not, we don't care (i386 can do both)
+		 */
+		{
+		    iVal = ((int *)cp)[0];
+		    RETURN (__mkSmallInteger(iVal));
+		}
 # else
-                /*
-                 * aligned ?
-                 */
-                if (((INT)cp & (sizeof(int)-1)) == 0) {
-                    iVal = ((int *)cp)[0];
-                } else {
+		/*
+		 * aligned ?
+		 */
+		if (((INT)cp & (sizeof(int)-1)) == 0) {
+		    iVal = ((int *)cp)[0];
+		} else {
 #  ifdef __LSBFIRST__
-                    iVal = cp[0] & 0xFF;
-                    iVal += (cp[1] & 0xFF)<<8;
-                    iVal += (cp[2] & 0xFF)<<16;
-                    iVal += (cp[3] & 0xFF)<<24;
+		    iVal = cp[0] & 0xFF;
+		    iVal += (cp[1] & 0xFF)<<8;
+		    iVal += (cp[2] & 0xFF)<<16;
+		    iVal += (cp[3] & 0xFF)<<24;
 #  else
 #   ifdef __MSBFIRST__
-                    iVal = cp[0] & 0xFF;
-                    iVal = (iVal<<8)+(cp[1] & 0xFF);
-                    iVal = (iVal<<8)+(cp[2] & 0xFF);
-                    iVal = (iVal<<8)+(cp[3] & 0xFF);
+		    iVal = cp[0] & 0xFF;
+		    iVal = (iVal<<8)+(cp[1] & 0xFF);
+		    iVal = (iVal<<8)+(cp[2] & 0xFF);
+		    iVal = (iVal<<8)+(cp[3] & 0xFF);
 #   else
-                    {
-                        union {
-                            int i;
-                            char c[4];
-                        } u;
-                        u.c[0] = cp[0]; 
-                        u.c[1] = cp[1]; 
-                        u.c[2] = cp[2]; 
-                        u.c[3] = cp[3];
-                        iVal = u.i;
-                    }
+		    {
+			union {
+			    int i;
+			    char c[4];
+			} u;
+			u.c[0] = cp[0];
+			u.c[1] = cp[1];
+			u.c[2] = cp[2];
+			u.c[3] = cp[3];
+			iVal = u.i;
+		    }
 #   endif
 #  endif
 
 #  if __POINTER_SIZE__ == 8
-                    RETURN (__mkSmallInteger(iVal));
+		    RETURN (__mkSmallInteger(iVal));
 #  else
-                    RETURN (__MKINT(iVal));
+		    RETURN (__MKINT(iVal));
 #  endif
-                }
+		}
 # endif
 #endif
-            }
-        }
+	    }
+	}
     }
 %}.
 
@@ -2974,69 +2986,69 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-            int iVal;
-
-            cp += idx;
-            if ((idx >= 0) && ((idx+(sizeof(int)-1)) < sz)) {
-
-                if (msb == true) {
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+	    int iVal;
+
+	    cp += idx;
+	    if ((idx >= 0) && ((idx+(sizeof(int)-1)) < sz)) {
+
+		if (msb == true) {
 #if defined(__MSBFIRST__)
-                    if (((INT)cp & (sizeof(int)-1))== 0) {
-                        /*
-                         * aligned
-                         */
-                        iVal = ((int *)cp)[0];
-                    } else
+		    if (((INT)cp & (sizeof(int)-1))== 0) {
+			/*
+			 * aligned
+			 */
+			iVal = ((int *)cp)[0];
+		    } else
 #endif
-                    {
-                        iVal = cp[0];
-                        iVal = (iVal << 8) | cp[1];
-                        iVal = (iVal << 8) | cp[2];
-                        iVal = (iVal << 8) | cp[3];
-                    }
-                } else {
+		    {
+			iVal = cp[0];
+			iVal = (iVal << 8) | cp[1];
+			iVal = (iVal << 8) | cp[2];
+			iVal = (iVal << 8) | cp[3];
+		    }
+		} else {
 #if defined(__i386__) || (defined(UNALIGNED_FETCH_OK) && defined(__LSBFIRST__))
-                    /*
-                     * aligned or not - we don't care
-                     * (i386 can fetch unaligned)
-                     */
-                    iVal = ((int *)cp)[0];
+		    /*
+		     * aligned or not - we don't care
+		     * (i386 can fetch unaligned)
+		     */
+		    iVal = ((int *)cp)[0];
 #else
 # if defined(__LSBFIRST__)
-                    if (((INT)cp & (sizeof(int)-1))== 0) {
-                        /*
-                         * aligned
-                         */
-                        iVal = ((int *)cp)[0];
-                    } else
+		    if (((INT)cp & (sizeof(int)-1))== 0) {
+			/*
+			 * aligned
+			 */
+			iVal = ((int *)cp)[0];
+		    } else
 # endif
-                    {
-                        iVal = cp[3];
-                        iVal = (iVal << 8) | cp[2];
-                        iVal = (iVal << 8) | cp[1];
-                        iVal = (iVal << 8) | cp[0];
-                    }
+		    {
+			iVal = cp[3];
+			iVal = (iVal << 8) | cp[2];
+			iVal = (iVal << 8) | cp[1];
+			iVal = (iVal << 8) | cp[0];
+		    }
 #endif
-                }
+		}
 #if __POINTER_SIZE__ == 8
-                RETURN (__mkSmallInteger(iVal));
+		RETURN (__mkSmallInteger(iVal));
 #else
-                RETURN (__MKINT(iVal));
+		RETURN (__MKINT(iVal));
 #endif
-            }
-        }
+	    }
+	}
     }
 %}.
 
     val := self unsignedInt32At:byteIndex MSB:msb.
     (val > (16r7FFFFFFF)) ifTrue:[
-        ^ val - (16r100000000)
+	^ val - (16r100000000)
     ].
     ^ val
 
@@ -3044,7 +3056,7 @@
      |b|
 
      b := ByteArray withAll:#(1 2 3 4).
-     (b signedInt32At:1 MSB:true) printStringRadix:16.    
+     (b signedInt32At:1 MSB:true) printStringRadix:16.
      (b signedInt32At:1 MSB:false) printStringRadix:16
     "
 !
@@ -3080,66 +3092,66 @@
      * handle the most common case fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+3) < sz)) {
-                cp += idx;
-
-                if (__isSmallInteger(anInteger)) {
-                    INT __v = __intVal(anInteger);
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+3) < sz)) {
+		cp += idx;
+
+		if (__isSmallInteger(anInteger)) {
+		    INT __v = __intVal(anInteger);
 
 # if __POINTER_SIZE__ == 8
-                    if ((__v < -0x80000000L) || (__v > 0x7FFFFFFF)) {
-                        goto badArg;
-                    }
+		    if ((__v < -0x80000000L) || (__v > 0x7FFFFFFF)) {
+			goto badArg;
+		    }
 # endif
-                    if (((INT)cp & 3) == 0) {
-                        /*
-                         * aligned
-                         */
-                        if (
+		    if (((INT)cp & 3) == 0) {
+			/*
+			 * aligned
+			 */
+			if (
 # ifdef __LSBFIRST__
-                            (msb == false)
+			    (msb == false)
 # else
 #  ifdef __MSBFIRST__
-                            (msb == true)
+			    (msb == true)
 #  else
-                            (0)
+			    (0)
 #  endif
 # endif
-                        ) {
-                            ((int *)cp)[0] = (int)__v;
-                            RETURN (anInteger);
-                        }
-                    }
-                    if (msb == false) {
-                        cp[0] = __v & 0xFF;
-                        cp[1] = (__v>>8) & 0xFF;
-                        cp[2] = (__v>>16) & 0xFF;
-                        cp[3] = (__v>>24) & 0xFF;
-                    } else {
-                        cp[0] = (__v>>24) & 0xFF;
-                        cp[1] = (__v>>16) & 0xFF;
-                        cp[2] = (__v>>8) & 0xFF;
-                        cp[3] = __v & 0xFF;
-                    }
-                    RETURN (anInteger);
-                }
-            }
-        }
+			) {
+			    ((int *)cp)[0] = (int)__v;
+			    RETURN (anInteger);
+			}
+		    }
+		    if (msb == false) {
+			cp[0] = __v & 0xFF;
+			cp[1] = (__v>>8) & 0xFF;
+			cp[2] = (__v>>16) & 0xFF;
+			cp[3] = (__v>>24) & 0xFF;
+		    } else {
+			cp[0] = (__v>>24) & 0xFF;
+			cp[1] = (__v>>16) & 0xFF;
+			cp[2] = (__v>>8) & 0xFF;
+			cp[3] = __v & 0xFF;
+		    }
+		    RETURN (anInteger);
+		}
+	    }
+	}
     }
   badArg: ;
 %}.
 
     anInteger >= 0 ifTrue:[
-        v := anInteger
+	v := anInteger
     ] ifFalse:[
-        v := anInteger + 16r100000000
+	v := anInteger + 16r100000000
     ].
     self unsignedInt32At:byteIndex put:v MSB:msb.
     ^ anInteger
@@ -3198,7 +3210,7 @@
      |b|
 
      b := ByteArray withAll:#(1 2 3 4).
-     (b unsignedInt32At:1) printStringRadix:16      
+     (b unsignedInt32At:1) printStringRadix:16
     "
 
     "Modified: / 5.3.1998 / 14:57:35 / stefan"
@@ -3223,63 +3235,63 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-            unsigned int iVal;
-
-            if ((idx >= 0) && ((idx+(sizeof(int)-1)) < sz)) {
-                cp += idx;
-
-                if (msb == true) {
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+	    unsigned int iVal;
+
+	    if ((idx >= 0) && ((idx+(sizeof(int)-1)) < sz)) {
+		cp += idx;
+
+		if (msb == true) {
 #if defined(__MSBFIRST__)
-                    if (((INT)cp & (sizeof(int)-1))== 0) {
-                        /*
-                         * aligned
-                         */
-                        iVal = ((unsigned int *)cp)[0];
-                    } else
+		    if (((INT)cp & (sizeof(int)-1))== 0) {
+			/*
+			 * aligned
+			 */
+			iVal = ((unsigned int *)cp)[0];
+		    } else
 #endif
-                    {
-                        iVal = cp[0];
-                        iVal = (iVal << 8) | cp[1];
-                        iVal = (iVal << 8) | cp[2];
-                        iVal = (iVal << 8) | cp[3];
-                    }
-                } else {
+		    {
+			iVal = cp[0];
+			iVal = (iVal << 8) | cp[1];
+			iVal = (iVal << 8) | cp[2];
+			iVal = (iVal << 8) | cp[3];
+		    }
+		} else {
 #if defined(__i386__) || (defined(UNALIGNED_FETCH_OK) && defined(__LSBFIRST__))
-                    /*
-                     * aligned or not - we don't care
-                     * (i386 can fetch unaligned)
-                     */
-                    iVal = ((unsigned int *)cp)[0];
+		    /*
+		     * aligned or not - we don't care
+		     * (i386 can fetch unaligned)
+		     */
+		    iVal = ((unsigned int *)cp)[0];
 #else
 # if defined(__LSBFIRST__)
-                    if (((INT)cp & (sizeof(int)-1))== 0) {
-                        /*
-                         * aligned
-                         */
-                        iVal = ((unsigned int *)cp)[0];
-                    } else
+		    if (((INT)cp & (sizeof(int)-1))== 0) {
+			/*
+			 * aligned
+			 */
+			iVal = ((unsigned int *)cp)[0];
+		    } else
 # endif
-                    {
-                        iVal = cp[3];
-                        iVal = (iVal << 8) | cp[2];
-                        iVal = (iVal << 8) | cp[1];
-                        iVal = (iVal << 8) | cp[0];
-                    }
+		    {
+			iVal = cp[3];
+			iVal = (iVal << 8) | cp[2];
+			iVal = (iVal << 8) | cp[1];
+			iVal = (iVal << 8) | cp[0];
+		    }
 #endif
-                }
+		}
 #if __POINTER_SIZE__ == 8
-                RETURN (__mkSmallInteger(iVal));
+		RETURN (__mkSmallInteger(iVal));
 #else
-                RETURN (__MKUINT(iVal));
+		RETURN (__MKUINT(iVal));
 #endif
-            }
-        }
+	    }
+	}
     }
 %}.
 
@@ -3288,15 +3300,15 @@
 
     i := byteIndex.
     msb ifFalse:[
-        bLL := self byteAt:i.
-        bLH := self byteAt:(i+1).
-        bHL := self byteAt:(i+2).
-        bHH := self byteAt:(i+3).
-    ] ifTrue:[        
-        bHH := self byteAt:i.
-        bHL := self byteAt:(i+1).
-        bLH := self byteAt:(i+2).
-        bLL := self byteAt:(i+3).
+	bLL := self byteAt:i.
+	bLH := self byteAt:(i+1).
+	bHL := self byteAt:(i+2).
+	bHH := self byteAt:(i+3).
+    ] ifTrue:[
+	bHH := self byteAt:i.
+	bHL := self byteAt:(i+1).
+	bLH := self byteAt:(i+2).
+	bLL := self byteAt:(i+3).
     ].
     ival := (bHH bitShift:8) + bHL.
     ival := (ival bitShift:8) + bLH.
@@ -3345,77 +3357,77 @@
      * handle the most common case fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+3) < sz)) {
-                cp += idx;
-
-                if (__isSmallInteger(anInteger)) {
-                    INT __v = __intVal(anInteger);
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+3) < sz)) {
+		cp += idx;
+
+		if (__isSmallInteger(anInteger)) {
+		    INT __v = __intVal(anInteger);
 
 # if __POINTER_SIZE__ == 8
-                    if ((__v < 0) || (__v > 0xFFFFFFFF)) {
-                        goto badArg;
-                    }
+		    if ((__v < 0) || (__v > 0xFFFFFFFF)) {
+			goto badArg;
+		    }
 # endif
-                    if (((INT)cp & 3) == 0) {
-                        /*
-                         * aligned
-                         */
-                        if (
+		    if (((INT)cp & 3) == 0) {
+			/*
+			 * aligned
+			 */
+			if (
 # ifdef __LSBFIRST__
-                            (msb == false)
+			    (msb == false)
 # else
 #  ifdef __MSBFIRST__
-                            (msb == true)
+			    (msb == true)
 #  else
-                            (0)
+			    (0)
 #  endif
 # endif
-                        ) {
-                            ((int *)cp)[0] = (int)__v;
-                            RETURN (anInteger);
-                        }
-                    }
-                    if (msb == false) {
-                        cp[0] = __v & 0xFF;
-                        cp[1] = (__v>>8) & 0xFF;
-                        cp[2] = (__v>>16) & 0xFF;
-                        cp[3] = (__v>>24) & 0xFF;
-                    } else {
-                        cp[0] = (__v>>24) & 0xFF;
-                        cp[1] = (__v>>16) & 0xFF;
-                        cp[2] = (__v>>8) & 0xFF;
-                        cp[3] = __v & 0xFF;
-                    }
-                    RETURN (anInteger);
-                }
-            }
-        }
+			) {
+			    ((int *)cp)[0] = (int)__v;
+			    RETURN (anInteger);
+			}
+		    }
+		    if (msb == false) {
+			cp[0] = __v & 0xFF;
+			cp[1] = (__v>>8) & 0xFF;
+			cp[2] = (__v>>16) & 0xFF;
+			cp[3] = (__v>>24) & 0xFF;
+		    } else {
+			cp[0] = (__v>>24) & 0xFF;
+			cp[1] = (__v>>16) & 0xFF;
+			cp[2] = (__v>>8) & 0xFF;
+			cp[3] = __v & 0xFF;
+		    }
+		    RETURN (anInteger);
+		}
+	    }
+	}
     }
   badArg: ;
 %}.
 
     ((anInteger < 0) or:[anInteger > 16rFFFFFFFF]) ifTrue:[
-        ^ self elementBoundsError:anInteger
+	^ self elementBoundsError:anInteger
     ].
 
     i := byteIndex.
     msb ifTrue:[
-        b1 := (anInteger digitAt:4).
-        b2 := (anInteger digitAt:3).
-        b3 := (anInteger digitAt:2).
-        b4 := (anInteger digitAt:1).
+	b1 := (anInteger digitAt:4).
+	b2 := (anInteger digitAt:3).
+	b3 := (anInteger digitAt:2).
+	b4 := (anInteger digitAt:1).
     ] ifFalse:[
-        b1 := (anInteger digitAt:1).
-        b2 := (anInteger digitAt:2).
-        b3 := (anInteger digitAt:3).
-        b4 := (anInteger digitAt:4).
+	b1 := (anInteger digitAt:1).
+	b2 := (anInteger digitAt:2).
+	b3 := (anInteger digitAt:3).
+	b4 := (anInteger digitAt:4).
     ].
     self byteAt:i     put:b1.
     self byteAt:(i+1) put:b2.
@@ -3427,13 +3439,13 @@
      |b|
      b := ByteArray new:4.
      b signedInt32At:1 put:-1.
-     (b unsignedInt32At:1) printStringRadix:16 
+     (b unsignedInt32At:1) printStringRadix:16
     "
     "
      |b|
      b := ByteArray new:4.
      b unsignedInt32At:1 put:16rFFFFFFFF.
-     (b signedInt32At:1) 
+     (b signedInt32At:1)
     "
 !
 
@@ -3479,41 +3491,41 @@
 
 %{
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __smallIntegerVal(byteIndex) - 1;
-            char *pointer;
-
-            if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(pointer)-1)) == 0) {
-                    pointer = ((char **)cp)[0];
-                    RETURN (__MKEXTERNALADDRESS(pointer));
-                } else {
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __smallIntegerVal(byteIndex) - 1;
+	    char *pointer;
+
+	    if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(pointer)-1)) == 0) {
+		    pointer = ((char **)cp)[0];
+		    RETURN (__MKEXTERNALADDRESS(pointer));
+		} else {
 #if 0
-                    printf("cp UNALIGNED (%"_lx_")\n", (INT)cp);
+		    printf("cp UNALIGNED (%"_lx_")\n", (INT)cp);
 #endif
-                }
-            } else {
+		}
+	    } else {
 #if 0
-                printf("idx(%"_ld_")+(sizeof(pointer)-1) (%d) >= sz (%"_ld_")\n",
-                        idx, (int)(sizeof(pointer)-1), sz);
+		printf("idx(%"_ld_")+(sizeof(pointer)-1) (%d) >= sz (%"_ld_")\n",
+			idx, (int)(sizeof(pointer)-1), sz);
 #endif
-            }
-        } else {
+	    }
+	} else {
 #if 0
-            printf("cp is NULL\n");
+	    printf("cp is NULL\n");
 #endif
-        }
+	}
     } else {
 #if 0
-        printf("bad index\n");
+	printf("bad index\n");
 #endif
     }
 bad:;
@@ -3549,40 +3561,40 @@
     OBJ *pointer;
 
     if (__isExternalAddressLike(value)) {
-        pointer = __externalAddressVal(value);
+	pointer = __externalAddressVal(value);
     } else if (__isExternalBytesLike(value)) {
-        pointer = __externalBytesVal(value);
-        if (pointer == (OBJ *)0)
-            pointer = 0;
+	pointer = __externalBytesVal(value);
+	if (pointer == (OBJ *)0)
+	    pointer = 0;
     } else if (value == nil) {
-        pointer = 0;
+	pointer = 0;
     } else if (__isSmallInteger(value)) {
-        pointer = (OBJ *)__intVal(value);
+	pointer = (OBJ *)__intVal(value);
     } else {
-        if ((pointer = (OBJ *)__unsignedLongIntVal(value)) == 0) {
-            goto bad;
-        }
+	if ((pointer = (OBJ *)__unsignedLongIntVal(value)) == 0) {
+	    goto bad;
+	}
     }
 
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __smallIntegerVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(pointer)-1)) == 0) {
-                    ((char **)cp)[0] = (char *) pointer;
-                    RETURN (value);
-                }
-            }
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __smallIntegerVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(pointer)-1)) == 0) {
+		    ((char **)cp)[0] = (char *) pointer;
+		    RETURN (value);
+		}
+	    }
+	}
     }
 bad:;
 %}.
@@ -3609,34 +3621,34 @@
 
 %{
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __smallIntegerVal(byteIndex) - 1;
-            char *pointer;
-
-            if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
-                cp += idx;
-                /*
-                 * aligned
-                 */
-                if (((INT)cp & (sizeof(pointer)-1)) == 0) {
-                    pointer = ((char **)cp)[0];
-                    RETURN (__MKUINT((INT)(pointer)));
-                } else {
-                    // printf("cp UNALIGNED (%"_lx_")\n", (INT)cp);
-                }
-            } else {
-                // printf("idx(%"_ld_")+(sizeof(pointer)-1) (%d) >= sz (%"_ld_")\n",
-                //        idx, (int)(sizeof(pointer)-1), sz);
-            }
-        } else {
-            // printf("cp is NULL\n");
-        }
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __smallIntegerVal(byteIndex) - 1;
+	    char *pointer;
+
+	    if ((idx >= 0) && ((idx+(sizeof(pointer)-1)) < sz)) {
+		cp += idx;
+		/*
+		 * aligned
+		 */
+		if (((INT)cp & (sizeof(pointer)-1)) == 0) {
+		    pointer = ((char **)cp)[0];
+		    RETURN (__MKUINT((INT)(pointer)));
+		} else {
+		    // printf("cp UNALIGNED (%"_lx_")\n", (INT)cp);
+		}
+	    } else {
+		// printf("idx(%"_ld_")+(sizeof(pointer)-1) (%d) >= sz (%"_ld_")\n",
+		//        idx, (int)(sizeof(pointer)-1), sz);
+	    }
+	} else {
+	    // printf("cp is NULL\n");
+	}
     } else {
-        // printf("bad index\n");
+	// printf("bad index\n");
     }
 bad:;
 %}.
@@ -3679,9 +3691,9 @@
      The index is a smalltalk index (i.e. 1-based).
      The value is retrieved MSB (high 8 bits at lower index) if msb is true;
      LSB-first (i.e. low 8-bits at lower byte index) if it's false.
-     Notice: 
-        the index is a byte index; thus, this allows for unaligned access to
-        words on any boundary."
+     Notice:
+	the index is a byte index; thus, this allows for unaligned access to
+	words on any boundary."
 
     |b1 "{ Class: SmallInteger }"
      b2 "{ Class: SmallInteger }"|
@@ -3691,39 +3703,39 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+(2-1)) < sz)) {
-                short sVal;
-
-                cp += idx;
-                if (msb == false) {
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+(2-1)) < sz)) {
+		short sVal;
+
+		cp += idx;
+		if (msb == false) {
 #if defined(__i386__) || (defined(__LSBFIRST__) && defined(UNALIGNED_FETCH_OK))
-                    /*
-                     * aligned or not, we don't care (i386 can do both)
-                     */
-                    sVal = ((short *)cp)[0];
+		    /*
+		     * aligned or not, we don't care (i386 can do both)
+		     */
+		    sVal = ((short *)cp)[0];
 #else
-                    sVal = (cp[0] & 0xFF) | ((cp[1] & 0xFF) << 8);
+		    sVal = (cp[0] & 0xFF) | ((cp[1] & 0xFF) << 8);
 #endif
-                } else {
-                    sVal = ((cp[0] & 0xFF) << 8) | (cp[1] & 0xFF);
-                }
-                RETURN (__mkSmallInteger(sVal));
-            }
-        }
+		} else {
+		    sVal = ((cp[0] & 0xFF) << 8) | (cp[1] & 0xFF);
+		}
+		RETURN (__mkSmallInteger(sVal));
+	    }
+	}
     }
 %}.
 
     b1 := self byteAt:byteIndex.
     b2 := self byteAt:(byteIndex + 1).
     msb ifTrue:[
-        ^ ((b1 bitShift:8) + b2) signExtendedShortValue
+	^ ((b1 bitShift:8) + b2) signExtendedShortValue
     ].
     ^ ((b2 bitShift:8) + b1) signExtendedShortValue
 !
@@ -3759,44 +3771,44 @@
      * handle the most common case fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+1) < sz)) {
-                cp += idx;
-
-                if (__isSmallInteger(anInteger)) {
-                    INT __v = __intVal(anInteger);
-
-                    if ((__v < -0x8000L) || (__v > 0x7FFF)) {
-                        goto badArg;
-                    }
-                    if (msb == false) { 
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+1) < sz)) {
+		cp += idx;
+
+		if (__isSmallInteger(anInteger)) {
+		    INT __v = __intVal(anInteger);
+
+		    if ((__v < -0x8000L) || (__v > 0x7FFF)) {
+			goto badArg;
+		    }
+		    if (msb == false) {
 #if defined(__i386__) || (defined(__LSBFIRST__) && defined(UNALIGNED_FETCH_OK))
-                        ((short *)cp)[0] = (short)__v;
+			((short *)cp)[0] = (short)__v;
 #else
-                        cp[0] = __v & 0xFF;
-                        cp[1] = (__v >> 8) & 0xFF;
+			cp[0] = __v & 0xFF;
+			cp[1] = (__v >> 8) & 0xFF;
 #endif
-                    } else {        
-                        cp[0] = (__v >> 8) & 0xFF;
-                        cp[1] = __v & 0xFF;
-                    }
-                    RETURN (anInteger);
-                }
-            }
-        }
+		    } else {
+			cp[0] = (__v >> 8) & 0xFF;
+			cp[1] = __v & 0xFF;
+		    }
+		    RETURN (anInteger);
+		}
+	    }
+	}
     }
   badArg: ;
 %}.
     anInteger >= 0 ifTrue:[
-        self unsignedInt16At:byteIndex put:anInteger MSB:msb.
+	self unsignedInt16At:byteIndex put:anInteger MSB:msb.
     ] ifFalse:[
-        self unsignedInt16At:byteIndex put:(16r10000 + anInteger) MSB:msb.
+	self unsignedInt16At:byteIndex put:(16r10000 + anInteger) MSB:msb.
     ].
     ^ anInteger
 
@@ -3900,9 +3912,9 @@
      The index is a smalltalk index (i.e. 1-based).
      The value is retrieved MSB (high 8 bits at lower index) if msb is true;
      LSB-first (i.e. low 8-bits at lower byte index) if it's false.
-     Notice: 
-        the index is a byte index; thus, this allows for unaligned access to
-        words on any boundary."
+     Notice:
+	the index is a byte index; thus, this allows for unaligned access to
+	words on any boundary."
 
     |b1 "{ Class: SmallInteger }"
      b2 "{ Class: SmallInteger }"|
@@ -3912,39 +3924,39 @@
      * handle the most common cases fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+(2-1)) < sz)) {
-                int iVal;
-
-                cp += idx;
-                if (msb == false) {
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+(2-1)) < sz)) {
+		int iVal;
+
+		cp += idx;
+		if (msb == false) {
 #if defined(__i386__) || (defined(__LSBFIRST__) && defined(UNALIGNED_FETCH_OK))
-                    /*
-                     * aligned or not, we don't care (i386 can do both)
-                     */
-                    iVal = ((unsigned short *)cp)[0];
+		    /*
+		     * aligned or not, we don't care (i386 can do both)
+		     */
+		    iVal = ((unsigned short *)cp)[0];
 #else
-                    iVal = (cp[0] & 0xFF) | ((cp[1] & 0xFF) << 8);
+		    iVal = (cp[0] & 0xFF) | ((cp[1] & 0xFF) << 8);
 #endif
-                } else {
-                    iVal = ((cp[0] & 0xFF) << 8) | (cp[1] & 0xFF);
-                }
-                RETURN (__mkSmallInteger(iVal));
-            }
-        }
+		} else {
+		    iVal = ((cp[0] & 0xFF) << 8) | (cp[1] & 0xFF);
+		}
+		RETURN (__mkSmallInteger(iVal));
+	    }
+	}
     }
 %}.
 
     b1 := self byteAt:byteIndex.
     b2 := self byteAt:(byteIndex + 1).
     msb ifTrue:[
-        ^ (b1 bitShift:8) + b2
+	^ (b1 bitShift:8) + b2
     ].
     ^ (b2 bitShift:8) + b1
 
@@ -3992,51 +4004,51 @@
      * handle the most common case fast ...
      */
     if (__isSmallInteger(byteIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        // printf("cp=%"_lx_"\n", (INT)cp);
-        if (cp) {
-            INT idx = __intVal(byteIndex) - 1;
-
-            if ((idx >= 0) && ((idx+1) < sz)) {
-                cp += idx;
-
-                if (__isSmallInteger(anInteger)) {
-                    INT __v = __intVal(anInteger);
-
-                    if (((unsigned INT)__v) > 0xFFFF) {
-                        goto badArg;
-                    }
-                    if (msb == false) { 
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	// printf("cp=%"_lx_"\n", (INT)cp);
+	if (cp) {
+	    INT idx = __intVal(byteIndex) - 1;
+
+	    if ((idx >= 0) && ((idx+1) < sz)) {
+		cp += idx;
+
+		if (__isSmallInteger(anInteger)) {
+		    INT __v = __intVal(anInteger);
+
+		    if (((unsigned INT)__v) > 0xFFFF) {
+			goto badArg;
+		    }
+		    if (msb == false) {
 #if defined(__i386__) || (defined(__LSBFIRST__) && defined(UNALIGNED_FETCH_OK))
-                        ((unsigned short *)cp)[0] = (unsigned short)__v;
+			((unsigned short *)cp)[0] = (unsigned short)__v;
 #else
-                        cp[0] = __v & 0xFF;
-                        cp[1] = (__v >> 8) & 0xFF;
+			cp[0] = __v & 0xFF;
+			cp[1] = (__v >> 8) & 0xFF;
 #endif
-                    } else {        
-                        cp[0] = (__v >> 8) & 0xFF;
-                        cp[1] = __v & 0xFF;
-                    }
-                    RETURN (anInteger);
-                }
-            }
-        }
+		    } else {
+			cp[0] = (__v >> 8) & 0xFF;
+			cp[1] = __v & 0xFF;
+		    }
+		    RETURN (anInteger);
+		}
+	    }
+	}
     }
   badArg: ;
 %}.
     iVal := anInteger.
     ((iVal < 0) or:[iVal > 16rFFFF]) ifTrue:[
-        ^ self elementBoundsError:iVal
+	^ self elementBoundsError:iVal
     ].
     msb ifTrue:[
-        b1 := ((iVal bitShift:-8) bitAnd:16rFF).
-        b2 := (iVal bitAnd:16rFF).
+	b1 := ((iVal bitShift:-8) bitAnd:16rFF).
+	b2 := (iVal bitAnd:16rFF).
     ] ifFalse:[
-        b1 := (iVal bitAnd:16rFF).
-        b2 := ((iVal bitShift:-8) bitAnd:16rFF).
+	b1 := (iVal bitAnd:16rFF).
+	b2 := ((iVal bitShift:-8) bitAnd:16rFF).
     ].
     self byteAt:byteIndex   put:b1.
     self byteAt:byteIndex+1 put:b2.
@@ -4142,8 +4154,8 @@
     stream := WriteStream on:(String new:40).
     i := index.
     [(c := self byteAt:i) ~~ 0] whileTrue:[
-        stream nextPut:(Character value:c).
-        i := i + 1.
+	stream nextPut:(Character value:c).
+	i := i + 1.
     ].
     ^ stream contents
 
@@ -4163,8 +4175,8 @@
 
     i := index.
     aString do:[:aChar |
-        self byteAt:i put:aChar codePoint.
-        i := i + 1.
+	self byteAt:i put:aChar codePoint.
+	i := i + 1.
     ].
     self byteAt:i put:0.
     ^ aString
@@ -4175,7 +4187,7 @@
      bytes := ExternalBytes new:10.
      bytes stringAt:1 put:'hello'.
      1 to:bytes size do:[:i |
-        Transcript showCR:(bytes at:i)
+	Transcript showCR:(bytes at:i)
      ].
     "
 
@@ -4200,10 +4212,10 @@
 
     i := index.
     aString do:[:aChar |
-        self byteAt:i put:aChar codePoint.
-        i := i + 1.
-        remaining := remaining - 1.
-        remaining <= 0 ifTrue:[^ aString].
+	self byteAt:i put:aChar codePoint.
+	i := i + 1.
+	remaining := remaining - 1.
+	remaining <= 0 ifTrue:[^ aString].
     ].
     self byteAt:i put:0.
     ^ aString
@@ -4214,7 +4226,7 @@
      bytes := ExternalBytes new:10.
      bytes stringAt:1 put:'hello' size:3.
      1 to:bytes size do:[:i |
-        Transcript showCR:(bytes at:i)
+	Transcript showCR:(bytes at:i)
      ]
     "
     "
@@ -4223,7 +4235,7 @@
      bytes := ByteArray new:10 withAll:16rFF.
      bytes stringAt:1 put:'he' size:3.
      1 to:bytes size do:[:i |
-        Transcript showCR:(bytes at:i)
+	Transcript showCR:(bytes at:i)
      ]
     "
 
@@ -4248,11 +4260,11 @@
     max := start + maxSize - 1.
 
     start to:max do:[:eachIndex|
-        c := self byteAt:eachIndex.
-        c == 0 ifTrue:[
-            ^ stream contents
-        ].
-        stream nextPut:(Character value:c).
+	c := self byteAt:eachIndex.
+	c == 0 ifTrue:[
+	    ^ stream contents
+	].
+	stream nextPut:(Character value:c).
     ].
     ^ stream contents
 
@@ -4272,7 +4284,7 @@
 
     endIndex := self indexOf:0 startingAt:index.
     endIndex == 0 ifTrue:[
-        endIndex := self size + 1
+	endIndex := self size + 1
     ].
     endIndex := (endIndex min: (index + count)) - 1.
     bytes := self copyFrom:index to:endIndex.
@@ -4289,7 +4301,7 @@
 !UninterpretedBytes methodsFor:'converting'!
 
 asExternalBytes
-    "in earlier times, this use to return protected memory 
+    "in earlier times, this use to return protected memory
      (i.e. it would not be garbage collected, and the user had to free it manually).
      This was changed to now return garbage collected memory."
 
@@ -4306,7 +4318,7 @@
 
 asExternalBytesUnprotected
     "Like asExternalBytes, but does not protect the bytes from the collector,
-     so the bytes are GARBAGE-COLLECTED 
+     so the bytes are GARBAGE-COLLECTED
      (i.e. free is called when the smalltalk object is no longer referenced)."
 
     |bytes sz|
@@ -4385,14 +4397,14 @@
     "test:
 
       1 to:16r10FFFF do:[:codepoint |
-        |utf8Encoding original readBack|
-
-        original := (Character value:codepoint) asString.
-        utf8Encoding := original utf8Encoded.
-        readBack := utf8Encoding utf8Decoded.
-        readBack ~= original ifTrue:[
-            self halt
-        ]
+	|utf8Encoding original readBack|
+
+	original := (Character value:codepoint) asString.
+	utf8Encoding := original utf8Encoded.
+	readBack := utf8Encoding utf8Decoded.
+	readBack ~= original ifTrue:[
+	    self halt
+	]
       ]
     "
 
@@ -4407,26 +4419,26 @@
     |in out c|
 
     self containsNon7BitAscii ifFalse:[
-        ^ self asSingleByteString
+	^ self asSingleByteString
     ].
 
     out := WriteStream on:(String uninitializedNew:self size * 3 // 2).
     in := self readStream.
     [in atEnd] whileFalse:[
-        c := Character utf8DecodeFrom:in.
-        c codePoint > 16rFF ifTrue:[
-            c := replacementCharacter
-        ].
-        out nextPut:c.
+	c := Character utf8DecodeFrom:in.
+	c codePoint > 16rFF ifTrue:[
+	    c := replacementCharacter
+	].
+	out nextPut:c.
     ].
     ^ out contents
 
     "
      (Character value:16r220) utf8Encoded
-        utf8DecodedWithTwoByteCharactersReplacedBy:(Character space)
+	utf8DecodedWithTwoByteCharactersReplacedBy:(Character space)
 
      (Character value:16r220) utf8Encoded asExternalBytes copyButLast
-        utf8DecodedWithTwoByteCharactersReplacedBy:(Character space)
+	utf8DecodedWithTwoByteCharactersReplacedBy:(Character space)
     "
 ! !
 
@@ -4454,142 +4466,142 @@
      && (__isBytes(self) || __isWords(self))
      && __bothSmallInteger(start, stop)
      && __isSmallInteger(repStart)) {
-        startIndex = __intVal(start) - 1;
-        if (startIndex >= 0) {
-            dst = (__ByteArrayInstPtr(self)->ba_element) + startIndex;
-            nIndex = __byteArraySize(self);
-
-            if ((cls = __qClass(self)) != @global(ByteArray)) {
-                int nInst;
-
-                nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-                dst += nInst;
-                nIndex -= nInst;
-            }
-
-            stopIndex = __intVal(stop) - 1;
-            count = stopIndex - startIndex + 1;
-            if (count == 0) {
-                RETURN ( self );
-            }
-
-            if ((count > 0) && (stopIndex < nIndex)) {
-                repStartIndex = __intVal(repStart) - 1;
-                if (repStartIndex >= 0) {
-                    if (__isExternalBytesLike(aCollection)) {
-                        OBJ sz;
-
-                        src = __externalAddressVal(aCollection);
-                        if (src == 0) goto fallBack;
-
-                        sz = __externalBytesSize(aCollection);
-                        if (__isSmallInteger(sz)) {
-                            repNIndex = __smallIntegerVal(sz);
-                        } else {
-                            repNIndex = repStopIndex+1; /* always enough */
-                        }
-                        src = src + repStartIndex;
-                    } else {
-                        if (__isStringLike(aCollection)) {
-                            repNIndex = __stringSize(aCollection);
-                        } else {
-                            repNIndex = __qSize(aCollection) - OHDR_SIZE;
-                        }
-                        src = (__ByteArrayInstPtr(aCollection)->ba_element) + repStartIndex;
-                        if ((cls = __qClass(aCollection)) != @global(ByteArray)) {
-                            int nInst;
-
-                            nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-                            src += nInst;
-                            repNIndex -= nInst;
-                        }
-                    }
-                    repStopIndex = repStartIndex + (stopIndex - startIndex);
-                    if (repStopIndex < repNIndex) {
-                        if (aCollection == self) {
-                            /* take care of overlapping copy */
-                            if (src < dst) {
-                                /* must do a reverse copy */
-                                src += count;
-                                dst += count;
-                                while (count-- > 0) {
-                                    *--dst = *--src;
-                                }
-                                RETURN ( self );
-                            }
-                        }
+	startIndex = __intVal(start) - 1;
+	if (startIndex >= 0) {
+	    dst = (__ByteArrayInstPtr(self)->ba_element) + startIndex;
+	    nIndex = __byteArraySize(self);
+
+	    if ((cls = __qClass(self)) != @global(ByteArray)) {
+		int nInst;
+
+		nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+		dst += nInst;
+		nIndex -= nInst;
+	    }
+
+	    stopIndex = __intVal(stop) - 1;
+	    count = stopIndex - startIndex + 1;
+	    if (count == 0) {
+		RETURN ( self );
+	    }
+
+	    if ((count > 0) && (stopIndex < nIndex)) {
+		repStartIndex = __intVal(repStart) - 1;
+		if (repStartIndex >= 0) {
+		    if (__isExternalBytesLike(aCollection)) {
+			OBJ sz;
+
+			src = __externalAddressVal(aCollection);
+			if (src == 0) goto fallBack;
+
+			sz = __externalBytesSize(aCollection);
+			if (__isSmallInteger(sz)) {
+			    repNIndex = __smallIntegerVal(sz);
+			} else {
+			    repNIndex = repStopIndex+1; /* always enough */
+			}
+			src = src + repStartIndex;
+		    } else {
+			if (__isStringLike(aCollection)) {
+			    repNIndex = __stringSize(aCollection);
+			} else {
+			    repNIndex = __qSize(aCollection) - OHDR_SIZE;
+			}
+			src = (__ByteArrayInstPtr(aCollection)->ba_element) + repStartIndex;
+			if ((cls = __qClass(aCollection)) != @global(ByteArray)) {
+			    int nInst;
+
+			    nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+			    src += nInst;
+			    repNIndex -= nInst;
+			}
+		    }
+		    repStopIndex = repStartIndex + (stopIndex - startIndex);
+		    if (repStopIndex < repNIndex) {
+			if (aCollection == self) {
+			    /* take care of overlapping copy */
+			    if (src < dst) {
+				/* must do a reverse copy */
+				src += count;
+				dst += count;
+				while (count-- > 0) {
+				    *--dst = *--src;
+				}
+				RETURN ( self );
+			    }
+			}
 
 # ifdef bcopy4
-                        if (((unsigned INT)src & 3) == ((unsigned INT)dst & 3)) {
-                            int nW;
-
-                            /* copy unaligned part */
-                            while (count && ((unsigned INT)src & 3)) {
-                                *dst++ = *src++;
-                                count--;
-                            }
-
-                            if (count > 0) {
-                                /* copy aligned part */
-                                nW = count >> 2;
-                                bcopy4(src, dst, nW);
-                                if ((count = count & 3) != 0) {
-                                    /* copy any remaining part */
-                                    src += (nW<<2);
-                                    dst += (nW<<2);
-                                    while (count--) {
-                                        *dst++ = *src++;
-                                    }
-                                }
-                            }
-                            RETURN ( self );
-                        }
+			if (((unsigned INT)src & 3) == ((unsigned INT)dst & 3)) {
+			    int nW;
+
+			    /* copy unaligned part */
+			    while (count && ((unsigned INT)src & 3)) {
+				*dst++ = *src++;
+				count--;
+			    }
+
+			    if (count > 0) {
+				/* copy aligned part */
+				nW = count >> 2;
+				bcopy4(src, dst, nW);
+				if ((count = count & 3) != 0) {
+				    /* copy any remaining part */
+				    src += (nW<<2);
+				    dst += (nW<<2);
+				    while (count--) {
+					*dst++ = *src++;
+				    }
+				}
+			    }
+			    RETURN ( self );
+			}
 # else
 #  if __POINTER_SIZE__ == 8
-                        if (((unsigned INT)src & 7) == ((unsigned INT)dst & 7)) {
-                            /* copy unaligned part */
-                            while (count && ((unsigned INT)src & 7)) {
-                                *dst++ = *src++;
-                                count--;
-                            }
-
-                            /* copy aligned part */
-                            while (count >= 8) {
-                                ((unsigned INT *)dst)[0] = ((unsigned INT *)src)[0];
-                                dst += 8;
-                                src += 8;
-                                count -= 8;
-                            }
-                            while (count--) {
-                                *dst++ = *src++;
-                            }
-                            RETURN ( self );
-                        }
+			if (((unsigned INT)src & 7) == ((unsigned INT)dst & 7)) {
+			    /* copy unaligned part */
+			    while (count && ((unsigned INT)src & 7)) {
+				*dst++ = *src++;
+				count--;
+			    }
+
+			    /* copy aligned part */
+			    while (count >= 8) {
+				((unsigned INT *)dst)[0] = ((unsigned INT *)src)[0];
+				dst += 8;
+				src += 8;
+				count -= 8;
+			    }
+			    while (count--) {
+				*dst++ = *src++;
+			    }
+			    RETURN ( self );
+			}
 #  endif /* 64bit */
 # endif /* bcopy4 */
 
 # ifdef FAST_MEMCPY
-                        bcopy(src, dst, count);
+			bcopy(src, dst, count);
 # else
 #  ifdef __UNROLL_LOOPS__
-                        while (count >= 8) {
-                            dst[0] = src[0]; dst[1] = src[1];
-                            dst[2] = src[2]; dst[3] = src[3];
-                            dst[4] = src[4]; dst[5] = src[5];
-                            dst[6] = src[6]; dst[7] = src[7];
-                            dst += 8; src += 8;
-                            count -= 8;
-                        }
+			while (count >= 8) {
+			    dst[0] = src[0]; dst[1] = src[1];
+			    dst[2] = src[2]; dst[3] = src[3];
+			    dst[4] = src[4]; dst[5] = src[5];
+			    dst[6] = src[6]; dst[7] = src[7];
+			    dst += 8; src += 8;
+			    count -= 8;
+			}
 #  endif /* __UNROLL_LOOPS__ */
-                        while (count-- > 0) {
-                            *dst++ = *src++;
-                        }
+			while (count-- > 0) {
+			    *dst++ = *src++;
+			}
 # endif
-                        RETURN ( self );
-                    }
-                }
-            }
-        }
+			RETURN ( self );
+		    }
+		}
+	    }
+	}
     }
 fallBack: ;
 #endif
@@ -4602,34 +4614,34 @@
 
     "
      #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-        copy
-            replaceFrom:1 to:8
-            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:1
+	copy
+	    replaceFrom:1 to:8
+	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+	    startingAt:1
 
      #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-        copy
-            replaceFrom:3 to:10
-            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:1
+	copy
+	    replaceFrom:3 to:10
+	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+	    startingAt:1
 
      #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-        copy
-            replaceFrom:3 to:4
-            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:1
+	copy
+	    replaceFrom:3 to:4
+	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+	    startingAt:1
 
      #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-        copy
-            replaceFrom:0 to:9
-            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:1
+	copy
+	    replaceFrom:0 to:9
+	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+	    startingAt:1
 
      #[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16]
-        copy
-            replaceFrom:1 to:10
-            with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:0
+	copy
+	    replaceFrom:1 to:10
+	    with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
+	    startingAt:0
     "
 !
 
@@ -4641,15 +4653,15 @@
      therefore the change may affect all others referencing the receiver."
 
     ^ self
-        replaceBytesFrom:startIndex
-        to:(startIndex + replacementCollection size - repStartIndex)
-        with:replacementCollection
-        startingAt:repStartIndex
+	replaceBytesFrom:startIndex
+	to:(startIndex + replacementCollection size - repStartIndex)
+	with:replacementCollection
+	startingAt:repStartIndex
 
     "
      args:    startIndex            : <integer>
-              replacementCollection : <collection of <bytes> >
-              repStartIndex         : <integer>
+	      replacementCollection : <collection of <bytes> >
+	      repStartIndex         : <integer>
 
      returns: self
     "
@@ -4666,10 +4678,10 @@
      therefore the change may affect all others referencing the receiver."
 
     ^ self
-        replaceBytesFrom:1
-        to:(replacementCollection sizeInBytes min:self sizeInBytes)
-        with:replacementCollection
-        startingAt:1
+	replaceBytesFrom:1
+	to:(replacementCollection sizeInBytes min:self sizeInBytes)
+	with:replacementCollection
+	startingAt:1
 
     "
      (ByteArray new:10) replaceBytesWith:'hello'
@@ -4688,19 +4700,19 @@
      Notice: This operation modifies the receiver, NOT a copy;
      therefore the change may affect all others referencing the receiver."
 
-    (self class isBytes 
+    (self class isBytes
      and:[aCollection class == self class or:[aCollection isSingleByteCollection]]
     ) ifTrue:[
-        "can do it fast: just copy the plain bytes"
-        ^ self replaceBytesFrom:startIndex to:stopIndex with:aCollection startingAt:repStartIndex
+	"can do it fast: just copy the plain bytes"
+	^ self replaceBytesFrom:startIndex to:stopIndex with:aCollection startingAt:repStartIndex
     ].
     ^ super replaceFrom:startIndex to:stopIndex with:aCollection startingAt:repStartIndex
 
     "
      args:    startIndex            : <integer>
-              stopIndex             : <integer>
-              replacementCollection : <collection of <bytes> >
-              repStartIndex         : <integer>
+	      stopIndex             : <integer>
+	      replacementCollection : <collection of <bytes> >
+	      repStartIndex         : <integer>
 
      returns: self
     "
@@ -4716,105 +4728,105 @@
      If endindex = 0 or endIndex > size, hash up the size.
 
      NOTE: startIndex and endIndex are only hints about what should be hashed.
-           In fact, more bytes could be involved in hashing.
-           SO ARRAYS MUST BE EQUAL TO HASH TO THE SAME VALUE.
+	   In fact, more bytes could be involved in hashing.
+	   SO ARRAYS MUST BE EQUAL TO HASH TO THE SAME VALUE.
 
     Also NOTE:
-        used to return a 32bit hash on 32bit machines and a 64bit integer on 64bit cpus.
-        changed to return the same for all (in case hash values are used for other purposes)."
+	used to return a 32bit hash on 32bit machines and a 64bit integer on 64bit cpus.
+	changed to return the same for all (in case hash values are used for other purposes)."
 
     |w|
 
 %{
     if (__bothSmallInteger(startIndex, endIndex)) {
-        unsigned char *cp;
-        INT sz;
-
-        __fetchBytePointerAndSize__(self, &cp, &sz);
-        if (cp) {
-            INT sidx = ((unsigned INT)__smallIntegerVal(startIndex)) - 1;
-            INT eidx = ((unsigned INT)__smallIntegerVal(endIndex)) - 1;
-// #           define H_INT INT            
+	unsigned char *cp;
+	INT sz;
+
+	__fetchBytePointerAndSize__(self, &cp, &sz);
+	if (cp) {
+	    INT sidx = ((unsigned INT)__smallIntegerVal(startIndex)) - 1;
+	    INT eidx = ((unsigned INT)__smallIntegerVal(endIndex)) - 1;
+// #           define H_INT INT
 // #           define _MAX_H_INT _MAX_INT;
-#           define H_INT int            
+#           define H_INT int
 #           define _MAX_H_INT 0x3FFFFFFF
 
-            unsigned char *ep;
-            unsigned H_INT hash = 0, hash2 = 0, carry;
-            int i;
-
-            if (eidx < 0 || eidx >= sz) eidx = sz - 1;
-            if (sidx > eidx) sidx = eidx;
-            if (sidx < 0) {
-                RETURN(__mkSmallInteger(0));
-            }
-
-            ep = cp + eidx;
-            cp += sidx;
+	    unsigned char *ep;
+	    unsigned H_INT hash = 0, hash2 = 0, carry;
+	    int i;
+
+	    if (eidx < 0 || eidx >= sz) eidx = sz - 1;
+	    if (sidx > eidx) sidx = eidx;
+	    if (sidx < 0) {
+		RETURN(__mkSmallInteger(0));
+	    }
+
+	    ep = cp + eidx;
+	    cp += sidx;
 
 #if 0
-            /*
-             * On LSB-First (little endian) cpus,
-             * this code does not produce the same result
-             * if the same bytes are at different positions
-             */
-
-            if ((H_INT)cp & (sizeof(H_INT)-1)) {
-                /* not aligned */
-
-                for (i=0; cp <= ep; cp++) {
-                    hash2 = (hash2 << 8) | *cp;
-                    if (++i == sizeof(H_INT)) {
-                        hash ^= hash2;
-                        i = hash2 = 0;
-                    }
-                }
-            } else {
-                /* aligned */
-                for (; cp+sizeof(H_INT) <= ep; cp += sizeof(H_INT)) {
-                    hash ^= *(unsigned H_INT *)cp;
-                }
-                for (; cp <= ep; cp++) {
-                    hash2 = (hash2 << 8) | *cp;
-                }
-            }
+	    /*
+	     * On LSB-First (little endian) cpus,
+	     * this code does not produce the same result
+	     * if the same bytes are at different positions
+	     */
+
+	    if ((H_INT)cp & (sizeof(H_INT)-1)) {
+		/* not aligned */
+
+		for (i=0; cp <= ep; cp++) {
+		    hash2 = (hash2 << 8) | *cp;
+		    if (++i == sizeof(H_INT)) {
+			hash ^= hash2;
+			i = hash2 = 0;
+		    }
+		}
+	    } else {
+		/* aligned */
+		for (; cp+sizeof(H_INT) <= ep; cp += sizeof(H_INT)) {
+		    hash ^= *(unsigned H_INT *)cp;
+		}
+		for (; cp <= ep; cp++) {
+		    hash2 = (hash2 << 8) | *cp;
+		}
+	    }
 #else
-            for (i=0; cp <= ep-sizeof(H_INT); cp += sizeof(H_INT)) {
-                hash2 = cp[0];
-                hash2 = (hash2 << 8) | cp[1];
-                hash2 = (hash2 << 8) | cp[2];
-                hash2 = (hash2 << 8) | cp[3];
+	    for (i=0; cp <= ep-sizeof(H_INT); cp += sizeof(H_INT)) {
+		hash2 = cp[0];
+		hash2 = (hash2 << 8) | cp[1];
+		hash2 = (hash2 << 8) | cp[2];
+		hash2 = (hash2 << 8) | cp[3];
 # if 0
-                if (sizeof(H_INT) == 8) {
-                    hash2 = (hash2 << 8) | cp[4];
-                    hash2 = (hash2 << 8) | cp[5];
-                    hash2 = (hash2 << 8) | cp[6];
-                    hash2 = (hash2 << 8) | cp[7];
-                }
+		if (sizeof(H_INT) == 8) {
+		    hash2 = (hash2 << 8) | cp[4];
+		    hash2 = (hash2 << 8) | cp[5];
+		    hash2 = (hash2 << 8) | cp[6];
+		    hash2 = (hash2 << 8) | cp[7];
+		}
 # endif
-                /*
-                 * multiply by large prime to scramble bits and
-                 * to avoid a 0 result from
-                 * #[1 2 3 4 1 2 3 4] computeXorHashFrom:1 to:8.
-                 */
-                hash ^= (hash * 31415821) ^ hash2;
-            }
-            for (hash2 = 0; cp <= ep; cp++) {
-                hash2 = (hash2 << 8) | *cp;
-            }
+		/*
+		 * multiply by large prime to scramble bits and
+		 * to avoid a 0 result from
+		 * #[1 2 3 4 1 2 3 4] computeXorHashFrom:1 to:8.
+		 */
+		hash ^= (hash * 31415821) ^ hash2;
+	    }
+	    for (hash2 = 0; cp <= ep; cp++) {
+		hash2 = (hash2 << 8) | *cp;
+	    }
 #endif
-            hash ^= (hash * 31415821) ^ hash2;
-
-            /*
-             * fold the high bits not fitting into a H_INT
-             */
-            carry = hash & ~_MAX_H_INT;
-            if (carry) {
-                hash = (hash & _MAX_H_INT) ^ (carry >> 8);
-            }
-
-            RETURN(__mkSmallInteger(hash));
-        }
+	    hash ^= (hash * 31415821) ^ hash2;
+
+	    /*
+	     * fold the high bits not fitting into a H_INT
+	     */
+	    carry = hash & ~_MAX_H_INT;
+	    if (carry) {
+		hash = (hash & _MAX_H_INT) ^ (carry >> 8);
+	    }
+
+	    RETURN(__mkSmallInteger(hash));
+	}
     }
 %}.
 
@@ -4826,7 +4838,7 @@
      #[1 2 3 4] computeXorHashFrom:1 to:0.
      #[1 2 3 4 5] computeXorHashFrom:1 to:4.
      #[1 2 3 4 1 2 3 4] computeXorHashFrom:1 to:8.
-     #[1 2 3 4 5 6 7 8] computeXorHashFrom:2 to:8. 
+     #[1 2 3 4 5 6 7 8] computeXorHashFrom:2 to:8.
      #[2 3 4 5 6 7 8] computeXorHashFrom:1 to:7.
      #[2 3 4 5 6 7 8] computeXorHashFrom:1 to:8.
     "
@@ -4837,16 +4849,16 @@
 
     sz := self size.
     sz <= 32 ifTrue:[
-        ^ self computeXorHashFrom:1 to:sz.
+	^ self computeXorHashFrom:1 to:sz.
     ].
-    ^ (sz bitXor:(self computeXorHashFrom:1 to:16)) bitXor:(self computeXorHashFrom:sz-16 to:sz)   
-
-    "
-        #[1 2 3 4] hash
-        #[1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
-          1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 ] hash
-        #[1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
-          1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1] hash
+    ^ (sz bitXor:(self computeXorHashFrom:1 to:16)) bitXor:(self computeXorHashFrom:sz-16 to:sz)
+
+    "
+	#[1 2 3 4] hash
+	#[1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
+	  1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 ] hash
+	#[1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
+	  1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1] hash
     "
 ! !
 
@@ -4877,9 +4889,9 @@
 
     lastIndex := self size-1.
     1 to:lastIndex by:2 do:[:idx |
-        b1 := self byteAt:idx.
-        self byteAt:idx put:(self byteAt:idx+1).
-        self byteAt:idx+1 put:b1.
+	b1 := self byteAt:idx.
+	self byteAt:idx put:(self byteAt:idx+1).
+	self byteAt:idx+1 put:b1.
     ].
 
     "
@@ -4933,14 +4945,14 @@
 
     first := true.
     1 to:self size do:[:idx |
-        aSeparatorStringOrCharacterOrNil notNil ifTrue:[
-            first ifFalse:[
-                aSeparatorStringOrCharacterOrNil printOn:aStream
-            ] ifTrue:[
-                first := false.
-            ].
-        ].
-        (self byteAt:idx) printOn:aStream base:16 size:2 fill:$0.
+	aSeparatorStringOrCharacterOrNil notNil ifTrue:[
+	    first ifFalse:[
+		aSeparatorStringOrCharacterOrNil printOn:aStream
+	    ] ifTrue:[
+		first := false.
+	    ].
+	].
+	(self byteAt:idx) printOn:aStream base:16 size:2 fill:$0.
     ].
 
     "
@@ -4971,9 +4983,9 @@
     "print as hex string, eg: 'FF:02:43'."
 
     ^ String
-        streamContents:[:s |
-            self hexPrintOn:s withSeparator:aSeparatorStringOrCharacterOrNil.
-        ]
+	streamContents:[:s |
+	    self hexPrintOn:s withSeparator:aSeparatorStringOrCharacterOrNil.
+	]
 
     "
       #[1 2 3 4 10 17] hexPrintStringWithSeparator:$:
@@ -4998,8 +5010,8 @@
     srcIdx := sourceIndex.
 
     start to:stop do:[:dstIdx |
-        self byteAt:dstIdx put:(sourceBytes byteAt:srcIdx).
-        srcIdx := srcIdx + 1
+	self byteAt:dstIdx put:(sourceBytes byteAt:srcIdx).
+	srcIdx := srcIdx + 1
     ].
 
     "Modified: / 28-08-2017 / 02:25:53 / cg"
@@ -5015,9 +5027,9 @@
 
     sz := self size.
     1 to:sz do:[:idx|
-        (self at:idx) > 16r7F ifTrue:[
-            ^ true.
-        ].
+	(self at:idx) > 16r7F ifTrue:[
+	    ^ true.
+	].
     ].
     ^ false.
 !
@@ -5029,9 +5041,9 @@
 
     sz := self size.
     1 to:sz do:[:idx|
-        (self at:idx) > 16rFF ifTrue:[
-            ^ true.
-        ].
+	(self at:idx) > 16rFF ifTrue:[
+	    ^ true.
+	].
     ].
     ^ false.
 !
@@ -5042,49 +5054,49 @@
 
 isValidUTF8
     "returns true, if the receiver contains a valid UTF8 encoded string"
-    
+
     |trailing  "{ Class: SmallInteger }"|
 
     trailing := 0.
 
     1 to:self size do:[:idx |
-        |byte "{ Class: SmallInteger }" |
-
-        byte := self byteAt:idx.
-        trailing ~~ 0 ifTrue:[
-            (byte bitAnd:2r11000000) == 2r10000000 ifFalse:[^ false].
-            trailing := trailing - 1.
-        ] ifFalse:[
-            (byte bitAnd:16r80) == 0 ifTrue:[
-                "/ continue
-            ] ifFalse:[
-                (byte bitAnd:2r11100000) == 2r11000000 ifTrue:[
-                    "/ strict: should not be encoded this way (could have used a shorter sequence)
-                    (byte bitAnd:2r00011110) == 0 ifTrue:[
-                        ^ false
-                    ].    
-                    trailing := 1.
-                ] ifFalse:[
-                    (byte bitAnd:2r11110000) == 2r11100000 ifTrue:[
-                        trailing := 2.
-                    ] ifFalse:[
-                        (byte bitAnd:2r11111000) == 2r11110000 ifTrue:[
-                            trailing := 3.
-                        ] ifFalse:[
-                            (byte bitAnd:2r11111100) == 2r11111000 ifTrue:[
-                                trailing := 4.
-                            ] ifFalse:[
-                                (byte bitAnd:2r11111110) == 2r11111100 ifTrue:[
-                                    trailing := 5.
-                                ] ifFalse:[
-                                    ^ false
-                                ].    
-                            ].    
-                        ].    
-                    ].    
-                ].    
-            ].    
-        ].
+	|byte "{ Class: SmallInteger }" |
+
+	byte := self byteAt:idx.
+	trailing ~~ 0 ifTrue:[
+	    (byte bitAnd:2r11000000) == 2r10000000 ifFalse:[^ false].
+	    trailing := trailing - 1.
+	] ifFalse:[
+	    (byte bitAnd:16r80) == 0 ifTrue:[
+		"/ continue
+	    ] ifFalse:[
+		(byte bitAnd:2r11100000) == 2r11000000 ifTrue:[
+		    "/ strict: should not be encoded this way (could have used a shorter sequence)
+		    (byte bitAnd:2r00011110) == 0 ifTrue:[
+			^ false
+		    ].
+		    trailing := 1.
+		] ifFalse:[
+		    (byte bitAnd:2r11110000) == 2r11100000 ifTrue:[
+			trailing := 2.
+		    ] ifFalse:[
+			(byte bitAnd:2r11111000) == 2r11110000 ifTrue:[
+			    trailing := 3.
+			] ifFalse:[
+			    (byte bitAnd:2r11111100) == 2r11111000 ifTrue:[
+				trailing := 4.
+			    ] ifFalse:[
+				(byte bitAnd:2r11111110) == 2r11111100 ifTrue:[
+				    trailing := 5.
+				] ifFalse:[
+				    ^ false
+				].
+			    ].
+			].
+		    ].
+		].
+	    ].
+	].
     ].
     ^ trailing == 0
 
@@ -5094,22 +5106,22 @@
      'abcöäü' utf8Encoded isValidUTF8
      (Character value:16r800) utf8Encoded isValidUTF8
      (Character value:16r1000) utf8Encoded isValidUTF8
-     
+
      1 to:255 do:[:c1 |
-         1 to:255 do:[:c2 |
-             1 to:255 do:[:c3 |
-                 self assert:(c1 asCharacter , c2 asCharacter , c3 asCharacter) utf8Encoded isValidUTF8
-             ] 
-         ] 
+	 1 to:255 do:[:c2 |
+	     1 to:255 do:[:c3 |
+		 self assert:(c1 asCharacter , c2 asCharacter , c3 asCharacter) utf8Encoded isValidUTF8
+	     ]
+	 ]
      ]
 
      |s|
      1 to:10000 do:[:c1 |
-         1 to:255 do:[:c2 |
-             s := (c1 asCharacter , c2 asCharacter).
-             self assert:s utf8Encoded isValidUTF8
-         ] 
-     ] 
+	 1 to:255 do:[:c2 |
+	     s := (c1 asCharacter , c2 asCharacter).
+	     self assert:s utf8Encoded isValidUTF8
+	 ]
+     ]
     "
 !
 
@@ -5118,14 +5130,14 @@
 
 %{ /* NOCONTEXT */
     if (__mkSmallInteger(0) == __ClassInstPtr(__qClass(self))->c_ninstvars) {
-        /* I am only bytes */
-        RETURN(false)
+	/* I am only bytes */
+	RETURN(false)
     }
 %}.
     ^ super referencesAny:aCollection
 
     "
-        'abc' referencesAny:#()
+	'abc' referencesAny:#()
     "
 !
 
@@ -5141,18 +5153,18 @@
 utf8DecodedSize
     "return the number of charcters needed wnen this string is
      decoded from UTL-8"
- 
+
     |sz "{ Class:SmallInteger }"
      cnt "{ Class:SmallInteger }"|
 
-    sz := self size.   
+    sz := self size.
     cnt := 0.
 
     1 to:sz do:[:idx|
-        "/ count the number of UTF-8 start bytes
-        ((self byteAt:idx) bitAnd:16rC0) ~~ 16r80 ifTrue:[
-            cnt := cnt+1.
-        ].
+	"/ count the number of UTF-8 start bytes
+	((self byteAt:idx) bitAnd:16rC0) ~~ 16r80 ifTrue:[
+	    cnt := cnt+1.
+	].
     ].
     ^ cnt.
 
@@ -5186,7 +5198,7 @@
 isSingleByteCollection
     "return true, if the receiver has access methods for bytes;
      i.e. #at: and #at:put: accesses a byte and are equivalent to #byteAt: and byteAt:put:
-     and #replaceFrom:to: is equivalent to #replaceBytesFrom:to:. 
+     and #replaceFrom:to: is equivalent to #replaceBytesFrom:to:.
      This is different from 'self class isBytes',
      true is returned here - the method is redefined from Object."