Fix compilation issue in the security stack
authorHabib Virji <habib.virji@samsung.com>
Thu, 6 Oct 2016 10:41:18 +0000 (11:41 +0100)
committerRandeep Singh <randeep.s@samsung.com>
Fri, 7 Oct 2016 04:26:56 +0000 (04:26 +0000)
- Some variable were left unused.
- ifdef was
- size_t being print with %d

Change-Id: I22524cd67a9cc4e1b8cd7844c2d81903b8084985
Signed-off-by: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/12885
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Ashwini Kumar <k.ashwini@samsung.com>
Reviewed-by: Randeep Singh <randeep.s@samsung.com>
resource/csdk/security/src/credresource.c
resource/csdk/security/src/doxmresource.c

index 1b27b84..1c31203 100644 (file)
@@ -159,7 +159,7 @@ size_t GetCredKeyDataSize(const OicSecCred_t* cred)
 #endif
         }
     }
-    OIC_LOG_V(DEBUG, TAG, "Cred Key Data Size : %d\n", size);
+    OIC_LOG_V(DEBUG, TAG, "Cred Key Data Size : %zd\n", size);
     return size;
 }
 
@@ -1636,7 +1636,6 @@ static OCEntityHandlerResult HandleGetRequest (const OCEntityHandlerRequest * eh
 
     const OicSecCred_t *cred = gCred;
 
-    size_t credCnt = 0;
     // This added '256' is arbitrary value that is added to cover the name of the resource, map addition and ending
     size = GetCredKeyDataSize(cred);
     size += (256 * OicSecCredCount(cred));
@@ -2079,7 +2078,6 @@ OCStackResult SetCredRownerId(const OicUuid_t* newROwner)
         memcpy(prevId.id, gCred->rownerID.id, sizeof(prevId.id));
         memcpy(gCred->rownerID.id, newROwner->id, sizeof(newROwner->id));
 
-        size_t credCnt = 0;
         // This added '256' is arbitrary value that is added to cover the name of the resource, map addition and ending
         size = GetCredKeyDataSize(gCred);
         size += (256 * OicSecCredCount(gCred));
index 75a726c..2227500 100644 (file)
@@ -1210,7 +1210,7 @@ OCStackResult SetDoxmDeviceID(const OicUuid_t *deviceID)
 
     //Check the device's OTM state
 
-#ifdef __WITH_DTLS__}
+#ifdef __WITH_DTLS__
     //for normal device.
     if(true == gDoxm->owned)
     {