check and apply coding rule
authorYoungjae Shin <yj99.shin@samsung.com>
Tue, 8 Dec 2015 01:48:32 +0000 (10:48 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Tue, 8 Dec 2015 05:24:01 +0000 (14:24 +0900)
Change-Id: I479eb18708559278543eee7b965b1d6b94375738

daemon/icd-ioty-ocprocess.c
daemon/icd-ioty.c
daemon/icd-payload.c
daemon/icd.c
lib/icl-payload.c
lib/icl-response.c
lib/icl.c

index bfa8804..8d08308 100644 (file)
@@ -37,8 +37,7 @@ static int icd_ioty_alive;
 typedef int (*_ocprocess_cb)(void *user_data);
 typedef void (*_free_context)(void *context);
 
-struct icd_ioty_worker
-{
+struct icd_ioty_worker {
        void *ctx;
        _ocprocess_cb cb;
        _free_context free_ctx;
@@ -790,8 +789,8 @@ OCStackApplicationResult icd_ioty_ocprocess_observe_cb(void *ctx,
        RETV_IF(NULL == ctx, OC_STACK_KEEP_TRANSACTION);
        RETV_IF(NULL == resp, OC_STACK_KEEP_TRANSACTION);
 
-       cb_result = (OC_OBSERVE_DEREGISTER == resp->sequenceNumber)?
-               OC_STACK_DELETE_TRANSACTION:OC_STACK_KEEP_TRANSACTION;
+       cb_result = (OC_OBSERVE_DEREGISTER == resp->sequenceNumber) ?
+               OC_STACK_DELETE_TRANSACTION : OC_STACK_KEEP_TRANSACTION;
 
        if (NULL == resp->payload) {
                ERR("payload is empty");
index 6d43c23..633becc 100644 (file)
@@ -124,13 +124,13 @@ static int _ioty_properties_to_oic_properties(int properties)
                prop |= OC_EXPLICIT_DISCOVERABLE;
 
        /* TODO: Secure option is not supported yet. */
-       properties = (properties & OC_SECURE)? (properties ^ OC_SECURE):properties;
+       properties = (properties & OC_SECURE) ? (properties ^ OC_SECURE) : properties;
 
        return prop;
 }
 
 OCResourceHandle icd_ioty_register_resource(const char *uri_path,
-               const char* const* res_types, int ifaces, int properties)
+               const char * const *res_types, int ifaces, int properties)
 {
        FN_CALL;
        int i;
@@ -301,11 +301,11 @@ int icd_ioty_notify(OCResourceHandle handle, GVariant *msg, GVariant *observers)
 
        icd_ioty_csdk_lock();
        /* TODO : QoS is come from lib. */
-       if (msg_length) {
+       if (msg_length)
                ret = OCNotifyListOfObservers(handle, obs_ids, obs_length, payload, OC_LOW_QOS);
-       } else {
+       else
                ret = OCNotifyAllObservers(handle, OC_LOW_QOS);
-       }
+
        icd_ioty_csdk_unlock();
 
        if (OC_STACK_NO_OBSERVERS == ret) {
@@ -370,7 +370,7 @@ int icd_ioty_send_response(GVariant *resp)
        response.numSendVendorSpecificHeaderOptions = options_size;
 
        if (0 != options_size) {
-               int ret= _ioty_get_header_options(options,
+               int ret = _ioty_get_header_options(options,
                                response.numSendVendorSpecificHeaderOptions,
                                response.sendVendorSpecificHeaderOptions,
                                sizeof(response.sendVendorSpecificHeaderOptions)
@@ -441,7 +441,7 @@ int icd_ioty_find_resource(const char *host_address,
        OCCallbackData cbdata = {0};
        OCConnectivityType oic_conn_type;
 
-       coap_str = is_secure? ICD_IOTY_COAPS:ICD_IOTY_COAP;
+       coap_str = is_secure ? ICD_IOTY_COAPS : ICD_IOTY_COAP;
 
        if (IC_STR_EQUAL == strcmp(IC_STR_NULL, host_address)) {
                len = snprintf(uri, sizeof(uri), "%s", OC_RSRVD_WELL_KNOWN_URI);
@@ -533,7 +533,7 @@ static char* _icd_ioty_resource_generate_uri(char *uri_path, GVariant *query)
 
 void icd_ioty_complete(int type, GDBusMethodInvocation *invocation, GVariant *value)
 {
-       switch(type) {
+       switch (type) {
        case ICD_CRUD_GET:
                ic_dbus_complete_get(icd_dbus_get_object(), invocation, value);
                break;
index 5bc0b7d..e2d8551 100644 (file)
@@ -116,7 +116,7 @@ GVariant** icd_payload_res_to_gvariant(OCPayload *payload, OCDevAddr *dev_addr)
                properties = icd_ioty_oic_properties_to_properties(resource->bitmap);
 
                /* port */
-               port = (resource->port)? resource->port:dev_addr->port;
+               port = (resource->port) ? resource->port : dev_addr->port;
 
                /* TODO
                 * Check "resource->secure" and "resource->bitmap" */
@@ -597,7 +597,7 @@ static void _icd_state_value_from_gvariant(OCRepPayload *repr, GVariantIter *ite
                        else
                                OCRepPayloadSetPropString(repr, key, str_value);
 
-               } else if (g_variant_is_of_type(var, G_VARIANT_TYPE ("a{sv}"))) {
+               } else if (g_variant_is_of_type(var, G_VARIANT_TYPE("a{sv}"))) {
                        GVariantIter state_iter;
                        repr_value = OCRepPayloadCreate();
                        g_variant_iter_init(&state_iter, var);
@@ -776,16 +776,16 @@ static int _representation_compare_value(OCRepPayloadValue *value1,
                ret = IC_EQUAL;
                break;
        case OCREP_PROP_INT:
-               ret = (value1->i == value2->i)? IC_EQUAL : 1;
+               ret = (value1->i == value2->i) ? IC_EQUAL : 1;
                break;
        case OCREP_PROP_DOUBLE:
-               ret = (value1->d == value2->d)? IC_EQUAL : 1;
+               ret = (value1->d == value2->d) ? IC_EQUAL : 1;
                break;
        case OCREP_PROP_BOOL:
-               ret = (value1->b == value2->b)? IC_EQUAL : 1;
+               ret = (value1->b == value2->b) ? IC_EQUAL : 1;
                break;
        case OCREP_PROP_STRING:
-               ret = (IC_STR_EQUAL == g_strcmp0(value1->str, value2->str))? IC_EQUAL : 1;
+               ret = (IC_STR_EQUAL == g_strcmp0(value1->str, value2->str)) ? IC_EQUAL : 1;
                break;
        case OCREP_PROP_OBJECT:
                ret = icd_payload_representation_compare(value1->obj, value2->obj);
index c411c9d..fcf7598 100644 (file)
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
        GThread *thread;
        GMainLoop *loop;
 
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
        g_type_init();
 #endif
 
index 4ea51fb..63b9568 100644 (file)
@@ -98,7 +98,6 @@ static GVariantBuilder* _icl_state_value_to_gvariant_builder(GHashTable *hash)
        GVariant *var = NULL;
        iotcon_state_h state;
        GVariantBuilder *builder;
-//     GVariantBuilder *state_builder;
        struct icl_value_s *state_value = NULL;
 
        if (NULL == hash)
@@ -131,7 +130,6 @@ static GVariantBuilder* _icl_state_value_to_gvariant_builder(GHashTable *hash)
                case IOTCON_TYPE_STATE:
                        state = ((icl_val_state_s*)state_value)->state;
                        var = _icl_state_value_to_gvariant(state->hash_table);
-//                     var = g_variant_new("a{sv}", state_builder);
                        break;
                case IOTCON_TYPE_NONE:
                default:
index 44313d3..25474b5 100644 (file)
@@ -150,7 +150,7 @@ static bool _icl_response_representation_child_cb(iotcon_representation_h child,
 {
        int iface = GPOINTER_TO_INT(user_data);
 
-       switch(iface) {
+       switch (iface) {
        case IOTCON_INTERFACE_BATCH:
                child->visibility = ICL_VISIBILITY_REPR;
                break;
@@ -182,7 +182,7 @@ static int _icl_response_check_representation_visibility(iotcon_response_h resp)
 
        DBG("interface type of response : %d", resp->iface);
 
-       switch(resp->iface) {
+       switch (resp->iface) {
        case IOTCON_INTERFACE_NONE:
        case IOTCON_INTERFACE_DEFAULT:
        case IOTCON_INTERFACE_GROUP:
index aec808d..f079a86 100644 (file)
--- a/lib/icl.c
+++ b/lib/icl.c
@@ -23,7 +23,7 @@ API int iotcon_connect(void)
 {
        int ret;
 
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
        g_type_init();
 #endif