SmallInteger.st
changeset 19263 6b090dfa8c32
parent 19133 63ef07879231
child 19264 11160ea2c8b3
--- a/SmallInteger.st	Sat Feb 27 01:09:29 2016 +0100
+++ b/SmallInteger.st	Sat Feb 27 22:19:37 2016 +0100
@@ -997,7 +997,7 @@
 #else
     /* anding the tags doesn't change it */
     if (__isSmallInteger(anInteger)) {
-        RETURN ( ((OBJ) (((INT)self & ~(INT)anInteger) | TAG_INT)) );
+	RETURN ( ((OBJ) (((INT)self & ~(INT)anInteger) | TAG_INT)) );
     }
 #endif /* not __SCHTEAM__ */
 %}.
@@ -1212,7 +1212,7 @@
 #endif /* not __SCHTEAM__ */
 %}.
     ^ super bitInvertByte
-    
+
     "
      16r7f bitInvert
      16r7f bitInvertByte
@@ -1875,28 +1875,28 @@
 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 */
 #ifdef __SCHTEAM__
     return context._RETURN( self.bitAt(anIntegerIndex));
 #else
     if (__isSmallInteger(anIntegerIndex)) {
-        INT idx = __smallIntegerVal(anIntegerIndex);
-        if (idx > 0) {
-            if (idx > N_INT_BITS) {
-                RETURN(__mkSmallInteger(0));
-            }
-            RETURN((__smallIntegerVal(self) & ((INT)1 << (idx-1))) ? __mkSmallInteger(1) : __mkSmallInteger(0));
-        }
+	INT idx = __smallIntegerVal(anIntegerIndex);
+	if (idx > 0) {
+	    if (idx > N_INT_BITS) {
+		RETURN(__mkSmallInteger(0));
+	    }
+	    RETURN((__smallIntegerVal(self) & ((INT)1 << (idx-1))) ? __mkSmallInteger(1) : __mkSmallInteger(0));
+	}
     }
 #endif /* not __SCHTEAM__ */
 %}.
 
     ^ SubscriptOutOfBoundsError
-            raiseRequestWith:anIntegerIndex
-            errorString:'index out of bounds'
+	    raiseRequestWith:anIntegerIndex
+	    errorString:'index out of bounds'
 
     "
      16r000000001 bitAt:0 -> error
@@ -1916,9 +1916,9 @@
     |mask|
 
     anIntegerIndex <= 0 ifTrue:[
-        ^ SubscriptOutOfBoundsSignal
-                raiseRequestWith:anIntegerIndex
-                errorString:'index out of bounds'
+	^ SubscriptOutOfBoundsSignal
+		raiseRequestWith:anIntegerIndex
+		errorString:'index out of bounds'
     ].
     (anIntegerIndex > SmallInteger maxBits) ifTrue:[^ 0].
     mask := 1 bitShift:(anIntegerIndex - 1).
@@ -1936,21 +1936,21 @@
 %{  /* NOCONTEXT */
 #ifndef __SCHTEAM__
     if (__isSmallInteger(anInteger)) {
-        int index = __intVal(anInteger);
-
-        if (index > 0) {
+	int index = __intVal(anInteger);
+
+	if (index > 0) {
 # if __POINTER_SIZE__ == 8
-            if (index <= 62)
+	    if (index <= 62)
 # else
-            if (index <= 30)
+	    if (index <= 30)
 # endif
-            {
-                INT mask = __MASKSMALLINT( ((INT)1 << (index-1)));
-
-                RETURN ( ((OBJ) ((INT)self & ~(INT)mask)) );
-            }
-            RETURN (self);  /* nothing to do ... */
-        }
+	    {
+		INT mask = __MASKSMALLINT( ((INT)1 << (index-1)));
+
+		RETURN ( ((OBJ) ((INT)self & ~(INT)mask)) );
+	    }
+	    RETURN (self);  /* nothing to do ... */
+	}
     }
 #endif /* not __SCHTEAM__ */
 %}.
@@ -1984,20 +1984,20 @@
 %{  /* NOCONTEXT */
 #ifndef __SCHTEAM__
     if (__isSmallInteger(anInteger)) {
-        int index = __intVal(anInteger);
-
-        if (index > 0) {
+	int index = __intVal(anInteger);
+
+	if (index > 0) {
 # if __POINTER_SIZE__ == 8
-            if (index <= 62)
+	    if (index <= 62)
 # else
-            if (index <= 30)
+	    if (index <= 30)
 # endif
-            {
-                INT mask = __MASKSMALLINT((INT)1 << (index-1));
-
-                RETURN ( ((OBJ) ((INT)self ^ (INT)mask)) );
-            }
-        }
+	    {
+		INT mask = __MASKSMALLINT((INT)1 << (index-1));
+
+		RETURN ( ((OBJ) ((INT)self ^ (INT)mask)) );
+	    }
+	}
     }
 #endif /* not __SCHTEAM__ */
 %}.
@@ -2026,20 +2026,20 @@
 %{  /* NOCONTEXT */
 #ifndef __SCHTEAM__
     if (__isSmallInteger(anInteger)) {
-        int index = __intVal(anInteger);
-
-        if (index > 0) {
+	int index = __intVal(anInteger);
+
+	if (index > 0) {
 # if __POINTER_SIZE__ == 8
-            if (index <= 62)
+	    if (index <= 62)
 # else
-            if (index <= 30)
+	    if (index <= 30)
 # endif
-            {
-                INT mask = __MASKSMALLINT((INT)1 << (index-1));
-
-                RETURN ( ((OBJ) ((INT)self | (INT)mask)) );
-            }
-        }
+	    {
+		INT mask = __MASKSMALLINT((INT)1 << (index-1));
+
+		RETURN ( ((OBJ) ((INT)self | (INT)mask)) );
+	    }
+	}
     }
 #endif /* not __SCHTEAM__ */
 %}.
@@ -2118,31 +2118,31 @@
 #   define HAVE_BSWAP
 
     _asm {
-        mov eax, v
-        bswap eax
-        mov swapped, eax
+	mov eax, v
+	bswap eax
+	mov swapped, eax
     };
 #  endif
 #  if defined(USE_BSWAP) && defined(__VISUALC__)
 #   define HAVE_BSWAP
 
     _asm {
-        mov eax, v
-        xchg al, ah
-        rol eax, 16
-        xchg al, ah
-        mov swapped, eax
+	mov eax, v
+	xchg al, ah
+	rol eax, 16
+	xchg al, ah
+	mov swapped, eax
     };
 #  endif
 #  if defined(USE_BSWAP) && defined(__GNUC__)
 #   define HAVE_BSWAP
 
     asm("movl %1, %%eax \n\
-         bswap %%eax    \n\
-         movl %%eax, %0 \n\
-        "
-        : "=rm"  (swapped)
-        : "rm"   (v));
+	 bswap %%eax    \n\
+	 movl %%eax, %0 \n\
+	"
+	: "=rm"  (swapped)
+	: "rm"   (v));
 #  endif
 # endif /* __POINTER_SIZE__ == 4 */
 
@@ -2153,11 +2153,11 @@
 #   define HAVE_BSWAP
 
     asm("movq %1, %%rax \n\
-         bswap %%eax    \n\
-         movq %%rax, %0 \n\
-        "
-        : "=rm"  (swapped)
-        : "rm"   (v));
+	 bswap %%eax    \n\
+	 movq %%rax, %0 \n\
+	"
+	: "=rm"  (swapped)
+	: "rm"   (v));
 #  endif
 # endif
 
@@ -2854,7 +2854,7 @@
 #ifndef __SCHTEAM__
     INT i = __intVal(self);
 
-    if (i & 0x800000) {
+    if (i & 0x800000L) {
 	i = i | ~0xFFFFFFL;
     } else {
 	i = i & 0x7FFFFF;
@@ -2906,7 +2906,7 @@
 #ifndef __SCHTEAM__
     INT i = __intVal(self);
 
-    if (i & 0x80000000) {
+    if (i & 0x80000000L) {
 	i = i | ~0xFFFFFFFFL;
     } else {
 	i = i & 0x7FFFFFFF;
@@ -5160,7 +5160,7 @@
     "return the power of 2 at or above the receiver.
      Useful for padding.
      Notice, that for a powerOf2, the receiver is returned.
-     Also notice, that (because it is used for padding), 
+     Also notice, that (because it is used for padding),
      0 is returned for zero."
 
 %{  /* NOCONTEXT */