jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment.

* jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment.
	(array_from_valist): Correctly handle promotion for jint, jlong,
	jfloat, and jdouble.

From-SVN: r58476
This commit is contained in:
Tom Tromey 2002-10-23 23:19:55 +00:00 committed by Tom Tromey
parent 6ddbb7ebba
commit b0af98d793
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2002-10-23 Tom Tromey <tromey@redhat.com>
* jni.cc (_Jv_JNI_AllocObject): Removed old FIXME comment.
(array_from_valist): Correctly handle promotion for jint, jlong,
jfloat, and jdouble.
2002-10-23 Ranjit Mathew <rmathew@hotmail.com>
* java/io/natFileWin32.cc (attr): Use FindFirstFile( ) instead of

View File

@ -600,10 +600,7 @@ _Jv_JNI_AllocObject (JNIEnv *env, jclass clazz)
if (clazz->isInterface() || Modifier::isAbstract(clazz->getModifiers()))
env->ex = new java::lang::InstantiationException ();
else
{
// FIXME: will this work for String?
obj = JvAllocObject (clazz);
}
obj = JvAllocObject (clazz);
}
catch (jthrowable t)
{
@ -694,18 +691,21 @@ array_from_valist (jvalue *values, JArray<jclass> *arg_types, va_list vargs)
jclass *arg_elts = elements (arg_types);
for (int i = 0; i < arg_types->length; ++i)
{
// Here we assume that sizeof(int) >= sizeof(jint), because we
// use `int' when decoding the varargs. Likewise for
// long/jlong, float, and double.
if (arg_elts[i] == JvPrimClass (byte))
values[i].b = (jbyte) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (short))
values[i].s = (jshort) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (int))
values[i].i = va_arg (vargs, jint);
values[i].i = (jint) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (long))
values[i].j = va_arg (vargs, jlong);
values[i].j = (jlong) va_arg (vargs, long);
else if (arg_elts[i] == JvPrimClass (float))
values[i].f = va_arg (vargs, jfloat);
values[i].f = (jfloat) va_arg (vargs, double);
else if (arg_elts[i] == JvPrimClass (double))
values[i].d = va_arg (vargs, jdouble);
values[i].d = (jdouble) va_arg (vargs, double);
else if (arg_elts[i] == JvPrimClass (boolean))
values[i].z = (jboolean) va_arg (vargs, int);
else if (arg_elts[i] == JvPrimClass (char))