Update coding convention.
authorSung-jae Park <nicesj.park@samsung.com>
Sat, 10 Aug 2013 05:35:06 +0000 (14:35 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sat, 10 Aug 2013 05:35:06 +0000 (14:35 +0900)
Change-Id: Ifa1e075967bea0ae3ebe5319b23d0122b5fe7f62

pkgmgr_shortcut/src/dlist.c

index 2b40ff4..1764dfd 100644 (file)
@@ -46,8 +46,9 @@ struct dlist *dlist_append(struct dlist *list, void *data)
        struct dlist *item;
 
        item = malloc(sizeof(*item));
-       if (!item)
+       if (!item) {
                return NULL;
+       }
 
        item->next = NULL;
        item->data = data;
@@ -72,8 +73,9 @@ struct dlist *dlist_prepend(struct dlist *list, void *data)
        struct dlist *item;
 
        item = malloc(sizeof(*item));
-       if (!item)
+       if (!item) {
                return NULL;
+       }
 
        item->data = data;
 
@@ -81,8 +83,9 @@ struct dlist *dlist_prepend(struct dlist *list, void *data)
                item->prev = item;
                item->next = NULL;
        } else {
-               if (list->prev->next)
+               if (list->prev->next) {
                        list->prev->next = item;
+               }
 
                item->prev = list->prev;
                item->next = list;
@@ -99,13 +102,15 @@ struct dlist *dlist_remove(struct dlist *list, struct dlist *l)
        if (!list || !l)
                return NULL;
 
-       if (l == list)
+       if (l == list) {
                list = l->next;
-       else
+       } else {
                l->prev->next = l->next;
+       }
 
-       if (l->next)
+       if (l->next) {
                l->next->prev = l->prev;
+       }
        /*!
         * \note
         * If the removed entry 'l' has no next element, it is the last element.
@@ -114,8 +119,9 @@ struct dlist *dlist_remove(struct dlist *list, struct dlist *l)
         *
         * If we didn't care about this, the head element(list) can indicates the invalid element.
         */
-       else if (list)
+       else if (list) {
                list->prev = l->prev;
+       }
 
        free(l);
        return list;
@@ -127,8 +133,9 @@ struct dlist *dlist_find_data(struct dlist *list, void *data)
        void *_data;
 
        dlist_foreach(list, l, _data) {
-               if (data == _data)
+               if (data == _data) {
                        return l;
+               }
        }
 
        return NULL;
@@ -170,8 +177,9 @@ struct dlist *dlist_nth(struct dlist *l, int nth)
 
        i = 0;
        for (n = l; n; n = n->next) {
-               if (i == nth)
+               if (i == nth) {
                        return n;
+               }
                i++;
        }