Fix arm64-v8a build errors 35/23235/2
authorGeorge Nash <george.nash@intel.com>
Wed, 15 Nov 2017 23:21:57 +0000 (15:21 -0800)
committerRick Bell <richard.s.bell@intel.com>
Sat, 18 Nov 2017 00:46:09 +0000 (00:46 +0000)
Change-Id: Iecff451094731616bbab6b680954e0ec333a61a3
Signed-off-by: George Nash <george.nash@intel.com>
java/jni/JniCaInterface.c
java/jni/JniOcSecureResource.cpp

index 3cfcbc3..fab1cc0 100644 (file)
@@ -99,7 +99,11 @@ void CAManagerConnectionStateChangedCB(const CAEndpoint_t *info,
     if (JNI_OK != res)
     {
         LOGI("AttachCurrentThread will be called for JNIEnv pointer");
+#ifdef __ANDROID__
+        res = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
+#else
         res = (*g_jvm)->AttachCurrentThread(g_jvm, (void**) &env, NULL);
+#endif
 
         if (JNI_OK != res)
         {
@@ -168,7 +172,11 @@ void CAManagerAdapterStateChangedCB(CATransportAdapter_t adapter, bool enabled)
     if (JNI_OK != res)
     {
         LOGI("AttachCurrentThread will be called for JNIEnv pointer");
+#ifdef __ANDROID__
+        res = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
+#else
         res = (*g_jvm)->AttachCurrentThread(g_jvm, (void**) &env, NULL);
+#endif
 
         if (JNI_OK != res)
         {
index 58cc528..e88e6f2 100644 (file)
@@ -162,7 +162,7 @@ OCStackResult JniOcSecureResource::getLinkedDevices(JNIEnv *env, UuidList_t &uui
 
 OCStackResult JniOcSecureResource::removeDevice(JNIEnv* env, jint timeout, jobject jListener)
 {
-    if (timeout > USHRT_MAX)
+    if (timeout > static_cast<jint>(USHRT_MAX))
     {
         return OC_STACK_INVALID_PARAM;
     }