From: Saurav Babu Date: Mon, 2 Apr 2018 03:44:50 +0000 (+0530) Subject: Fixed coding style related issues X-Git-Tag: submit/tizen/20190131.065036~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21c73a6e3b896de735efe7090f829bc0bccf2563;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git Fixed coding style related issues Signed-off-by: Saurav Babu --- diff --git a/src/companion-manager/src/comp_iot.cpp b/src/companion-manager/src/comp_iot.cpp index bf751f0..00d0174 100644 --- a/src/companion-manager/src/comp_iot.cpp +++ b/src/companion-manager/src/comp_iot.cpp @@ -57,8 +57,7 @@ OCPersistentStorage ps; static int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid) { - if(NULL == uuid || NULL == strUuid || NULL != *strUuid) - { + if (NULL == uuid || NULL == strUuid || NULL != *strUuid) { LOG_ERR("ConvertUuidToStr : Invalid param"); return OC_STACK_INVALID_PARAM; } @@ -72,11 +71,10 @@ static int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid) goto exit; } - for(uuidIdx=0, urnIdx=0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; uuidIdx++, urnIdx+=2) - { + for (uuidIdx = 0, urnIdx = 0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; + uuidIdx++, urnIdx += 2) { // canonical format for UUID has '8-4-4-4-12' - if(uuidIdx==4 || uuidIdx==6 || uuidIdx==8 || uuidIdx==10) - { + if (uuidIdx == 4 || uuidIdx == 6 || uuidIdx == 8 || uuidIdx == 10) { snprintf(convertedUrn + urnIdx, 2, "%c", '-'); urnIdx++; } @@ -187,11 +185,12 @@ int __comp_iot_get_platform_info(OCPlatformInfo *platform_info) platform_info->dateOfManufacture = g_strdup("NONE"); struct utsname uts; - if(!uname(&uts)) { + + if (!uname(&uts)) platform_info->operatingSystemVersion = g_strdup(uts.sysname); - } else { + else platform_info->operatingSystemVersion = g_strdup("NONE"); - } + platform_info->hardwareVersion = g_strdup("0-0"); platform_info->supportUrl = g_strdup("NONE"); platform_info->systemTime = g_strdup("NONE"); @@ -370,7 +369,7 @@ OCEntityHandlerResult _request_handler(std::shared_ptr reques return OC_EH_OK; } - if(requestFlag & RequestHandlerFlag::RequestFlag) { + if (requestFlag & RequestHandlerFlag::RequestFlag) { LOG_DEBUG("requestFlag : Request"); auto pResponse = std::make_shared(); char *arg = NULL; @@ -418,7 +417,7 @@ OCEntityHandlerResult _request_handler(std::shared_ptr reques } uint32_t len = 0; - if(B64_OK == b64Decode(data.c_str(), payload_len, out, + if (B64_OK == b64Decode(data.c_str(), payload_len, out, outSize, &len)) { LOG_ERR("Base64 decoding failed."); return; @@ -610,7 +609,7 @@ static bool _found_resource(std::shared_ptr resource, LOG_DEBUG("Found Resource"); try { - if(resource) { + if (resource) { resource_host = g_strdup(resource->host().c_str()); resource_uri_path = g_strdup(resource->uri().c_str()); diff --git a/src/mot-agent/ma-util.c b/src/mot-agent/ma-util.c index 7ace038..e276c29 100644 --- a/src/mot-agent/ma-util.c +++ b/src/mot-agent/ma-util.c @@ -370,8 +370,7 @@ static OCProvisionDev_t* _clone_ocprovision_dev(const OCProvisionDev_t* src) int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid) { - if(NULL == uuid || NULL == strUuid || NULL != *strUuid) - { + if (NULL == uuid || NULL == strUuid || NULL != *strUuid) { MA_LOGE("ConvertUuidToStr : Invalid param"); return OC_STACK_INVALID_PARAM; } @@ -385,11 +384,10 @@ int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid) goto exit; } - for(uuidIdx=0, urnIdx=0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; uuidIdx++, urnIdx+=2) - { + for (uuidIdx = 0, urnIdx = 0; uuidIdx < UUID_LENGTH && urnIdx < urnBufSize; + uuidIdx++, urnIdx += 2) { // canonical format for UUID has '8-4-4-4-12' - if(uuidIdx==4 || uuidIdx==6 || uuidIdx==8 || uuidIdx==10) - { + if (uuidIdx == 4 || uuidIdx == 6 || uuidIdx == 8 || uuidIdx == 10) { snprintf(convertedUrn + urnIdx, 2, "%c", '-'); urnIdx++; } @@ -402,4 +400,4 @@ int ConvertUuidToStr(const OicUuid_t* uuid, char** strUuid) exit: return OC_STACK_NO_MEMORY; -} \ No newline at end of file +}