Commit a855c499 authored by George Nash's avatar George Nash Committed by Nathan Heldt-Sheller

IOT-2539 Clean unused code warnnings

credresource.c:
Removed the [-Wunused-const-variable=] warning
The CRED_EMPTY_ROOT_MAP_SIZE was used in the past but is no longer
referenced anywhere in the code.

provisioningclient.c:
Removed the [-Wunused-const-variable=] warning
The SUPPORTED_PRMS array was used in the past but is no longer
referenced anywhere in the code.

ocserver.cpp
Removed the [-Wunused-variable] warning
Looking at the logs a instance that gDeviceUUID was used could not
be found at any point in time.

stacktest.cpp:
Removed the [-Wunused-variable] warnings
Variables peer, pinNumber, and pmSel were only used in Direct Pairing
related unit tests which were removed as part of IOT-2306.

provisioningclient.cpp:
Removed the [-Wunused-function] warning
The InputPdACL function was only used by the Direct Pairing code
that was removed as part of IOT-2306.

Bug: https://jira.iotivity.org/browse/IOT-2539
Bug: https://jira.iotivity.org/browse/IOT-2306
Change-Id: I80f52619a04ee7eafc83b79b886c1121f61a6ba1
Signed-off-by: George Nash's avatarGeorge Nash <george.nash@intel.com>
parent 4693e1f4
......@@ -98,10 +98,6 @@ static const char* ACL_PEMISN[5] = {"CREATE", "READ", "WRITE", "DELETE", "NOTIFY
static const char* SVR_DB_FILE_NAME = "oic_svr_db_client.dat";
// '_' for separaing from the same constant variable in |srmresourcestrings.c|
static const char* PRVN_DB_FILE_NAME = "oic_prvn_mng.db";
static const OicSecPrm_t SUPPORTED_PRMS[1] =
{
PRM_PRE_CONFIGURED,
};
static char* TEST_CERT_NOT_BEFORE = "20170101000000"; // Not before field for certificates, in format YYYYMMDDhhmmss
static char* TEST_CERT_NOT_AFTER = "20270101000000"; // + ten years
......
......@@ -24,7 +24,6 @@ static OicSecAcl_t acl;
static OCProvisionDev_t pDev1;
static OCProvisionDev_t pDev2;
static OicSecCredType_t credType = SYMMETRIC_PAIR_WISE_KEY;
static OCProvisionDev_t selectedDeviceInfo;
static OicSecOxm_t oicSecDoxmJustWorks = OIC_JUST_WORKS;
static OicSecOxm_t oicSecDoxmRandomPin = OIC_RANDOM_DEVICE_PIN;
static unsigned short timeout = 60;
......
......@@ -87,7 +87,6 @@ static const uint16_t CBOR_SIZE = 2048;
/** CRED size - Number of mandatory items. */
static const uint8_t CRED_ROOT_MAP_SIZE = 4;
static const uint8_t CRED_EMPTY_ROOT_MAP_SIZE = 2;
static const uint8_t CRED_MAP_SIZE = 3;
static const uint8_t ROLEID_MAP_SIZE = 1;
......
......@@ -86,7 +86,6 @@ static bool observeThreadStarted = false;
char *gResourceUri = (char *)"/a/light";
static const char *gDateOfManufacture = "2016-01-15";
static const char *gDeviceName = "myDeviceName";
static const char *gDeviceUUID = "51b55ddc-ccbb-4cb3-a57f-494eeca13a21";
static const char *gFirmwareVersion = "myFirmwareVersion";
static const char *gManufacturerName = "myName";
static const char *gOperatingSystemVersion = "myOS";
......
......@@ -74,9 +74,6 @@ namespace itst = iotivity::test;
char gDeviceUUID[] = "fe3f9a68-4931-4cb0-9ea4-81702b43116c";
char gDevicePIID[] = "32684bf3-4c44-47b0-99fe-6a9a59b73a8d";
char gManufacturerName[] = "myName";
static OCPrm_t pmSel;
static char pinNumber;
static OCDPDev_t peer;
std::chrono::seconds const SHORT_TEST_TIMEOUT = std::chrono::seconds(5);
std::chrono::seconds const LONG_TEST_TIMEOUT = std::chrono::seconds(450);
......
......@@ -624,84 +624,6 @@ static int InputCredentials(Credential &cred)
return 0;
}
static OicSecPdAcl_t* InputPdACL()
{
int ret;
char *temp_rsc, *temp_pms;
printf("******************************************************************************\n");
printf("-Set ACL policy for target DP device\n");
printf("******************************************************************************\n");
OicSecPdAcl_t *acl = (OicSecPdAcl_t *)OICCalloc(1,sizeof(OicSecPdAcl_t));
if (NULL == acl)
{
OIC_LOG(ERROR, TAG, "Error while memory allocation");
return NULL;
}
//Set Resource.
printf("Num. of Resource : ");
ret = scanf("%" PRIuPTR, &acl->resourcesLen);
if ((1 != ret) || (acl->resourcesLen <= 0 || acl->resourcesLen > 50))
{
printf("Error while input\n");
OICFree(acl);
return NULL;
}
printf("-URI of resource\n");
printf("ex)/oic/sh/temp/0 (Max_URI_Length: %d Byte )\n", MAX_URI_LENGTH);
acl->resources = (char **)OICCalloc(acl->resourcesLen, sizeof(char *));
if (NULL == acl->resources)
{
OIC_LOG(ERROR, TAG, "Error while memory allocation");
OICFree(acl);
return NULL;
}
for (size_t i = 0; i < acl->resourcesLen; i++)
{
printf("[%" PRIuPTR "]Resource : ", i + 1);
ret = scanf("%64ms", &temp_rsc);
if (1 != ret)
{
printf("Error while input\n");
OICFree(acl->resources);
OICFree(acl);
return NULL;
}
acl->resources[i] = OICStrdup(temp_rsc);
OICFree(temp_rsc);
if (NULL == acl->resources[i])
{
OIC_LOG(ERROR, TAG, "Error while memory allocation");
OICFree(acl->resources);
OICFree(acl);
return NULL;
}
}
// Set Permission
do
{
printf("-Set the permission(C,R,U,D,N)\n");
printf("ex) CRUDN, CRU_N,..(5 Charaters)\n");
printf("Permission : ");
ret = scanf("%5ms", &temp_pms);
if (1 != ret)
{
printf("Error while input\n");
OICFree(acl->resources);
OICFree(acl);
return NULL;
}
ret = CalculateAclPermission(temp_pms, &(acl->permission));
OICFree(temp_pms);
} while (0 != ret );
return acl;
}
OCStackResult displayMutualVerifNumCB(uint8_t mutualVerifNum[MUTUAL_VERIF_NUM_LEN])
{
OC_UNUSED(mutualVerifNum);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment