Commit f619dcab by Ranjit Mathew Committed by Ranjit Mathew

re PR java/19738 (gcjh generates invalid class member floating-point initialisers)

	PR java/19738
	* gjavah.c (jni_print_float): Do not emit floating-point
	initialiser for a static final field.
	(jni_print_double): Likewise.

From-SVN: r94553
parent cc95a845
2005-02-02 Ranjit Mathew <rmathew@hotmail.com>
PR java/19738
* gjavah.c (jni_print_float): Do not emit floating-point
initialiser for a static final field.
(jni_print_double): Likewise.
2005-02-01 Mark Mitchell <mark@codesourcery.com> 2005-02-01 Mark Mitchell <mark@codesourcery.com>
Revert: Revert:
......
/* Program to write C++-suitable header files from a Java(TM) .class /* Program to write C++-suitable header files from a Java(TM) .class
file. This is similar to SUN's javah. file. This is similar to SUN's javah.
Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -281,7 +281,9 @@ jni_print_float (FILE *stream, jfloat f) ...@@ -281,7 +281,9 @@ jni_print_float (FILE *stream, jfloat f)
work in data initializers. FIXME. */ work in data initializers. FIXME. */
if (JFLOAT_FINITE (f)) if (JFLOAT_FINITE (f))
{ {
fputs (flag_jni ? " " : " = ", out); if (flag_jni)
{
fputs (" ", out);
if (f.negative) if (f.negative)
putc ('-', stream); putc ('-', stream);
if (f.exponent) if (f.exponent)
...@@ -295,6 +297,7 @@ jni_print_float (FILE *stream, jfloat f) ...@@ -295,6 +297,7 @@ jni_print_float (FILE *stream, jfloat f)
((unsigned int)f.mantissa) << 1, ((unsigned int)f.mantissa) << 1,
f.exponent + 1 - JFLOAT_EXP_BIAS); f.exponent + 1 - JFLOAT_EXP_BIAS);
} }
}
if (! flag_jni) if (! flag_jni)
fputs (";\n", stream); fputs (";\n", stream);
} }
...@@ -307,7 +310,9 @@ jni_print_double (FILE *stream, jdouble f) ...@@ -307,7 +310,9 @@ jni_print_double (FILE *stream, jdouble f)
work in data initializers. FIXME. */ work in data initializers. FIXME. */
if (JDOUBLE_FINITE (f)) if (JDOUBLE_FINITE (f))
{ {
fputs (flag_jni ? " " : " = ", out); if (flag_jni)
{
fputs (" ", out);
if (f.negative) if (f.negative)
putc ('-', stream); putc ('-', stream);
if (f.exponent) if (f.exponent)
...@@ -321,6 +326,7 @@ jni_print_double (FILE *stream, jdouble f) ...@@ -321,6 +326,7 @@ jni_print_double (FILE *stream, jdouble f)
f.mantissa0, f.mantissa1, f.mantissa0, f.mantissa1,
f.exponent + 1 - JDOUBLE_EXP_BIAS); f.exponent + 1 - JDOUBLE_EXP_BIAS);
} }
}
fputs (flag_jni ? "\n" : ";\n", stream); fputs (flag_jni ? "\n" : ";\n", stream);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment