Reputation: 897
I have a jni function
native float nativeMethod(int num);
That ties to a C function
void Java_com_package_name_nativeMethod(JNIEnv * env, jobject obj, jint num)
{
unsigned int nativeUnsignedNum = num;
}
And my C code requires the use of unsigned integers. How can I make this work? Using the code above I get an error: Using 'unsigned int' for signed values of type 'jint'
. How can I pass a number ( it will always unsigned/positive ) from Java to a C method, and assign this value to an unsigned integer?
Thanks!
Upvotes: 0
Views: 3296