Array.st
changeset 8913 b9498d27a554
parent 8901 824a89d0b5c7
child 8919 707a9ff7f9b2
--- a/Array.st	Fri Jul 08 18:41:53 2005 +0200
+++ b/Array.st	Fri Jul 08 19:15:03 2005 +0200
@@ -549,7 +549,7 @@
     if (nIndex <= actualSize) {
 
 	if (__isBlockLike(aBlock)
-	 && (__BlockInstPtr(aBlock)->b_nargs == __MKSMALLINT(1))) {
+	 && (__BlockInstPtr(aBlock)->b_nargs == __mkSmallInteger(1))) {
 	    {
 		/*
 		 * the most common case: a static compiled block, with home on the stack ...
@@ -777,7 +777,7 @@
 	    n = indexHigh - index;
 
 	    if (__isBlockLike(__aBlock)
-	     && (__BlockInstPtr(__aBlock)->b_nargs == __MKSMALLINT(1))) {
+	     && (__BlockInstPtr(__aBlock)->b_nargs == __mkSmallInteger(1))) {
 		{
 		    /*
 		     * the most common case: a static compiled block, with home on the stack ...
@@ -1045,7 +1045,7 @@
 	    indexHigh--;
 
 	    if (__isBlockLike(aBlock)
-	     && (__BlockInstPtr(aBlock)->b_nargs == __MKSMALLINT(1))) {
+	     && (__BlockInstPtr(aBlock)->b_nargs == __mkSmallInteger(1))) {
 #               undef BLOCK_ARG
 #ifdef NEW_BLOCK_CALL
 #               define BLOCK_ARG        aBlock
@@ -1113,21 +1113,21 @@
 
 %{
     REGISTER OBJFUNC codeVal;
-    REGISTER int index;
+    REGISTER INT index;
     static struct inlineCache val2 = _ILC2;
     REGISTER OBJ rHome;
     int actualSize;
     OBJ myClass;
 
     myClass = __qClass(self);
-    if ((__ClassInstPtr(myClass)->c_ninstvars) == __MKSMALLINT(0)) {
+    if ((__ClassInstPtr(myClass)->c_ninstvars) == __mkSmallInteger(0)) {
 
 	actualSize = __BYTES2OBJS__(__qSize(self) - OHDR_SIZE);
 	index = 0;
 
 	if (index < actualSize) {
 	    if (__isBlockLike(aBlock)
-	     && (__BlockInstPtr(aBlock)->b_nargs == __MKSMALLINT(2))) {
+	     && (__BlockInstPtr(aBlock)->b_nargs == __mkSmallInteger(2))) {
 		{
 		    /*
 		     * the most common case: a static compiled block, with home on the stack ...
@@ -1158,7 +1158,7 @@
 				if (InterruptPending != nil) goto interruptX;
 		continueX:
 				index++;
-				(*codeVal)(BLOCK_ARG, __MKSMALLINT(index), el);
+				(*codeVal)(BLOCK_ARG, __mkSmallInteger(index), el);
 			    }
 			    RETURN (self);
 
@@ -1192,7 +1192,7 @@
 		    el = __InstPtr(self)->i_instvars[index];
 		    index++;
 		    if ((codeVal = __BlockInstPtr(aBlock)->b_code) != (OBJFUNC)nil) {
-			(*codeVal)(BLOCK_ARG, __MKSMALLINT(index), el);
+			(*codeVal)(BLOCK_ARG, __mkSmallInteger(index), el);
 		    } else {
 			if (__BlockInstPtr(aBlock)->b_bytecodes != nil) {
 			    /*
@@ -1203,19 +1203,19 @@
 			    {
 				OBJ t[2];
 
-				t[0] = __MKSMALLINT(index);
+				t[0] = __mkSmallInteger(index);
 				t[1] = el;
 
 				__interpret(aBlock, 2, nil, IBLOCK_ARG, nil, nil, t);
 			    }
 #else
-			    __interpret(aBlock, 2, nil, IBLOCK_ARG, nil, nil, __MKSMALLINT(index), el);
+			    __interpret(aBlock, 2, nil, IBLOCK_ARG, nil, nil, __mkSmallInteger(index), el);
 #endif
 			} else {
 			    (*val2.ilc_func)(aBlock, 
 						@symbol(value:value:), 
 						nil, &val2, 
-						__MKSMALLINT(index),
+						__mkSmallInteger(index),
 						el);
 			}
 		    }
@@ -1240,7 +1240,7 @@
 		(*val2.ilc_func)(aBlock, 
 				    @symbol(value:value:), 
 				    nil, &val2, 
-				    __MKSMALLINT(index),
+				    __mkSmallInteger(index),
 				    el);
 	    }
 	    RETURN ( self );
@@ -1274,7 +1274,7 @@
 
 	if (nIndex <= actualSize) {
 	    if (__isBlockLike(aBlock)
-	     && (__BlockInstPtr(aBlock)->b_nargs == __MKSMALLINT(1))) {
+	     && (__BlockInstPtr(aBlock)->b_nargs == __mkSmallInteger(1))) {
 #               undef BLOCK_ARG
 #ifdef NEW_BLOCK_CALL
 #               define BLOCK_ARG        aBlock
@@ -1448,7 +1448,7 @@
     OBJ myClass;
     
     if (
-	(__ClassInstPtr((myClass = __qClass(self)))->c_ninstvars == __MKSMALLINT(0))
+	(__ClassInstPtr((myClass = __qClass(self)))->c_ninstvars == __mkSmallInteger(0))
      && __isNonNilObject(aCollection)
      && (((t = __qClass(aCollection)) == Array) || (t == myClass))
      && __bothSmallInteger(start, stop)
@@ -1732,7 +1732,7 @@
 %{  /* NOCONTEXT */
     REGISTER OBJ slf = self;
 
-    RETURN ( __MKSMALLINT(__arraySize(slf) - __intVal(__ClassInstPtr(__qClass(slf))->c_ninstvars) ));
+    RETURN ( __mkSmallInteger(__arraySize(slf) - __intVal(__ClassInstPtr(__qClass(slf))->c_ninstvars) ));
 %}
 !
 
@@ -1772,7 +1772,7 @@
 %{  /* NOCONTEXT */
     REGISTER OBJ slf = self;
 
-    RETURN ( __MKSMALLINT(__arraySize(slf) - __intVal(__ClassInstPtr(__qClass(slf))->c_ninstvars) ));
+    RETURN ( __mkSmallInteger(__arraySize(slf) - __intVal(__ClassInstPtr(__qClass(slf))->c_ninstvars) ));
 %}
 ! !
 
@@ -1789,11 +1789,11 @@
 
 %{  /* NOCONTEXT */
 
-    REGISTER int index;
+    REGISTER INT index;
     REGISTER OBJ o, el1, el2;
     REGISTER OBJ *op;
-    REGISTER unsigned int nIndex;
-    int altIndex = 0;
+    REGISTER unsigned INT nIndex;
+    INT altIndex = 0;
     int nInsts;
 
     index = 0;
@@ -1804,7 +1804,7 @@
     op = & (__InstPtr(self)->i_instvars[index]);
     while (index++ < nIndex) {
 	if ((o = *op++) == el1) {
-	    RETURN ( __MKSMALLINT(index - nInsts) );
+	    RETURN ( __mkSmallInteger(index - nInsts) );
 	}
 	if (o == el2) {
 	    if (altIndex == 0) {
@@ -1812,7 +1812,7 @@
 	    }
 	}
     }
-    RETURN ( __MKSMALLINT(altIndex) );
+    RETURN ( __mkSmallInteger(altIndex) );
 %}.
     ^ super identityIndexOf:anElement or:alternative
 
@@ -1834,10 +1834,10 @@
 
 %{  /* NOCONTEXT */
 
-    REGISTER int index;
+    REGISTER INT index;
     REGISTER OBJ el;
     REGISTER OBJ *op;
-    REGISTER unsigned int nIndex;
+    REGISTER unsigned INT nIndex;
     int nInsts;
 
     if (__isSmallInteger(start)) {
@@ -1856,7 +1856,7 @@
 		p = memsrch4(op, (INT)el, (nIndex - index));
 		if (p) {
 		    index += (p - op + 1);
-		    RETURN ( __MKSMALLINT(index) ); 
+		    RETURN ( __mkSmallInteger(index) ); 
 		}
 	    }
 #else
@@ -1898,21 +1898,21 @@
 		}
 		if (0) {
 		    found1:
-			RETURN ( __MKSMALLINT(index + 1 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 1 - nInsts) );
 		    found2:
-			RETURN ( __MKSMALLINT(index + 2 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 2 - nInsts) );
 		    found3:
-			RETURN ( __MKSMALLINT(index + 3 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 3 - nInsts) );
 		    found4:
-			RETURN ( __MKSMALLINT(index + 4 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 4 - nInsts) );
 		    found5:
-			RETURN ( __MKSMALLINT(index + 5 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 5 - nInsts) );
 		    found6:
-			RETURN ( __MKSMALLINT(index + 6 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 6 - nInsts) );
 		    found7:
-			RETURN ( __MKSMALLINT(index + 7 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 7 - nInsts) );
 		    found8:
-			RETURN ( __MKSMALLINT(index + 8 - nInsts) );
+			RETURN ( __mkSmallInteger(index + 8 - nInsts) );
 		}
 	    }
 # endif /* UNROLLED_LOOPS */
@@ -1923,11 +1923,11 @@
 
 	    if (0) {
 		found0:
-		    RETURN ( __MKSMALLINT(index - nInsts) );
+		    RETURN ( __mkSmallInteger(index - nInsts) );
 	    }
 #endif /* no memsrch */
 	}
-	RETURN ( __MKSMALLINT(0) );
+	RETURN ( __mkSmallInteger(0) );
     }
 %}.
     ^ super identityIndexOf:anElement startingAt:start
@@ -1940,11 +1940,11 @@
 
 %{  /* NOCONTEXT */
 
-    REGISTER int index;
+    REGISTER INT index;
     REGISTER OBJ el;
     REGISTER OBJ *op;
     REGISTER unsigned int lastIndex;
-    unsigned int nIndex;
+    unsigned INT nIndex;
     int nInsts;
 
     if (__bothSmallInteger(start, stop)) {
@@ -1967,7 +1967,7 @@
 		p = memsrch4(op, (INT)el, (lastIndex - index));
 		if (p) {
 		    index += (p - op + 1);
-		    RETURN ( __MKSMALLINT(index) ); 
+		    RETURN ( __mkSmallInteger(index) ); 
 		}
 	    }
 #else
@@ -1991,21 +1991,21 @@
 
 		if (0) {
 	    found1:
-		    RETURN ( __MKSMALLINT(index + 1 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 1 - nInsts) );
 	    found2:
-		    RETURN ( __MKSMALLINT(index + 2 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 2 - nInsts) );
 	    found3:
-		    RETURN ( __MKSMALLINT(index + 3 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 3 - nInsts) );
 	    found4:
-		    RETURN ( __MKSMALLINT(index + 4 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 4 - nInsts) );
 	    found5:
-		    RETURN ( __MKSMALLINT(index + 5 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 5 - nInsts) );
 	    found6:
-		    RETURN ( __MKSMALLINT(index + 6 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 6 - nInsts) );
 	    found7:
-		    RETURN ( __MKSMALLINT(index + 7 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 7 - nInsts) );
 	    found8:
-		    RETURN ( __MKSMALLINT(index + 8 - nInsts) );
+		    RETURN ( __mkSmallInteger(index + 8 - nInsts) );
 		}
 	    }
 # endif /* UNROLL_LOOPS */
@@ -2016,11 +2016,11 @@
 
 	    if (0) {
 		found0:
-		    RETURN ( __MKSMALLINT(index - nInsts) );
+		    RETURN ( __mkSmallInteger(index - nInsts) );
 	    }
 #endif
 	}
-	RETURN ( __MKSMALLINT(0) );
+	RETURN ( __mkSmallInteger(0) );
     }
 %}.
     ^ super identityIndexOf:anElement startingAt:start endingAt:stop
@@ -2033,8 +2033,9 @@
 
     |element|
 %{
-    REGISTER int index;
-    unsigned int nIndex, nInsts;
+    REGISTER INT index;
+    unsigned INT nIndex;
+    unsigned int nInsts;
     static struct inlineCache eq = _ILC1;
     OBJ myClass, e;
 
@@ -2059,15 +2060,15 @@
 			element = __InstPtr(self)->i_instvars[index++];
 			if (__isNonNilObject(element)) {
 			    if (element == e) {
-				RETURN ( __MKSMALLINT(index - nInsts) );
+				RETURN ( __mkSmallInteger(index - nInsts) );
 			    }
 			    if (__qClass(element) == @global(String)) {
 				if (strcmp(__stringVal(e), __stringVal(element)) == 0) {
-				    RETURN ( __MKSMALLINT(index - nInsts) );
+				    RETURN ( __mkSmallInteger(index - nInsts) );
 				}
 			    } else {
 				if ((*eq.ilc_func)(e, @symbol(=), nil,&eq, element) == true) {
-				    RETURN ( __MKSMALLINT(index - nInsts) );
+				    RETURN ( __mkSmallInteger(index - nInsts) );
 				}
 				/*
 				 * send of #= could have lead to a GC - refetch e
@@ -2076,7 +2077,7 @@
 			    }
 			}
 		    }
-		    RETURN (__MKSMALLINT(0));
+		    RETURN (__mkSmallInteger(0));
 		}
 #endif
 		if (__isSmallInteger(e)) {
@@ -2084,14 +2085,14 @@
 		    while (index < nIndex) {
 			element = __InstPtr(self)->i_instvars[index++];
 			if (element == e) {
-			    RETURN ( __MKSMALLINT(index - nInsts) );
+			    RETURN ( __mkSmallInteger(index - nInsts) );
 			}
 			if (!__isSmallInteger(element)) {
 			    if ((*eq.ilc_func)(e,
 						@symbol(=), 
 						nil,&eq,
 						element) == true) {
-				RETURN ( __MKSMALLINT(index - nInsts) );
+				RETURN ( __mkSmallInteger(index - nInsts) );
 			    }
 			    /*
 			     * send of #= could have lead to a GC - refetch e
@@ -2099,7 +2100,7 @@
 			    e = anElement;
 			}
 		    }
-		    RETURN (__MKSMALLINT(0));
+		    RETURN (__mkSmallInteger(0));
 		}
 
 		while (index < nIndex) {
@@ -2112,7 +2113,7 @@
 					    @symbol(=), 
 					    nil,&eq,
 					    element) == true)) {
-			    RETURN ( __MKSMALLINT(index - nInsts) );
+			    RETURN ( __mkSmallInteger(index - nInsts) );
 			}
 		    }
 		}
@@ -2127,14 +2128,14 @@
 		    unsigned int i8;
 
 		    while ((i8 = index + 8) < nIndex) {
-			if (__InstPtr(slf)->i_instvars[index] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 1) ); }
-			if (__InstPtr(slf)->i_instvars[index+1] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 2) ); }
-			if (__InstPtr(slf)->i_instvars[index+2] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 3) ); }
-			if (__InstPtr(slf)->i_instvars[index+3] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 4) ); }
-			if (__InstPtr(slf)->i_instvars[index+4] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 5) ); }
-			if (__InstPtr(slf)->i_instvars[index+5] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 6) ); }
-			if (__InstPtr(slf)->i_instvars[index+6] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 7) ); }
-			if (__InstPtr(slf)->i_instvars[index+7] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 8) ); }
+			if (__InstPtr(slf)->i_instvars[index] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 1) ); }
+			if (__InstPtr(slf)->i_instvars[index+1] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 2) ); }
+			if (__InstPtr(slf)->i_instvars[index+2] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 3) ); }
+			if (__InstPtr(slf)->i_instvars[index+3] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 4) ); }
+			if (__InstPtr(slf)->i_instvars[index+4] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 5) ); }
+			if (__InstPtr(slf)->i_instvars[index+5] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 6) ); }
+			if (__InstPtr(slf)->i_instvars[index+6] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 7) ); }
+			if (__InstPtr(slf)->i_instvars[index+7] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 8) ); }
 			index = i8;
 		    }
 		}
@@ -2142,12 +2143,12 @@
 
 		while (index < nIndex) {
 		    if (__InstPtr(slf)->i_instvars[index++] == nil) {
-			RETURN ( __MKSMALLINT(index - nInsts) );
+			RETURN ( __mkSmallInteger(index - nInsts) );
 		    }
 		}
 	    }
 	}
-	RETURN (__MKSMALLINT(0));
+	RETURN (__mkSmallInteger(0));
     }
 %}.
     ^ super indexOf:anElement startingAt:start
@@ -2160,8 +2161,9 @@
 
     |element|
 %{
-    REGISTER int index;
-    unsigned int lastIndex, nIndex, nInsts;
+    REGISTER INT index;
+    unsigned INT lastIndex, nIndex;
+    unsigned int nInsts;
     static struct inlineCache eq = _ILC1;
     OBJ myClass, e;
 
@@ -2191,15 +2193,15 @@
 			element = __InstPtr(self)->i_instvars[index++];
 			if (__isNonNilObject(element)) {
 			    if (element == e) {
-				RETURN ( __MKSMALLINT(index - nInsts) );
+				RETURN ( __mkSmallInteger(index - nInsts) );
 			    }
 			    if (__qClass(element) == @global(String)) {
 				if (strcmp(__stringVal(e), __stringVal(element)) == 0) {
-				    RETURN ( __MKSMALLINT(index - nInsts) );
+				    RETURN ( __mkSmallInteger(index - nInsts) );
 				}
 			    } else {
 				if ((*eq.ilc_func)(e, @symbol(=), nil,&eq, element) == true) {
-				    RETURN ( __MKSMALLINT(index - nInsts) );
+				    RETURN ( __mkSmallInteger(index - nInsts) );
 				}
 				/*
 				 * send of #= could have lead to a GC - refetch e
@@ -2208,7 +2210,7 @@
 			    }
 			}
 		    }
-		    RETURN (__MKSMALLINT(0));
+		    RETURN (__mkSmallInteger(0));
 		}
 #endif
 		if (__isSmallInteger(e)) {
@@ -2216,14 +2218,14 @@
 		    while (index < lastIndex) {
 			element = __InstPtr(self)->i_instvars[index++];
 			if (element == e) {
-			    RETURN ( __MKSMALLINT(index - nInsts) );
+			    RETURN ( __mkSmallInteger(index - nInsts) );
 			}
 			if (!__isSmallInteger(element)) {
 			    if ((*eq.ilc_func)(e,
 						@symbol(=), 
 						nil,&eq,
 						element) == true) {
-				RETURN ( __MKSMALLINT(index - nInsts) );
+				RETURN ( __mkSmallInteger(index - nInsts) );
 			    }
 			    /*
 			     * send of #= could have lead to a GC - refetch e
@@ -2231,7 +2233,7 @@
 			    e = anElement;
 			}
 		    }
-		    RETURN (__MKSMALLINT(0));
+		    RETURN (__mkSmallInteger(0));
 		}
 
 		while (index < lastIndex) {
@@ -2243,7 +2245,7 @@
 					    @symbol(=), 
 					    nil,&eq,
 					    element) == true)) {
-			    RETURN ( __MKSMALLINT(index - nInsts) );
+			    RETURN ( __mkSmallInteger(index - nInsts) );
 			}
 		    }
 		}
@@ -2258,26 +2260,26 @@
 		    unsigned int i8;
 
 		    while ((i8 = index + 8) < lastIndex) {
-			if (__InstPtr(slf)->i_instvars[index] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 1) ); }
-			if (__InstPtr(slf)->i_instvars[index+1] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 2) ); }
-			if (__InstPtr(slf)->i_instvars[index+2] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 3) ); }
-			if (__InstPtr(slf)->i_instvars[index+3] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 4) ); }
-			if (__InstPtr(slf)->i_instvars[index+4] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 5) ); }
-			if (__InstPtr(slf)->i_instvars[index+5] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 6) ); }
-			if (__InstPtr(slf)->i_instvars[index+6] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 7) ); }
-			if (__InstPtr(slf)->i_instvars[index+7] == nil) { RETURN ( __MKSMALLINT(index - nInsts + 8) ); }
+			if (__InstPtr(slf)->i_instvars[index] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 1) ); }
+			if (__InstPtr(slf)->i_instvars[index+1] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 2) ); }
+			if (__InstPtr(slf)->i_instvars[index+2] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 3) ); }
+			if (__InstPtr(slf)->i_instvars[index+3] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 4) ); }
+			if (__InstPtr(slf)->i_instvars[index+4] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 5) ); }
+			if (__InstPtr(slf)->i_instvars[index+5] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 6) ); }
+			if (__InstPtr(slf)->i_instvars[index+6] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 7) ); }
+			if (__InstPtr(slf)->i_instvars[index+7] == nil) { RETURN ( __mkSmallInteger(index - nInsts + 8) ); }
 			index = i8;
 		    }
 		}
 #endif
 		while (index < lastIndex) {
 		    if (__InstPtr(slf)->i_instvars[index++] == nil) {
-			RETURN ( __MKSMALLINT(index - nInsts) );
+			RETURN ( __mkSmallInteger(index - nInsts) );
 		    }
 		}
 	    }
 	}
-	RETURN (__MKSMALLINT(0));
+	RETURN (__mkSmallInteger(0));
     }
 %}.
     ^ super indexOf:anElement startingAt:start endingAt:stop
@@ -2498,5 +2500,5 @@
 !Array class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.137 2005-07-07 15:01:51 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Array.st,v 1.138 2005-07-08 17:15:00 cg Exp $'
 ! !