--- a/ShortFloat.st Sat Aug 31 10:16:30 2019 +0200
+++ b/ShortFloat.st Sat Aug 31 10:16:42 2019 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
"
COPYRIGHT (c) 1996 by Claus Gittinger
All Rights Reserved
@@ -1652,6 +1654,8 @@
!
printfPrintString:formatString
+ <unsave>
+
"non-standard: return a printed representation of the receiver
as specified by formatString, which is defined by printf.
@@ -1660,35 +1664,38 @@
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.
+
+ WARNING: 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."
-%{ /* STACK: 400 */
+%{ /* STACK: 8000 */
+#ifndef __SCHTEAM__
char buffer[256];
OBJ s;
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), __shortFloatVal(self));
-
- __END_PROTECT_REGISTERS__
-
- if (len < 0) goto fail;
- if (len >= sizeof(buffer)) 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), __shortFloatVal(self));
+
+ __END_PROTECT_REGISTERS__
+
+ if (len < 0) goto fail;
+ if (len >= sizeof(buffer)) goto fail;
+
+ s = __MKSTRING_L(buffer, len);
+ if (s != nil) {
+ RETURN (s);
+ }
}
fail: ;
+#endif /* not __SCHTEAM__ */
%}.
^ super printfPrintString:formatString