From: George Nash Date: Thu, 13 Jul 2017 22:29:30 +0000 (-0700) Subject: java: cleanup build warnings X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fc4eb4824791d4a854c8c6e0da4cc7a383abf5d;p=platform%2Fupstream%2Fiotivity.git java: cleanup build warnings 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/21433 Tested-by: jenkins-iotivity Reviewed-by: Larry Sachs Reviewed-by: Rick Bell (cherry picked from commit e25cf3641d3cdff26054a06c95d7f6ad5ab35c54) Reviewed-on: https://gerrit.iotivity.org/gerrit/21503 --- diff --git a/java/jni/JniCaInterface.c b/java/jni/JniCaInterface.c index a5d39f9..3cfcbc3 100644 --- a/java/jni/JniCaInterface.c +++ b/java/jni/JniCaInterface.c @@ -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); } diff --git a/java/jni/JniOcPresenceHandle.cpp b/java/jni/JniOcPresenceHandle.cpp index 42dd4d7..2a6725a 100644 --- a/java/jni/JniOcPresenceHandle.cpp +++ b/java/jni/JniOcPresenceHandle.cpp @@ -25,12 +25,12 @@ 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) { } diff --git a/java/jni/JniOcProvisioning.cpp b/java/jni/JniOcProvisioning.cpp index 151a3f1..d8f037c 100644 --- a/java/jni/JniOcProvisioning.cpp +++ b/java/jni/JniOcProvisioning.cpp @@ -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*/ diff --git a/java/jni/JniSecureUtils.cpp b/java/jni/JniSecureUtils.cpp index 0e12dce..99b643f 100644 --- a/java/jni/JniSecureUtils.cpp +++ b/java/jni/JniSecureUtils.cpp @@ -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();