Fixed coding style related issues
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 2 Apr 2018 03:44:50 +0000 (09:14 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:49 +0000 (19:38 +0900)
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/companion-manager/src/comp_iot.cpp
src/mot-agent/ma-util.c

index bf751f0..00d0174 100644 (file)
@@ -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<OCResourceRequest> reques
                        return OC_EH_OK;
                }
 
-               if(requestFlag & RequestHandlerFlag::RequestFlag) {
+               if (requestFlag & RequestHandlerFlag::RequestFlag) {
                        LOG_DEBUG("requestFlag : Request");
                        auto pResponse = std::make_shared<OC::OCResourceResponse>();
                        char *arg = NULL;
@@ -418,7 +417,7 @@ OCEntityHandlerResult _request_handler(std::shared_ptr<OCResourceRequest> 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<OCResource> 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());
index 7ace038..e276c29 100644 (file)
@@ -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
+}