remove unnecessary code in caipserver
authorhyuna0213.jo <hyuna0213.jo@samsung.com>
Fri, 26 Jun 2015 06:14:46 +0000 (15:14 +0900)
committerErich Keane <erich.keane@intel.com>
Fri, 26 Jun 2015 16:05:06 +0000 (16:05 +0000)
- remove unnecessary error check logic
- add the global variable initialization to fix the build warning

Change-Id: I1e02103b024a4b2a61d71f6e8403117069fe4b32
Signed-off-by: hyuna0213.jo <hyuna0213.jo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1426
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/samples/android/sample_service/jni/ResourceModel.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c

index fa88631..31b4d4c 100644 (file)
@@ -43,7 +43,7 @@ CAResult_t get_remote_address(CATransportAdapter_t transportType, const char *ad
 
 CATransportAdapter_t g_selectedNwType = CA_ADAPTER_IP;
 static CAToken_t g_lastRequestToken = NULL;
-static uint8_t g_lastRequestTokenLength;
+static uint8_t g_lastRequestTokenLength = 0;
 
 static const char COAP_PREFIX[] =  "coap://";
 static const char COAPS_PREFIX[] = "coaps://";
@@ -62,11 +62,11 @@ static jobject g_responseListenerObject = NULL;
 static JavaVM *g_jvm;
 
 static CAEndpoint_t *g_clientEndpoint = NULL;
-static char *g_resourceUri;
-static CAToken_t g_clientToken;
-static uint8_t g_clientTokenLength = NULL;
+static char *g_resourceUri = NULL;
+static CAToken_t g_clientToken = NULL;
+static uint8_t g_clientTokenLength = 0;
 
-static uint16_t g_clientMsgId;
+static uint16_t g_clientMsgId = 0;
 static char *g_remoteAddress = NULL;
 
 typedef struct
index 6d28dfa..c33953c 100644 (file)
@@ -582,12 +582,6 @@ CAResult_t CAIPStartUnicastServer(const char *localAddress, uint16_t *port, bool
     VERIFY_NON_NULL(localAddress, IP_SERVER_TAG, "localAddress");
     VERIFY_NON_NULL(port, IP_SERVER_TAG, "port");
 
-    if (0 > *port)
-    {
-        OIC_LOG(ERROR, IP_SERVER_TAG, "Invalid input: port is invalid!");
-        return CA_STATUS_INVALID_PARAM;
-    }
-
     ca_mutex_lock(g_mutexServerInfoList);
     bool isUnicastServerStarted = CAIsUnicastServerStarted(g_serverInfoList, localAddress, *port);
     if (!isUnicastServerStarted)