#OTHER by cg
authorClaus Gittinger <cg@exept.de>
Thu, 22 Jun 2017 13:57:09 +0200
changeset 21907 d0143f6eef88
parent 21906 f070c75710f1
child 21908 fcf46559bb43
#OTHER by cg comments
LongFloat.st
--- a/LongFloat.st	Thu Jun 22 13:57:08 2017 +0200
+++ b/LongFloat.st	Thu Jun 22 13:57:09 2017 +0200
@@ -1723,6 +1723,7 @@
      systems; on Linux/gnuc machines you have to give something like %LF/%LG.
      Also, the resulting string may not be longer than 255 bytes -
      since that's the (static) size of the buffer.
+     
      This method is NONSTANDARD and may be removed without notice.
      WARNNG: this goes directly to the C-printf function and may therefore me inherently unsafe.
      Please use the printf: method, which is safe as it is completely implemented in Smalltalk."
@@ -1733,27 +1734,27 @@
     int len;
 
     if (__isStringLike(formatString)) {
-	/*
-	 * actually only needed on sparc: since thisContext is
-	 * in a global register, which gets destroyed by printf,
-	 * manually save it here - very stupid ...
-	 */
-	__BEGIN_PROTECT_REGISTERS__
-
-	len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __longFloatVal(self));
-
-	__END_PROTECT_REGISTERS__
-
-	if (len < 0) goto fail;
-
-	s = __MKSTRING_L(buffer, len);
-	if (s != nil) {
-	    RETURN (s);
-	}
+        /*
+         * actually only needed on sparc: since thisContext is
+         * in a global register, which gets destroyed by printf,
+         * manually save it here - very stupid ...
+         */
+        __BEGIN_PROTECT_REGISTERS__
+
+        len = snprintf(buffer, sizeof(buffer), __stringVal(formatString), __longFloatVal(self));
+
+        __END_PROTECT_REGISTERS__
+
+        if (len < 0) goto fail;
+
+        s = __MKSTRING_L(buffer, len);
+        if (s != nil) {
+            RETURN (s);
+        }
     }
 fail: ;
 %}.
-    self primitiveFailed
+    ^ super printfPrintString:formatString
 
     "
      Float pi asLongFloat printfPrintString:'%%LG -> %LG'
@@ -1761,6 +1762,8 @@
      Float pi asLongFloat printfPrintString:'%%7.15LG -> %7.15LG'
      Float pi asLongFloat printfPrintString:'%%7.15LF -> %7.15LF'
     "
+
+    "Modified (comment): / 22-06-2017 / 13:55:53 / cg"
 !
 
 storeString