java: cleanup build warnings
authorGeorge Nash <george.nash@intel.com>
Thu, 13 Jul 2017 22:29:30 +0000 (15:29 -0700)
committerRick Bell <richard.s.bell@intel.com>
Tue, 18 Jul 2017 18:34:35 +0000 (18:34 +0000)
Thss commit cleans up the following build warnings:
 - warning incompatible-pointer-types from JniCaInterface.c
 - warning missing-field-initializers from JniCaInterface.c
 - warning reorder from JniOcPresenceHandle.cpp
 - warning unused-variable from JniOcProvisioning.cpp
 - warning unused-but-set-variable JniSecureUtils.cpp

Change-Id: I80c0df6effdff4ea089a15b53f16588c14853077
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21433
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit e25cf3641d3cdff26054a06c95d7f6ad5ab35c54)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21503

java/jni/JniCaInterface.c
java/jni/JniOcPresenceHandle.cpp
java/jni/JniOcProvisioning.cpp
java/jni/JniSecureUtils.cpp

index a5d39f9..3cfcbc3 100644 (file)
@@ -99,7 +99,7 @@ void CAManagerConnectionStateChangedCB(const CAEndpoint_t *info,
     if (JNI_OK != res)
     {
         LOGI("AttachCurrentThread will be called for JNIEnv pointer");
-        res = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
+        res = (*g_jvm)->AttachCurrentThread(g_jvm, (void**) &env, NULL);
 
         if (JNI_OK != res)
         {
@@ -168,7 +168,7 @@ void CAManagerAdapterStateChangedCB(CATransportAdapter_t adapter, bool enabled)
     if (JNI_OK != res)
     {
         LOGI("AttachCurrentThread will be called for JNIEnv pointer");
-        res = (*g_jvm)->AttachCurrentThread(g_jvm, &env, NULL);
+        res = (*g_jvm)->AttachCurrentThread(g_jvm, (void**) &env, NULL);
 
         if (JNI_OK != res)
         {
@@ -446,7 +446,7 @@ Java_org_iotivity_ca_CaInterface_setBTConfigureImpl(JNIEnv *env, jclass clazz, j
     LOGI("setConfigureImpl");
     (void)env;
     (void)clazz;
-    CAUtilConfig_t configs = {(CATransportBTFlags_t)flag};
+    CAUtilConfig_t configs = {(CATransportBTFlags_t)flag, CA_USER_PREF_CLOUD};
     CAUtilSetBTConfigure(configs);
 }
 
index 42dd4d7..2a6725a 100644 (file)
 using namespace OC::OCPlatform;
 
 JniOcPresenceHandle::JniOcPresenceHandle(JniOnPresenceListener* jniListener, OCPresenceHandle presenceHandle)
-    : m_jniListener(jniListener), m_presenceHandle(presenceHandle), m_jniObserveListener(nullptr)
+    : m_jniListener(jniListener), m_jniObserveListener(nullptr), m_presenceHandle(presenceHandle)
 {
 }
 
 JniOcPresenceHandle::JniOcPresenceHandle(JniOnObserveListener* jniListener, OCPresenceHandle presenceHandle)
-    : m_jniObserveListener(jniListener), m_presenceHandle(presenceHandle), m_jniListener(nullptr)
+    : m_jniListener(nullptr), m_jniObserveListener(jniListener), m_presenceHandle(presenceHandle)
 {
 }
 
index 151a3f1..d8f037c 100644 (file)
@@ -108,7 +108,6 @@ JNIEXPORT void JNICALL Java_org_iotivity_base_OcProvisioning_ownershipTransferCB
 
     try
     {
-        OTMCallbackData_t CBData = {0};
         if (OIC_JUST_WORKS == (OicSecOxm_t)OxmType)
         {
             /*NO callback required for JUST_WORKS*/
index 0e12dce..99b643f 100644 (file)
@@ -111,10 +111,9 @@ std::string JniSecureUtils::convertUUIDtoStr(OicUuid_t uuid)
     std::ostringstream deviceId("");
     char base64Buff[B64ENCODE_OUT_SAFESIZE(sizeof(((OicUuid_t*)0)->id)) + 1] = {0,};
     size_t outLen = 0;
-    B64Result b64Ret = B64_OK;
 
-    b64Ret = b64Encode(uuid.id, sizeof(uuid.id), base64Buff,
-            sizeof(base64Buff), &outLen);
+    b64Encode(uuid.id, sizeof(uuid.id), base64Buff,
+              sizeof(base64Buff), &outLen);
 
     deviceId << base64Buff;
     return deviceId.str();