Fix for result of static analysis.
authorKIM JungYong <jyong2.kim@samsung.com>
Fri, 9 Sep 2016 04:21:04 +0000 (13:21 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 12 Sep 2016 01:50:11 +0000 (01:50 +0000)
Pointer value casting is fixed for valid size.
If statement is fixed.

Change-Id: I4e6304769c683f78caca8eea4f4dc1da5c369a59
Signed-off-by: KIM JungYong <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11619
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
service/notification/src/consumer/NSConsumerDiscovery.c
service/notification/unittest/NSProviderSimulator.h

index 98951b3..44c6a19 100644 (file)
@@ -211,7 +211,7 @@ NSProvider_internal * NSGetProvider(OCClientResponse * clientResponse)
     char * syncUri = NULL;
     char * topicUri = NULL;
     bool bAccepter = 0;
-    int16_t iAccepter = 0;
+    int64_t iAccepter = 0;
     NSProviderConnectionInfo * connection = NULL;
 
     NS_LOG(DEBUG, "get information of accepter");
@@ -222,7 +222,7 @@ NSProvider_internal * NSGetProvider(OCClientResponse * clientResponse)
     }
     else if (accepterType == OCREP_PROP_INT)
     {
-        getResult = OCRepPayloadGetPropInt(payload, NS_ATTRIBUTE_POLICY, (int64_t*) & iAccepter);
+        getResult = OCRepPayloadGetPropInt(payload, NS_ATTRIBUTE_POLICY, & iAccepter);
     }
     NS_VERIFY_NOT_NULL(getResult == true ? (void *) 1 : NULL, NULL);
 
index bdc44e3..953e58d 100644 (file)
@@ -176,7 +176,7 @@ private:
                 return response;
             }
 
-            else if (request == "POST" && type == requestType::NS_SYNC)
+            else if (request == "POST")
             {
                 if (type == requestType::NS_SYNC)
                 {