extern "C" void Java_org_orx_lib_OrxActivity_nativeOnTouch( JNIEnv* env, jobject thiz, jint touch_device_id_in, jint pointer_finger_id_in, jint action, jfloat x, jfloat y, jfloat p)
any idea on how to fix this?
> any idea on how to fix this?
What precisely is your problem?
(I'm probably not going to be able to help since I rarely do fp math,
but I'm trying to understand the problem).
Jeff
The problem is when the Java code call this method, all float arguments are 0.0f, which of-course was not the case before hard-float.I bet that the VM doesnt expect the the function to accept float arguments in floats registers, and push them in integers registers.
On Fri, Nov 22, 2013 at 8:42 PM, Jeffrey Walton <nolo...@gmail.com> wrote:
Sorry to go offlist.What precisely is your problem?
> any idea on how to fix this?
(I'm probably not going to be able to help since I rarely do fp math,
but I'm trying to understand the problem).
Jeff
On Fri, Nov 22, 2013 at 2:33 PM, Philippe Simons
<simons....@gmail.com> wrote:
> I rebuilt my shared library with -mhard-float, everything is working fine
> except on thing.
>
> I have a C callback in JNI which pass jfloat arguments, and since compiled
> with hard-float, floats arguments are 0.0f.
>
> Here is the signature.
>
> extern "C" void Java_org_orx_lib_OrxActivity_nativeOnTouch(
> JNIEnv* env, jobject thiz,
> jint touch_device_id_in, jint
> pointer_finger_id_in,
> jint action, jfloat x, jfloat y, jfloat
> p)
>
>
> any idea on how to fix this?
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.
Ok, how to specify specific CFLAGS for a single file?
On Fri, Nov 22, 2013 at 8:47 PM, Philippe Simons <simons....@gmail.com> wrote:
The problem is when the Java code call this method, all float arguments are 0.0f, which of-course was not the case before hard-float.I bet that the VM doesnt expect the the function to accept float arguments in floats registers, and push them in integers registers.Exactly, all native functions called from the VM through the JNI layer that pass floats during the call need to be compiled with -mfpu=softfp.
--
__attribute__((pcs("aapcs"))) is to tell to the compiler how a function expect to receive its arguments, not how to compile it.
so it's useful when you compile a module using hard-float and calling a method compiled in soft-float.