Robert Schuster wrote:
These macros look strange to me. What do our JNI experts say?
+/* FIXME: This can't be right. Need converter macros */
+#define CONVERT_JINT_TO_INT(x) ((int)(x & 0xFFFFFFFF))
+#define CONVERT_INT_TO_JINT(x) ((int)(x & 0xFFFFFFFF))
+
+/* FIXME: This can't be right. Need converter macros. */
+#define CONVERT_SSIZE_T_TO_JINT(x) ((jint)(x & 0xFFFFFFFF))
+#define CONVERT_JINT_TO_SSIZE_T(x) (x)
I'm not a JNI expert, but these macros are not necessary.
Just use C typecasts: (jint)foo, (int)foo, (size_t)foo, etc.
(or, just leave them out .. because it's C they're implicit :-)
The right thing will happen.
-Archie