Name: cl74495 Date: 07/26/2000
JavaValue is defined in globalDefinitions.hpp as
class JavaValue {
public:
BasicType _type;
union {
jboolean b;
jbyte x;
jchar c;
jfloat f;
jdouble d;
jshort s;
jint i;
jlong l;
jobject h;
} _value;
If you try to code a call from C++ to a Java method with result type
boolean, you have to do it like this:
JavaValue result(T_BOOLEAN);
....
JavaCalls::call_static(&result, ..... );
...
bool cResult = result._value.i ;
result._value.b will always be zero on sparc because the elements of
the union align differently on sparc than on Intel.
You might want to omit the unusable elements of the union and
define accessor methods instead.
(Review ID: 107227)
======================================================================