aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natDouble.cc
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2006-02-08 18:06:11 +0000
committerTom Tromey <tromey@gcc.gnu.org>2006-02-08 18:06:11 +0000
commit855dd2bcff9e32e053bf66e336405ded26e9c927 (patch)
tree9a1df881ae846a312ad5ddcb0929d04574b40956 /libjava/java/lang/natDouble.cc
parent59c02d8a613e46512e852d54ab2ff9209f47acc7 (diff)
downloadgcc-855dd2bcff9e32e053bf66e336405ded26e9c927.zip
gcc-855dd2bcff9e32e053bf66e336405ded26e9c927.tar.gz
gcc-855dd2bcff9e32e053bf66e336405ded26e9c927.tar.bz2
re PR java/22578 (should inline floatToIntBits et al)
gcc/java PR java/22578: * check-init.c (check_init): Handle VIEW_CONVERT_EXPR. * builtins.c (convert_real): New function. (java_builtins): Handle Float.intBitsToFloat, Float.floatToRawIntBits, Double.longBitsToDouble, Double.doubleToRawLongBits. libjava PR java/22578: * gcj/javaprims.h: Updated. * sources.am, Makefile.in: Rebuilt. * java/lang/natDouble.cc (doubleToLongBits): Moved to VMDouble. (doubleToRawLongBits): Likewise. (longBitsToDouble): Likewise. (toString): Likewise. (parseDouble): Likewise. * java/lang/natFloat.cc (floatToIntBits): Moved to VMFloat. (floatToRawIntBits): Likewise. (intBitsToFloat): Likewise. * java/lang/VMDouble.java: New file. * java/lang/VMFloat.java: New file. * java/lang/Float.java, java/lang/Double.java: Removed. From-SVN: r110759
Diffstat (limited to 'libjava/java/lang/natDouble.cc')
-rw-r--r--libjava/java/lang/natDouble.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc
index 24dad8a..1a33a57 100644
--- a/libjava/java/lang/natDouble.cc
+++ b/libjava/java/lang/natDouble.cc
@@ -1,4 +1,4 @@
-// natDouble.cc - Implementation of java.lang.Double native methods.
+// natDouble.cc - Implementation of java.lang.VMDouble native methods.
/* Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006 Free Software Foundation
@@ -15,6 +15,7 @@ details. */
#include <gcj/cni.h>
#include <java/lang/String.h>
#include <java/lang/Double.h>
+#include <java/lang/VMDouble.h>
#include <java/lang/Character.h>
#include <java/lang/NumberFormatException.h>
#include <jvm.h>
@@ -31,7 +32,7 @@ union u
};
jlong
-java::lang::Double::doubleToLongBits(jdouble value)
+java::lang::VMDouble::doubleToLongBits(jdouble value)
{
union u u;
u.d = value;
@@ -46,7 +47,7 @@ java::lang::Double::doubleToLongBits(jdouble value)
}
jlong
-java::lang::Double::doubleToRawLongBits(jdouble value)
+java::lang::VMDouble::doubleToRawLongBits(jdouble value)
{
union u u;
u.d = value;
@@ -54,7 +55,7 @@ java::lang::Double::doubleToRawLongBits(jdouble value)
}
jdouble
-java::lang::Double::longBitsToDouble(jlong bits)
+java::lang::VMDouble::longBitsToDouble(jlong bits)
{
union u u;
u.l = bits;
@@ -62,15 +63,15 @@ java::lang::Double::longBitsToDouble(jlong bits)
}
jstring
-java::lang::Double::toString(jdouble value, jboolean isFloat)
+java::lang::VMDouble::toString(jdouble value, jboolean isFloat)
{
- if (isNaN (value))
+ if (Double::isNaN (value))
return JvNewStringLatin1 ("NaN", sizeof ("NaN") - 1);
- if (value == POSITIVE_INFINITY)
+ if (value == Double::POSITIVE_INFINITY)
return JvNewStringLatin1 ("Infinity", sizeof ("Infinity") - 1);
- if (value == NEGATIVE_INFINITY)
+ if (value == Double::NEGATIVE_INFINITY)
return JvNewStringLatin1 ("-Infinity", sizeof ("-Infinity") - 1);
char buffer[50], result[50];
@@ -158,7 +159,7 @@ java::lang::Double::toString(jdouble value, jboolean isFloat)
}
jdouble
-java::lang::Double::parseDouble(jstring str)
+java::lang::VMDouble::parseDouble(jstring str)
{
int length = str->length();
@@ -194,11 +195,11 @@ java::lang::Double::parseDouble(jstring str)
{
if (! strcmp (data, "NaN") || ! strcmp (data, "+NaN")
|| ! strcmp (data, "-NaN"))
- return NaN;
+ return Double::NaN;
else if (! strcmp (data, "Infinity") || ! strcmp (data, "+Infinity"))
- return POSITIVE_INFINITY;
+ return Double::POSITIVE_INFINITY;
else if (! strcmp (data, "-Infinity"))
- return NEGATIVE_INFINITY;
+ return Double::NEGATIVE_INFINITY;
}
struct _Jv_reent reent;