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 ff0ceef610497e2e750532279d8fa67b3f9cdc5e..c33e2d54718bd045bde820136b0166c9b4b1725d 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 13db923df851dc6964202173f7f2e7aa5a6ca049..a0ffd05c4d161c2d21a70afb59275dd58981d982 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 d5b3a3651da60de049da574fac3d08831b553e5f..eb9f9d9beabc3e5a4e258bc9fa2a4183ab9248b1 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 18040502c0e17f913a1fe8b7f1de99efb187ea64..2ec4e89177551dd94d078e11eac599ddb611ba75 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 44369565665640aee328d777653c2d01e1c32e44..da86f83fc207f47b1c8d3f74209d972246885a3b 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;
         }