[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NIO (Non-block & Scatter/Gather)

From: Archie Cobbs
Subject: Re: NIO (Non-block & Scatter/Gather)
Date: Thu, 12 Jan 2006 12:09:13 -0600
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050715)

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 Cobbs      *        CTO, Awarix        *

reply via email to

[Prev in Thread] Current Thread [Next in Thread]