This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
On Monday 29 January 2007 19:15, Andrew Haley wrote:Andrew Haley writes: > Marco Trudel writes:
> > [...] > > private static native void nativePrintBoolean(boolean b); > > private static native void nativePrintBooleanAsInt(boolean b); > > } > > > > Now this c code: > > > > #include <jni.h> > > > > JNIEXPORT void JNICALL Java_NativeBooleanTest_nativePrintBoolean > > (JNIEnv *env, jclass c, jboolean b) > > { > > printf("nativePrintBoolean: %d\n", b); > > } > > > > JNIEXPORT void JNICALL Java_NativeBooleanTest_nativePrintBooleanAsInt > > (JNIEnv *env, jclass c, jint b) > > { > > printf("nativePrintBooleanAsInt: %d\n", b); > > } > > > > [...]
Err, *why* are you doing this weird thing, anyway? Why not pass the correct type?
Quite. javah or equivalent will generate a function prototype for nativeBooleanPrintAsInt() with 'jboolean b', not 'jint b'. Changing the type of a parameter and expecting the results to remain the same is, well, excessively optimistic.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |