1 - Pick a mapping and stick to it. So Java boolean (actually Boolean by the time we get to the invocation) always maps to int32 with 1 = YES, 0 = NO.
Strictly, BOOL and bool (stbool.h) are both typedef'ed as signed char, I guess that is a java.lang.Byte in Java. But I figured it didn't make any difference, as the only values ever used are 0 and 1 and JNA does the magic in any case.
Just goes to show how much we depend on JNA - I'd never even looked to see what the mapping was - just assumed it would all be alright.
Hmm.. I did a quick google for boolean types, and it seems that 1 is the most common way to represent true (see for example http://en.wikipedia.org/wiki/Boolean_data_type), even though I'm sure they tought me -1 was the best representation at the university..
Same here, something about -1 allowing logical operations by arithmetic.
Given 1 is the standard in all C variants, it is a little strange that JNA would choose -1.