summaryrefslogtreecommitdiff
path: root/pkgmgr_shortcut
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-08-10 14:35:06 +0900
committerSung-jae Park <nicesj.park@samsung.com>2013-08-10 14:35:06 +0900
commit48c251f5b427f75eb1465e6a89f48c4046268c77 (patch)
tree29b01b4623e67af55d0d15e21f7f73fae4b852d9 /pkgmgr_shortcut
parentb0f93594b2fdeeca1b910cee31ba403044987545 (diff)
downloadshortcut-48c251f5b427f75eb1465e6a89f48c4046268c77.tar.gz
shortcut-48c251f5b427f75eb1465e6a89f48c4046268c77.tar.bz2
shortcut-48c251f5b427f75eb1465e6a89f48c4046268c77.zip
Update coding convention.
Change-Id: Ifa1e075967bea0ae3ebe5319b23d0122b5fe7f62
Diffstat (limited to 'pkgmgr_shortcut')
-rw-r--r--pkgmgr_shortcut/src/dlist.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/pkgmgr_shortcut/src/dlist.c b/pkgmgr_shortcut/src/dlist.c
index 2b40ff4..1764dfd 100644
--- a/pkgmgr_shortcut/src/dlist.c
+++ b/pkgmgr_shortcut/src/dlist.c
@@ -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++;
}