fixed warning for Android build
authorjihwan.seo <jihwan.seo@samsung.com>
Thu, 18 Aug 2016 05:33:55 +0000 (14:33 +0900)
committerJon A. Cruz <jon@joncruz.org>
Thu, 25 Aug 2016 22:05:41 +0000 (22:05 +0000)
Change-Id: I9e992a42f275dd6f36e43a0eb98a32688c686ba9
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/10577
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: Ziran Sun <ziran.sun@samsung.com>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
android/android_api/base/jni/JniOcStack.cpp
android/android_api/base/jni/JniOnDPDevicesFoundListener.cpp
android/android_api/base/jni/JniOnResourceFoundListener.cpp
resource/csdk/stack/src/ocstack.c
resource/src/InProcClientWrapper.cpp

index ff0ceef..c33e2d5 100644 (file)
@@ -593,7 +593,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved)
 JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
 {
     LOGI("JNI_OnUnload");
-    JNIEnv* env;
+    JNIEnv* env = nullptr;
 
     if (vm->GetEnv((void **)&env, JNI_CURRENT_VERSION) != JNI_OK)
     {
index 13db923..a0ffd05 100644 (file)
@@ -94,7 +94,7 @@ JniOnDPDevicesFoundListener::~JniOnDPDevicesFoundListener()
 
 void JniOnDPDevicesFoundListener::directPairingDevicesCallback(PairedDevices paringDevicesList, DPFunc func)
 {
-    jint ret;
+    jint ret = JNI_ERR;
     JNIEnv *env = GetJNIEnv(ret);
     if (nullptr == env)
     {
index d5b3a36..eb9f9d9 100644 (file)
@@ -130,7 +130,7 @@ void JniOnResourceFoundListener::foundResourceCallback(std::shared_ptr<OC::OCRes
 void JniOnResourceFoundListener::findResourceErrorCallback(const std::string& uri, const int eCode)
 {
     LOGI("findResource error callback value : %d", eCode);
-    jint ret;
+    jint ret = JNI_ERR;
     JNIEnv *env = GetJNIEnv(ret);
     if (nullptr == env)
     {
index 1804050..2ec4e89 100644 (file)
@@ -1518,8 +1518,6 @@ void OCHandleResponse(const CAEndpoint_t* endPoint, const CAResponseInfo_t* resp
 
         return;
     }
-
-    OIC_LOG(INFO, TAG, "Exit OCHandleResponse");
 }
 
 void HandleCAResponses(const CAEndpoint_t* endPoint, const CAResponseInfo_t* responseInfo)
index 4436956..da86f83 100644 (file)
@@ -165,7 +165,8 @@ namespace OC
             return OC_STACK_KEEP_TRANSACTION;
         }
 
-        try{
+        try
+        {
             ListenOCContainer container(clientWrapper, clientResponse->devAddr,
                                     reinterpret_cast<OCDiscoveryPayload*>(clientResponse->payload));
             // loop to ensure valid construction of all resources
@@ -176,7 +177,8 @@ namespace OC
                 exec.detach();
             }
         }
-        catch (std::exception &e){
+        catch (std::exception &e)
+        {
             oclog() << "Exception in listCallback, ignoring response: "
                     << e.what() << std::flush;
         }
@@ -358,7 +360,8 @@ namespace OC
             return OC_STACK_DELETE_TRANSACTION;
         }
 
-        try{
+        try
+        {
             ListenOCContainer container(clientWrapper, clientResponse->devAddr,
                                         (OCRepPayload *) clientResponse->payload);
 
@@ -370,7 +373,8 @@ namespace OC
                 exec.detach();
             }
         }
-        catch (std::exception &e){
+        catch (std::exception &e)
+        {
             oclog() << "Exception in listCallback, ignoring response: "
                     << e.what() << std::flush;
         }
@@ -565,7 +569,8 @@ namespace OC
             return OC_STACK_DELETE_TRANSACTION;
         }
 
-        try{
+        try
+        {
             if (OC_STACK_OK               == result ||
                 OC_STACK_RESOURCE_CREATED == result)
             {
@@ -583,7 +588,8 @@ namespace OC
                 exec.detach();
             }
         }
-        catch (std::exception &e){
+        catch (std::exception &e)
+        {
             oclog() << "Exception in createMQTopicCallback, ignoring response: "
                     << e.what() << std::flush;
         }