fix warning caleadapter and fragmentation
authorjihwan.seo <jihwan.seo@samsung.com>
Thu, 8 Sep 2016 07:26:31 +0000 (16:26 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Mon, 12 Sep 2016 10:14:59 +0000 (10:14 +0000)
Change-Id: Ib6a83e0c59f2dde92881eb077d7575658deffbb4
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11557
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Abhishek Sharma <ce.abhishek@samsung.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/adapter_util/cafragmentation.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c

index d8efdbc..dc51dd4 100644 (file)
@@ -127,8 +127,7 @@ CAResult_t CAGenerateHeader(uint8_t *header,
 
     if (sourcePort > CA_SUPPORTED_BLE_MAX_PORT ||
         sourcePort < CA_SUPPORTED_BLE_MIN_PORT ||
-        destPort > CA_SUPPORTED_BLE_MAX_PORT ||
-        destPort < CA_BLE_MULTICAST_PORT)
+        destPort > CA_SUPPORTED_BLE_MAX_PORT)
     {
         OIC_LOG_V(ERROR, TAG, "source port(%d) or destination port(%d) is invalid number!!",
                 sourcePort, destPort);
@@ -199,7 +198,7 @@ CAResult_t CAMakeRemainDataSegment(uint8_t *dataSegment,
     const uint8_t *cur_pos = data +
         (CA_SUPPORTED_BLE_MTU_SIZE - CA_BLE_HEADER_SIZE - CA_BLE_LENGTH_HEADER_SIZE +
          (index * (CA_SUPPORTED_BLE_MTU_SIZE - CA_BLE_HEADER_SIZE)));
-    if (cur_pos == NULL)
+    if (NULL == cur_pos)
     {
         OIC_LOG(ERROR, TAG, "data is NULL");
         return CA_STATUS_FAILED;
index e459eb0..a32949e 100644 (file)
@@ -3371,7 +3371,7 @@ static void CALERemoveReceiveQueueData(u_arraylist_t *dataInfoList, const char*
     if (CA_STATUS_OK == CALEGetPortsFromSenderInfo(address, dataInfoList, portList))
     {
         uint32_t arrayLength = u_arraylist_length(portList);
-        for (int i = 0; i < arrayLength; i++)
+        for (uint32_t i = 0; i < arrayLength; i++)
         {
             uint16_t port = u_arraylist_get(portList, i);
             OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "port : %X", port);
@@ -3418,7 +3418,7 @@ static CAResult_t CALEGetPortsFromSenderInfo(const char *leAddress,
 
         if (!strncmp(info->remoteEndpoint->addr, leAddress, addrLength))
         {
-            u_arraylist_add(portList, (void *) info->remoteEndpoint->port);
+            u_arraylist_add(portList, (void *)info->remoteEndpoint->port);
         }
     }