Remove build warnings 93/20093/4
authorJaewook Jung <jw0213.jung@samsung.com>
Fri, 19 May 2017 05:56:49 +0000 (14:56 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Sat, 20 May 2017 10:11:14 +0000 (10:11 +0000)
 - fix implicit declaration of function
 - remove unused codes
 - remove unused parameter warnings

Change-Id: I830f9ada169e334a566bb696dee6cf9b46c87459
Signed-off-by: Jaewook Jung <jw0213.jung@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/20093
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrclient.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrnwmonitor.c
resource/csdk/connectivity/src/bt_edr_adapter/tizen/caedrserver.c
resource/csdk/connectivity/src/ip_adapter/android/caipnwmonitor.c
resource/csdk/connectivity/src/ip_adapter/tizen/caipnwmonitor.c
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c
resource/csdk/connectivity/util/src/camanager/bt_le_manager/android/caleconnectionmanager.c
resource/csdk/stack/src/occonnectionmanager.c

index a05f0b4..a57f66a 100644 (file)
@@ -21,7 +21,9 @@
 
 #include "iotivity_config.h"
 
+#ifndef _GNU_SOURCE
 #define _GNU_SOURCE
+#endif
 
 #include <stddef.h>
 #include <stdbool.h>
index 54e0df9..1124b93 100644 (file)
@@ -160,6 +160,7 @@ void CAEDRSocketConnectionStateCallback(int result, bt_socket_connection_state_e
                                        bt_socket_connection_s *connection, void *userData)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
+    OC_UNUSED(userData);
 
     EDRDevice *device = NULL;
 
@@ -250,6 +251,7 @@ void CAEDRDeviceDiscoveryCallback(int result, bt_adapter_device_discovery_state_
                                  bt_adapter_device_discovery_info_s *discoveryInfo, void *userData)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
+    OC_UNUSED(userData);
 
     EDRDevice *device = NULL;
 
@@ -372,6 +374,8 @@ void CAEDRServiceSearchedCallback(int32_t result,
                 bt_device_sdp_info_s *sdpInfo,void *userData)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
+    OC_UNUSED(result);
+    OC_UNUSED(userData);
 
     if (NULL == sdpInfo)
     {
@@ -935,6 +939,7 @@ CAResult_t CAEDRClientDisconnect(const int32_t clientID)
 void CAEDRDataRecvCallback(bt_socket_received_data_s *data, void *userData)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
+    OC_UNUSED(userData);
 
     EDRDevice *device = NULL;
 
index c229b68..a46a5c1 100644 (file)
@@ -178,6 +178,8 @@ void CAEDRAdapterStateChangeCallback(int result, bt_adapter_state_e adapterState
                                      void *userData)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "IN");
+    OC_UNUSED(result);
+    OC_UNUSED(userData);
 
     if (BT_ADAPTER_ENABLED == adapterState)
     {
index f527f1d..3e13678 100644 (file)
@@ -115,6 +115,7 @@ CAResult_t CAEDRServerStop()
 CAResult_t CAEDRServerInitialize(ca_thread_pool_t handle)
 {
     OIC_LOG(DEBUG, EDR_ADAPTER_TAG, "CAEDRServerInitialize");
+    OC_UNUSED(handle);
     return CA_STATUS_OK;
 }
 
index 030fd31..7ee6696 100644 (file)
@@ -195,7 +195,11 @@ u_arraylist_t *CAFindInterfaceChange()
                           .msg_iov = &iov,
                           .msg_iovlen = 1 };
 
+    // We do nothing with netlink event here.
+    // Android BroadcastReceiver will work instead.
     ssize_t len = recvmsg(caglobals.ip.netlinkFd, &msg, 0);
+    OC_UNUSED(len);
+
     return NULL;
 }
 
index 60bdc4c..332b626 100644 (file)
@@ -393,6 +393,8 @@ static CAInterface_t *CANewInterfaceItem(int index, char *name, int family,
 
 void CAIPConnectionStateChangedCb(connection_type_e type, void* userData)
 {
+    OC_UNUSED(userData);
+
     switch (type)
     {
         case CONNECTION_TYPE_DISCONNECTED:
index 5de71a8..540d275 100644 (file)
@@ -609,34 +609,6 @@ static void CAAcceptConnection(CATransportFlags_t flag, CASocket_t *sock)
     }
 }
 
-#ifdef __WITH_TLS__
-static bool CAIsTlsMessage(const unsigned char* data, size_t length)
-{
-    if (NULL == data || 0 == length)
-    {
-        OIC_LOG_V(ERROR, TAG, "%s: null input param", __func__);
-        return false;
-    }
-
-    unsigned char first_byte = data[0];
-
-    //TLS Plaintext has four types: change_cipher_spec = [14], alert = [15],
-    //handshake = [16], application_data = [17] in HEX
-    const uint8_t tls_head_type[] = {0x14, 0x15, 0x16, 0x17};
-    size_t i = 0;
-
-    for (i = 0; i < sizeof(tls_head_type); i++)
-    {
-        if(tls_head_type[i] == first_byte)
-        {
-            return true;
-        }
-    }
-
-    return false;
-}
-#endif
-
 /**
  * Clean socket state data
  *
index 57b7a9c..d8a9652 100755 (executable)
@@ -248,6 +248,7 @@ static void OCAdapterStateChangedHandler(CATransportAdapter_t adapter, bool enab
 static void OCConnectionStateChangedHandler(const CAEndpoint_t *info, bool isConnected)
 {
     OIC_LOG(DEBUG, TAG, "OCConnectionStateChangedHandler");
+    OC_UNUSED(info);
 
     CAConnectUserPref_t connPrefer = CA_USER_PREF_CLOUD;
     CAResult_t ret = CAUtilCMGetConnectionUserConfig(&connPrefer);