LargeInteger.st
branchjv
changeset 17797 71451ae83564
parent 17780 b6e42c92eba0
child 17807 06cc6c49e291
--- a/LargeInteger.st	Thu Aug 19 21:39:34 2010 +0100
+++ b/LargeInteger.st	Thu Aug 26 11:12:57 2010 +0100
@@ -1031,29 +1031,29 @@
 bitAt:anIntegerIndex
     "return the value of the index's bit (index starts at 1) as 0 or 1.
      Notice: the result of bitAt: on negative receivers is not
-	     defined in the language standard (since the implementation
-	     is free to choose any internal representation for integers)"
+             defined in the language standard (since the implementation
+             is free to choose any internal representation for integers)"
 
 %{  /* NOCONTEXT */
     if (__isSmallInteger(anIntegerIndex)) {
-	INT idx = __smallIntegerVal(anIntegerIndex) - 1;
-
-	if (idx >= 0) {
-	    int v1;
-	    int byteOffset = idx / 8;
-	    int digitLen   = __stringSize(__INST(digitByteArray));
-
-	    if (digitLen < byteOffset) {
-		RETURN(__mkSmallInteger(0));
-	    }
-
-	    v1 = (__byteArrayVal(__INST(digitByteArray)))[byteOffset];
-	    if (v1 & (1 << (idx % 8))) {
-		RETURN(__mkSmallInteger(1));
-	    } else {
-		RETURN(__mkSmallInteger(0));
-	    }
-	}
+        INT idx = __smallIntegerVal(anIntegerIndex) - 1;
+
+        if (idx >= 0) {
+            int v1;
+            int byteOffset = idx / 8;
+            int digitLen   = __byteArraySize(__INST(digitByteArray));
+
+            if (digitLen < byteOffset) {
+                RETURN(__mkSmallInteger(0));
+            }
+
+            v1 = (__byteArrayVal(__INST(digitByteArray)))[byteOffset];
+            if (v1 & (1 << (idx % 8))) {
+                RETURN(__mkSmallInteger(1));
+            } else {
+                RETURN(__mkSmallInteger(0));
+            }
+        }
     }
 %}.
     ^ super bitAt:anIntegerIndex
@@ -1068,6 +1068,8 @@
      TestCase assert:( 16rFFFFFFFF01FF bitAt:9  ) == 1
      TestCase assert:( 16rFFFFFFFF01FF bitAt:10 ) == 0
     "
+
+    "Modified: / 10-08-2010 / 12:33:04 / cg"
 !
 
 bitXor:anInteger
@@ -5139,17 +5141,18 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Id: LargeInteger.st 10544 2010-07-12 16:20:36Z vranyj1 $'
+    ^ '$Id: LargeInteger.st 10570 2010-08-26 10:12:57Z vranyj1 $'
 !
 
 version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.201 2010/04/14 08:00:14 stefan Exp '
+    ^ 'Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.202 2010/08/10 10:34:11 cg Exp '
 !
 
 version_SVN
-    ^ '$Id: LargeInteger.st 10544 2010-07-12 16:20:36Z vranyj1 $'
+    ^ '$Id: LargeInteger.st 10570 2010-08-26 10:12:57Z vranyj1 $'
 ! !
 
 
 
 
+