Merge jv
authorMerge Script
Thu, 14 Jul 2016 06:48:34 +0200
branchjv
changeset 20150 3a825b090d4e
parent 20143 c64b16f62536 (current diff)
parent 20149 3edf2e29ed0d (diff)
child 20153 15742e6c1632
Merge
Array.st
Block.st
ClassCategoryReader.st
ExternalStream.st
NoHandlerError.st
NonPositionableExternalStream.st
--- a/Array.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/Array.st	Thu Jul 14 06:48:34 2016 +0200
@@ -303,6 +303,7 @@
     "Modified: 23.4.1996 / 15:55:06 / cg"
 ! !
 
+
 !Array methodsFor:'accessing'!
 
 at:index
@@ -1629,138 +1630,138 @@
     OBJ myClass;
 
     if (
-	(__ClassInstPtr((myClass = __qClass(self)))->c_ninstvars == __mkSmallInteger(0))
+        (__ClassInstPtr((myClass = __qClass(self)))->c_ninstvars == __mkSmallInteger(0))
      && __isNonNilObject(aCollection)
-     && (((t = __qClass(aCollection)) == Array) || (t == myClass))
+     && (((t = __qClass(aCollection)) == Array) || t == ImmutableArray || (t == myClass))
      && __bothSmallInteger(start, stop)
      && __isSmallInteger(repStart)
     ) {
-	startIndex = __intVal(start) - 1;
-	if (startIndex >= 0) {
-	    nIndex = __BYTES2OBJS__(__qSize(self) - OHDR_SIZE);
-	    stopIndex = __intVal(stop) - 1;
-	    count = stopIndex - startIndex + 1;
+        startIndex = __intVal(start) - 1;
+        if (startIndex >= 0) {
+            nIndex = __BYTES2OBJS__(__qSize(self) - OHDR_SIZE);
+            stopIndex = __intVal(stop) - 1;
+            count = stopIndex - startIndex + 1;
 
-	    if ((count > 0) && (stopIndex < nIndex)) {
-		repStartIndex = __intVal(repStart) - 1;
-		if (repStartIndex >= 0) {
-		    repNIndex = __BYTES2OBJS__(__qSize(aCollection)-OHDR_SIZE);
-		    repStopIndex = repStartIndex + (stopIndex - startIndex);
-		    if (repStopIndex < repNIndex) {
-			src = &(__InstPtr(aCollection)->i_instvars[repStartIndex]);
-			dst = &(__InstPtr(self)->i_instvars[startIndex]);
-			if (aCollection == self) {
-			    /*
-			     * no need to check stores if copying
-			     * from myself
-			     */
+            if ((count > 0) && (stopIndex < nIndex)) {
+                repStartIndex = __intVal(repStart) - 1;
+                if (repStartIndex >= 0) {
+                    repNIndex = __BYTES2OBJS__(__qSize(aCollection)-OHDR_SIZE);
+                    repStopIndex = repStartIndex + (stopIndex - startIndex);
+                    if (repStopIndex < repNIndex) {
+                        src = &(__InstPtr(aCollection)->i_instvars[repStartIndex]);
+                        dst = &(__InstPtr(self)->i_instvars[startIndex]);
+                        if (aCollection == self) {
+                            /*
+                             * no need to check stores if copying
+                             * from myself
+                             */
 
-			    /*
-			     * take care of overlapping copy
-			     * do not depend on memset being smart enough
-			     * (some are not ;-)
-			     */
-			    if (src < dst) {
-				/* must do a reverse copy */
-				src += count;
-				dst += count;
-#ifdef __UNROLL_LOOPS__
-				while (count > 8) {
-				    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];
-				    dst -= 8; src -= 8;
-				    count -= 8;
-				}
-#endif
-				while (count-- > 0) {
-				    *--dst = *--src;
-				}
-				RETURN ( self );
-			    }
+                            if (src < dst) {
+                                /*
+                                 * take care of overlapping copy
+                                 * memcpy() is not smart enough by definition for overlkapping copies
+                                 * memmove() is!
+                                 */
+#if defined(FAST_MEMCPY)
+                                memmove(dst, src, __OBJS2BYTES__(count));
+#else
+                                /* must do a reverse copy */
+                                src += count;
+                                dst += count;
+# ifdef __UNROLL_LOOPS__
+                                while (count > 8) {
+                                    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];
+                                    dst -= 8; src -= 8;
+                                    count -= 8;
+                                }
+# endif // __UNROLL_LOOPS__
+                                while (count-- > 0) {
+                                    *--dst = *--src;
+                                }
+#endif // ! FAST_MEMCPY
+                                RETURN ( self );
+                            }
 #ifdef SOFTWARE_PIPELINE
-			    {
-				/*
-				 * the loop below fetches one longWord behind
-				 * this should not be a problem
-				 */
-				OBJ t1 = src[0];
-				count--;
-				if (count) {
-				    dst++; src++;
-				    do {
-					dst[-1] = t1;
-					t1 = src[0];
-					src++;
-					dst++;
-				    } while (count--);
-				} else {
-				    dst[0] = t1;
-				}
-			    }
+                            {
+                                /*
+                                 * the loop below fetches one longWord behind
+                                 * this should not be a problem
+                                 */
+                                OBJ t1 = src[0];
+                                count--;
+                                if (count) {
+                                    dst++; src++;
+                                    do {
+                                        dst[-1] = t1;
+                                        t1 = src[0];
+                                        src++;
+                                        dst++;
+                                    } while (count--);
+                                } else {
+                                    dst[0] = t1;
+                                }
+                            }
+#elif defined(bcopy4)
+                            count = __OBJS2BYTES__(count) / 4;
+                            bcopy4(src, dst, count);
+#elif defined(FAST_MEMCPY)
+                            memmove(dst, src, __OBJS2BYTES__(count));
 #else
+# if defined(__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;
+                            }
+# endif // __UNROLL_LOOPS__
+                            while (count--) {
+                                *dst++ = *src++;
+                            }
+#endif
+                        } else {    
+                            // not copying into the same object
+                            REGISTER int spc = __qSpace(self);
+#ifdef __UNROLL_LOOPS__
+                            while (count >= 8) {
+                                t = src[0]; dst[0] = t; __STORE_SPC(self, t, spc);
+                                t = src[1]; dst[1] = t; __STORE_SPC(self, t, spc);
+                                t = src[2]; dst[2] = t; __STORE_SPC(self, t, spc);
+                                t = src[3]; dst[3] = t; __STORE_SPC(self, t, spc);
+                                t = src[4]; dst[4] = t; __STORE_SPC(self, t, spc);
+                                t = src[5]; dst[5] = t; __STORE_SPC(self, t, spc);
+                                t = src[6]; dst[6] = t; __STORE_SPC(self, t, spc);
+                                t = src[7]; dst[7] = t; __STORE_SPC(self, t, spc);
+                                count -= 8; src += 8; dst += 8;
+                            }
+#endif
+                            while (count-- > 0) {
+                                *dst++ = t = *src++;
+                                __STORE_SPC(self, t, spc);
+                            }
+                        }
+                        RETURN ( self );
+                    }
+                }
+            }
 
-# ifdef bcopy4
-			    bcopy4(src, dst, count);
-# else
-#  ifdef FAST_MEMCPY
-			    memcpy(dst, src, __OBJS2BYTES__(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;
-			    }
-#   endif
-			    while (count--) {
-				*dst++ = *src++;
-			    }
-#  endif
-# endif
-#endif
-			} else {
-			    REGISTER int spc = __qSpace(self);
-#ifdef __UNROLL_LOOPS__
-			    while (count >= 8) {
-				t = src[0]; dst[0] = t; __STORE_SPC(self, t, spc);
-				t = src[1]; dst[1] = t; __STORE_SPC(self, t, spc);
-				t = src[2]; dst[2] = t; __STORE_SPC(self, t, spc);
-				t = src[3]; dst[3] = t; __STORE_SPC(self, t, spc);
-				t = src[4]; dst[4] = t; __STORE_SPC(self, t, spc);
-				t = src[5]; dst[5] = t; __STORE_SPC(self, t, spc);
-				t = src[6]; dst[6] = t; __STORE_SPC(self, t, spc);
-				t = src[7]; dst[7] = t; __STORE_SPC(self, t, spc);
-				count -= 8; src += 8; dst += 8;
-			    }
-#endif
-			    while (count-- > 0) {
-				t = *src++;
-				*dst++ = t;
-				__STORE_SPC(self, t, spc);
-			    }
-			}
-			RETURN ( self );
-		    }
-		}
-	    }
-
-	    if (count == 0) {
-		RETURN ( self );
-	    }
-	}
+            if (count == 0) {
+                RETURN ( self );
+            }
+        }
     }
 %}.
     ^ super replaceFrom:start to:stop with:aCollection startingAt:repStart
--- a/Block.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/Block.st	Thu Jul 14 06:48:34 2016 +0200
@@ -531,7 +531,7 @@
      If an error is raised, return the value from handlerBlock.
      The handlerBlock may take 0,1 or 2 args.
      (1 arg  -> the exception;
-      2 args -> the errorString and the erronous receiver)"
+      2 args -> the errorString and the erroneous receiver)"
 
     |numArgs|
 
--- a/ClassCategoryReader.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/ClassCategoryReader.st	Thu Jul 14 06:48:34 2016 +0200
@@ -208,7 +208,7 @@
      errors and notifications are passed to requestor.
      If passChunk is true, chunks are given to the requestor,
      via a #source: message, allowing it to open a view showing any
-     erronous source code.
+     erroneous source code.
      If oneChunkOnly is true, the fileIn is finished after the first chunk."
 
     ^ self
@@ -227,7 +227,7 @@
      errors and notifications are passed to requestor.
      If passChunk is true, chunks are given to the requestor,
      via a #source: message, allowing it to open a view showing any
-     erronous source code.
+     erroneous source code.
      If oneChunkOnly is true, the fileIn is finished after the first chunk.
      The beSilent argument controls output to the transcript, if its true or
      false. If its nil, output is controlled by the Smalltalk>>silenLoading setting."
--- a/ExternalStream.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/ExternalStream.st	Thu Jul 14 06:48:34 2016 +0200
@@ -2190,6 +2190,7 @@
 !
 
 useCRLF:aBoolean
+    <resource: #obsolete>
     "turn on or off CRLF sending (instead of LF only) - default is off.
      This method is provided for backward compatibility - see #eolMode:
      which offers another choice."
--- a/NoHandlerError.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/NoHandlerError.st	Thu Jul 14 06:48:34 2016 +0200
@@ -11,6 +11,8 @@
 "
 "{ Package: 'stx:libbasic' }"
 
+"{ NameSpace: Smalltalk }"
+
 GenericException subclass:#NoHandlerError
 	instanceVariableNames:''
 	classVariableNames:'EmergencyHandler'
@@ -44,21 +46,19 @@
     The parameter is the unhandled exception.
 
     [Class variables:]
-	EmergencyHandler <Block>    this block is evaluated, if no handler was defined
-				    for a signal (i.e. this one is responsible for the
-				    unhandled exception debugger).
-				    Having this being a block allows to globally catch
-				    these errors - even when no enclosing handler-scope
-				    around the erronous code exists.
-				    (as the catch/through does).
+        EmergencyHandler <Block>    this block is evaluated, if no handler was defined
+                                    for a signal (i.e. this one is responsible for the
+                                    unhandled exception debugger).
+                                    Having this being a block allows to globally catch
+                                    these errors - even when no enclosing handler-scope
+                                    around the erroneous code exists.
+                                    (as the catch/through does).
 
 
     [see also:]
-	GenericException
-	(``Exception handling and signals'': programming/exceptions.html)
+        GenericException
+        (``Exception handling and signals'': programming/exceptions.html)
 "
-
-
 !
 
 examples
@@ -579,11 +579,11 @@
 !NoHandlerError class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/NoHandlerError.st,v 1.24 2014-06-10 10:14:35 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/NoHandlerError.st,v 1.24 2014-06-10 10:14:35 cg Exp $'
+    ^ '$Header$'
 ! !
 
 
--- a/NonPositionableExternalStream.st	Wed Jul 13 07:01:16 2016 +0200
+++ b/NonPositionableExternalStream.st	Thu Jul 14 06:48:34 2016 +0200
@@ -597,7 +597,7 @@
         wasBinary := binary.            "temporarily set to text mode"
         binary := false.
         available timesRepeat:[
-            char := super next.         "we know that there is data"
+            char := super nextOrNil.         "don't wait - we know that there is data"
             char == Character cr ifTrue:[
                 (answerStream size ~~ 0 and:[answerStream last == Character return]) ifTrue:[
                     answerStream backStep.
@@ -605,7 +605,9 @@
                 binary := wasBinary.
                 ^ answerStream contents.
             ].
-            answerStream nextPut:char.
+            char notNil ifTrue:[    
+                answerStream nextPut:char.
+            ].
         ].
         binary := wasBinary.            "restore saved mode"