Fix compile warnings in SimpleClientServer for Linux
authorRavi Nanjundappa <nravi.n@samsung.com>
Tue, 30 Jun 2015 04:13:32 +0000 (09:43 +0530)
committerErich Keane <erich.keane@intel.com>
Tue, 30 Jun 2015 16:48:44 +0000 (16:48 +0000)
SimpleClientServer application for Linux was trying to check the address of array
'clientResponse->rcvdVendorSpecificHeaderOptions' which will always evaluate to 'true'.
Corrected by removing such checks in the code.

Change-Id: Id7306af0792646887740ab3c7952d5fffe8c760b
Signed-off-by: Ravi Nanjundappa <nravi.n@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1454
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/samples/linux/SimpleClientServer/occlient.cpp
resource/csdk/stack/samples/linux/SimpleClientServer/occlientbasicops.cpp

index 93689fbb8cc5630e44f8a1442ce40f22a23ec1b2..7e40e7e3f8c26aea53907c0ba5f6c2cf3a8476fe 100644 (file)
@@ -227,8 +227,7 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle, OCClientResponse
     OC_LOG_V(INFO, TAG, "SEQUENCE NUMBER: %d", clientResponse->sequenceNumber);
     OC_LOG_V(INFO, TAG, "JSON = %s =============> Get Response", clientResponse->resJSONPayload);
 
-    if(clientResponse->rcvdVendorSpecificHeaderOptions &&
-            clientResponse->numRcvdVendorSpecificHeaderOptions)
+    if(clientResponse->numRcvdVendorSpecificHeaderOptions > 0)
     {
         OC_LOG (INFO, TAG, "Received vendor specific options");
         uint8_t i = 0;
index 45af1182bfc670fb89a2eb14977b0bfc912d795e..fa59537dfff556765ca4c34435aa189633a99258 100644 (file)
@@ -172,8 +172,7 @@ OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle,
         OC_LOG_V(INFO, TAG,"Get Response: %s \nFrom %s:%d\n",
                 clientResponse->resJSONPayload, clientResponse->devAddr.addr, clientResponse->devAddr.port);
 
-        if (clientResponse->rcvdVendorSpecificHeaderOptions
-                && clientResponse->numRcvdVendorSpecificHeaderOptions)
+        if (clientResponse->numRcvdVendorSpecificHeaderOptions > 0 )
         {
             OC_LOG (INFO, TAG, "Received vendor specific options");
             uint8_t i = 0;