[Top][All Lists]

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

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

From: Guilhem Lavaux
Subject: Re: NIO (Non-block & Scatter/Gather)
Date: Thu, 12 Jan 2006 21:44:56 +0100
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050322)

Archie Cobbs wrote:
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.


Hehe. You should talk a bit with Roman Kennke. :) He has interesting compilers he told me.



reply via email to

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