Clean up compiler warnings
authorGeorge Nash <george.nash@intel.com>
Mon, 27 Jun 2016 16:56:01 +0000 (09:56 -0700)
committerHabib Virji <habib.virji@samsung.com>
Thu, 30 Jun 2016 13:54:57 +0000 (13:54 +0000)
ocresource.c: (-Wunused-variable)
Fix the waring by moving the tcport inside the #ifdef

amsmgr.c (-Wunused-variable)
b64Ret, outLen, and base64Buff were all local variables that were
unused. They are removed since they are unused.

amaclresource.c (-Wunused-function)
OicSecAmaclCount function is unused anywhere. Since it is unused
it is not being maintained so it was removed.

Change-Id: Ia0327aec1feb484f084b2ce0d6608738ef5f6ad9
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/8969
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Habib Virji <habib.virji@samsung.com>
resource/csdk/security/src/amaclresource.c
resource/csdk/security/src/amsmgr.c
resource/csdk/stack/src/ocresource.c

index eb2afed..372fe5a 100644 (file)
@@ -72,16 +72,6 @@ void DeleteAmaclList(OicSecAmacl_t* amacl)
     }
 }
 
-static size_t OicSecAmaclCount(const OicSecAmacl_t *secAmacl)
-{
-    size_t size = 0;
-    for (const OicSecAmacl_t *amacl = secAmacl; amacl; amacl = amacl->next)
-    {
-        size++;
-    }
-    return size;
-}
-
 OCStackResult AmaclToCBORPayload(const OicSecAmacl_t *amaclS, uint8_t **cborPayload,
                                  size_t *cborSize)
 {
index 4ead7a3..0ce3e76 100644 (file)
@@ -226,12 +226,9 @@ OCStackResult SendAclReq(PEContext_t *context, OCDevAddr *devAddr, OCConnectivit
 {
     OCStackResult ret = OC_STACK_ERROR;
     const char GET_ACE_QUERY_FMT[] = "%s?%s=%s;%s=%s";
-    char base64Buff[B64ENCODE_OUT_SAFESIZE(sizeof(((OicUuid_t*)0)->id)) + 1] = {};
-    uint32_t outLen = 0;
     char uri[MAX_URI_LENGTH + MAX_QUERY_LENGTH] = {};
     OCCallbackData cbData = {.context=NULL};
     OCDevAddr destAddr = {.adapter = OC_ADAPTER_IP};
-    B64Result b64Ret;
     char *subID = NULL;
 
     VERIFY_NON_NULL(TAG, context, ERROR);
index 1e72248..8303948 100755 (executable)
@@ -328,8 +328,8 @@ OCStackResult BuildVirtualResourceResponse(const OCResource *resourcePtr,
         securePort = devAddr->port;
     }
 
-    uint16_t tcpPort = 0;
 #ifdef TCP_ADAPTER
+    uint16_t tcpPort = 0;
     if (GetTCPPortInfo(devAddr, &tcpPort) != OC_STACK_OK)
     {
         tcpPort = 0;