cborFindResult = cbor_value_map_find_value(&crlCbor, OIC_CBOR_CRL_ID, &crlMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&crlMap))
{
- cborFindResult = cbor_value_get_int(&crlMap, (int *) &crl->CrlId);
+ int CrlId;
+
+ cborFindResult = cbor_value_get_int(&crlMap, &CrlId);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CrlId.");
+ crl->CrlId = (uint16_t)CrlId;
}
cborFindResult = cbor_value_map_find_value(&crlCbor, OIC_CBOR_CRL_THIS_UPDATE, &crlMap);
int i = 0;
while (cbor_value_is_valid(&oxm) && cbor_value_is_integer(&oxm))
{
- cborFindResult = cbor_value_get_int(&oxm, (int *) &doxm->oxm[i++]);
+ int tmp;
+
+ cborFindResult = cbor_value_get_int(&oxm, &tmp);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding oxmName Value")
+ doxm->oxm[i++] = (OicSecOxm_t)tmp;
cborFindResult = cbor_value_advance(&oxm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Advancing oxmName.")
}
cborFindResult = cbor_value_map_find_value(&doxmCbor, OIC_JSON_OXM_SEL_NAME, &doxmMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&doxmMap))
{
- cborFindResult = cbor_value_get_int(&doxmMap, (int *) &doxm->oxmSel);
+ int oxmSel;
+
+ cborFindResult = cbor_value_get_int(&doxmMap, &oxmSel);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Sel Name Value.")
+ doxm->oxmSel = (OicSecOxm_t)oxmSel;
}
else // PUT/POST JSON may not have oxmsel so set it to the gDoxm->oxmSel
{
cborFindResult = cbor_value_map_find_value(&doxmCbor, OIC_JSON_SUPPORTED_CRED_TYPE_NAME, &doxmMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&doxmMap))
{
- cborFindResult = cbor_value_get_int(&doxmMap, (int *) &doxm->sct);
+ int sct;
+
+ cborFindResult = cbor_value_get_int(&doxmMap, &sct);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding Sct Name Value.")
+ doxm->sct = (OicSecCredType_t)sct;
if (roParsed)
{
type = cbor_value_get_type(&dpairMap);
if (0 == strcmp(OIC_JSON_SPM_NAME, name) && cbor_value_is_integer(&dpairMap))
{
- cborFindResult = cbor_value_get_int(&dpairMap, (int *) &dpair->spm);
+ int spm;
+
+ cborFindResult = cbor_value_get_int(&dpairMap, &spm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding SPM Value");
+ dpair->spm = (OicSecPrm_t)spm;
}
if (0 == strcmp(OIC_JSON_PDEVICE_ID_NAME, name))
while (cbor_value_is_valid(&prm) && cbor_value_is_integer(&prm))
{
- cborFindResult = cbor_value_get_int(&prm, (int *)&pconf->prm[i++]);
+ int prm_val;
+
+ cborFindResult = cbor_value_get_int(&prm, &prm_val);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to get value");
+ pconf->prm[i++] = (OicSecPrm_t)prm_val;
cborFindResult = cbor_value_advance(&prm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to advance value");
}
cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_CM_NAME, &pstatMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&pstatMap))
{
- cborFindResult = cbor_value_get_int(&pstatMap, (int *) &pstat->cm);
+ int cm;
+
+ cborFindResult = cbor_value_get_int(&pstatMap, &cm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding CM.");
+ pstat->cm = (OicSecDpm_t)cm;
}
else
{
cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_TM_NAME, &pstatMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&pstatMap))
{
- cborFindResult = cbor_value_get_int(&pstatMap, (int *) &pstat->tm);
+ int tm;
+
+ cborFindResult = cbor_value_get_int(&pstatMap, &tm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding TM.");
+ pstat->tm = (OicSecDpm_t)tm;
}
else
{
cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_OM_NAME, &pstatMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&pstatMap))
{
- cborFindResult = cbor_value_get_int(&pstatMap, (int *) &pstat->om);
+ int om;
+
+ cborFindResult = cbor_value_get_int(&pstatMap, &om);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding OM.");
+ pstat->om = (OicSecDpom_t)om;
}
else
{
cborFindResult = cbor_value_map_find_value(&pstatCbor, OIC_JSON_SM_NAME, &pstatMap);
if (CborNoError == cborFindResult && cbor_value_is_integer(&pstatMap))
{
+ int sm;
+
pstat->smLen = 1;
pstat->sm = (OicSecDpom_t*)OICCalloc(pstat->smLen, sizeof(OicSecDpom_t));
- cborFindResult = cbor_value_get_int(&pstatMap, (int *) &pstat->sm[0]);
+ cborFindResult = cbor_value_get_int(&pstatMap, &sm);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed Finding SM.");
+ pstat->sm[0] = (OicSecDpom_t)sm;
if (roParsed)
{
// Service Type
if (0 == strcmp(OIC_JSON_SERVICE_TYPE, name) && cbor_value_is_integer(&svcMap))
{
- cborFindResult = cbor_value_get_int(&svcMap, (int *) &svc->svct);
+ int svct;
+
+ cborFindResult = cbor_value_get_int(&svcMap, &svct);
VERIFY_CBOR_SUCCESS(TAG, cborFindResult, "Failed to Find SVCT.");
+ svc->svct = (OicSecSvcType_t)svct;
}
// Owners -- Mandatory
while (cbor_value_is_map(&resourceMap))
{
+ int bitmap;
+
resource = (OCResourcePayload *)OICCalloc(1, sizeof(OCResourcePayload));
VERIFY_PARAM_NON_NULL(TAG, resource, "Failed allocating resource payload");
// Bitmap
err = cbor_value_map_find_value(&policyMap, OC_RSRVD_BITMAP, &curVal);
VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap tag");
- err = cbor_value_get_int(&curVal, (int *)&resource->bitmap);
+ err = cbor_value_get_int(&curVal, &bitmap);
VERIFY_CBOR_SUCCESS(TAG, err, "to find bitmap value");
+ resource->bitmap = (uint8_t)bitmap;
// Secure Flag
err = cbor_value_map_find_value(&policyMap, OC_RSRVD_SECURE, &curVal);
VERIFY_CBOR_SUCCESS(TAG, err, "to find port tag");
if (cbor_value_is_valid(&curVal))
{
- err = cbor_value_get_int(&curVal, (int *)&resource->port);
+ int port;
+
+ err = cbor_value_get_int(&curVal, &port);
VERIFY_CBOR_SUCCESS(TAG, err, "to find port value");
+ resource->port = (uint16_t)port;
}
#ifdef TCP_ADAPTER
err = cbor_value_map_find_value(&policyMap, OC_RSRVD_TCP_PORT, &curVal);
if (cbor_value_is_valid(&curVal))
{
- err = cbor_value_get_int(&curVal, (int *)&resource->tcpPort);
+ int tcpPort;
+
+ err = cbor_value_get_int(&curVal, &tcpPort);
VERIFY_CBOR_SUCCESS(TAG, err, "to find tcp port value");
+ resource->tcpPort = (uint16_t)tcpPort;
}
#endif
{
CborValue curVal;
uint64_t temp = 0;
+ uint8_t trigger;
// Sequence Number
CborError err = cbor_value_map_find_value(rootValue, OC_RSRVD_NONCE, &curVal);
// Trigger
err = cbor_value_map_find_value(rootValue, OC_RSRVD_TRIGGER, &curVal);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger tag");
- err = cbor_value_get_simple_type(&curVal, (uint8_t *)&payload->trigger);
+ err = cbor_value_get_simple_type(&curVal, &trigger);
VERIFY_CBOR_SUCCESS(TAG, err, "Failed finding trigger value");
+ payload->trigger = (OCPresenceTrigger)trigger;
// Resource type name
err = cbor_value_map_find_value(rootValue, OC_RSRVD_RESOURCE_TYPE, &curVal);