ShortFloat.st
branchjv
changeset 18024 c0e669065f6d
parent 18022 f23232c2eaef
parent 14744 24c92caccacf
child 18037 4cf874da38c9
--- a/ShortFloat.st	Sun Feb 03 22:15:59 2013 +0000
+++ b/ShortFloat.st	Tue Feb 05 14:51:41 2013 +0100
@@ -21,6 +21,7 @@
 !ShortFloat primitiveDefinitions!
 %{
 
+#include <stdio.h>
 #include <errno.h>
 
 #ifndef __OPTIMIZE__
@@ -449,11 +450,6 @@
     "Modified: 23.4.1996 / 09:26:45 / cg"
 ! !
 
-!ShortFloat class methodsFor:'odbc queries'!
-
-odbcTypeSymbol
-    ^ #'SQL_FLOAT'
-! !
 
 !ShortFloat class methodsFor:'queries'!
 
@@ -1359,21 +1355,15 @@
      0.5 .. 1.0 and the floats value is mantissa * 2^exp"
 
 %{  /* NOCONTEXT */
-
-    double frexp();
     int exp;
 
-    __threadErrno = 0;
 #if defined(__i386__) && defined(__GNUC__)
     frexpf( __shortFloatVal(self), &exp);
 #else
     frexp( (double)(__shortFloatVal(self)), &exp);
 #endif
-    if (__threadErrno == 0) {
-	RETURN (__mkSmallInteger(exp));
-    }
+    RETURN (__mkSmallInteger(exp));
 %}.
-    ^ super exponent
 
     "
      4.0 asShortFloat exponent
@@ -1397,25 +1387,13 @@
     int exp;
 
 #if defined(__i386__) && defined(__GNUC__)
-    float frac;
-
-    __threadErrno = 0;
-    frac = frexpf( (double)__shortFloatVal(self), &exp);
-    if (__threadErrno == 0) {
-	RETURN (__MKSFLOAT(frac));
-    }
+    float frac = frexpf(__shortFloatVal(self), &exp);
+    RETURN (__MKSFLOAT(frac));
 #else
-    double frexp();
-    double frac;
-
-    __threadErrno = 0;
-    frac = frexp( (double)(__shortFloatVal(self)), &exp);
-    if (__threadErrno == 0) {
-	RETURN (__MKFLOAT(frac));
-    }
+    double frac = frexp( (double)(__shortFloatVal(self)), &exp);
+    RETURN (__MKFLOAT(frac));
 #endif
 %}.
-    ^ self primitiveFailed
 
     "
      1.0 asShortFloat exponent
@@ -1659,7 +1637,9 @@
 #ifdef NO_MODFF
     double dFrac, dTrunc;
 #else
+# ifndef __VISUALC__
     float modff(float, float *);
+# endif
 #endif
     float frac, trunc;
 
@@ -1863,10 +1843,10 @@
 !ShortFloat class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.118 2013-02-04 17:17:43 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.116 2013-01-29 09:54:03 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ShortFloat.st,v 1.118 2013-02-04 17:17:43 stefan Exp $'
 ! !