}
#endif // __cplusplus
+/**
+ * cbor default init
+ */
+#ifndef OC_DEFAULT_CBOR_VALUE
+# if (__STDC_VERSION__ >= 199901L)
+# define OC_DEFAULT_CBOR_VALUE {.parser = NULL, .ptr = NULL, .remaining = 0, .extra = 0, .type = 0, .flags = 0}
+# else
+# define OC_DEFAULT_CBOR_VALUE {NULL, NULL, 0, 0, 0, 0}
+# endif
+#endif
+
+#ifndef OC_DEFAULT_CBOR_PARSER
+# if (__STDC_VERSION__ >= 199901L)
+# define OC_DEFAULT_CBOR_PARSER {.end = NULL, .flags = 0}
+# else
+# define OC_DEFAULT_CBOR_PARSER {NULL, 0}
+# endif
+#endif
+
+#ifndef OC_DEFAULT_OICUUID
+# if (__STDC_VERSION__ >= 199901L)
+# define OC_DEFAULT_OICUUID {.id= { 0 } }
+# else
+# define OC_DEFAULT_OICUUID {{ 0 }}
+# endif
+#endif
+
#endif //IOTVT_SRM_UTILITY_H
static resetSVRDBCB_t g_resetSVRDBCB = {0};
-resetSVRDBCB_t* const GetResetSVRDBCB(void)
+resetSVRDBCB_t* GetResetSVRDBCB(void)
{
return &g_resetSVRDBCB;
}
OIC_LOG_V(DEBUG, TAG, "In %s", __func__);
OCStackResult res = OC_STACK_ERROR;
- OicUuid_t emptyUuid = {.id={0}};
+ OicUuid_t emptyUuid = OC_DEFAULT_OICUUID;
+ OicUuid_t devOwnerUuid = OC_DEFAULT_OICUUID;
+ OicUuid_t devRownerUuid = OC_DEFAULT_OICUUID;
+ OicUuid_t resRowneruuid = OC_DEFAULT_OICUUID;
+ bool isDevOwnerUuidEmpty = false;
+ bool isDevRownerUuidEmpty = false;
+ bool isPstatRownerUuidEmpty = false;
+ bool isAclRownerUuidEmpty = false;
+ bool isCredRownerUuidEmpty = false;
+ OicSecDpm_t cm = NORMAL;
bool isOwned = false;
res = GetDoxmIsOwned(&isOwned);
goto exit;
}
- OicUuid_t devOwnerUuid = {.id={0}};
- OicUuid_t devRownerUuid = {.id={0}};
- OicUuid_t resRowneruuid = {.id={0}};
- bool isDevOwnerUuidEmpty = false;
- bool isDevRownerUuidEmpty = false;
- bool isPstatRownerUuidEmpty = false;
- bool isAclRownerUuidEmpty = false;
- bool isCredRownerUuidEmpty = false;
-
- if(OC_STACK_OK != GetDoxmDevOwnerId(&devOwnerUuid) |
+ if(OC_STACK_OK != GetDoxmDevOwnerId(&devOwnerUuid) ||
OC_STACK_OK != GetDoxmRownerId(&devRownerUuid))
{
res = OC_STACK_ERROR;
isPstatRownerUuidEmpty = false;
}
- OicSecDpm_t cm = NORMAL;
VERIFY_SUCCESS(TAG, OC_STACK_OK == GetPstatCm(&cm), ERROR);
if (OC_STACK_OK != GetAclRownerId(&resRowneruuid))
{
ocRes = OC_STACK_ERROR;
{
- CborParser parser;
- CborValue cbor;
+ CborParser parser = OC_DEFAULT_CBOR_PARSER;
+ CborValue cbor = OC_DEFAULT_CBOR_VALUE;
cbor_parser_init(dbData, dbSize, 0, &parser, &cbor);
- CborValue curVal = {0};
+ CborValue curVal = OC_DEFAULT_CBOR_VALUE;
CborError cborFindResult = CborNoError;
cborFindResult = cbor_value_map_find_value(&cbor, OIC_JSON_RESET_PF_NAME, &curVal);