From a363cb9b9111aed22d105adb0e7a8e9caab9bbe3 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 17 Feb 2013 09:01:46 +0100 Subject: Fix braces in if-else statements From the Linux kernel coding guidelines: Do not unnecessarily use braces where a single statement will do. [...] This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. Signed-off-by: Lukas Fleischer --- src/llist.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/llist.c') diff --git a/src/llist.c b/src/llist.c index 54f1e79..97e57f2 100644 --- a/src/llist.c +++ b/src/llist.c @@ -140,9 +140,9 @@ void llist_add(llist_t * l, void *data) o->data = data; o->next = NULL; - if (!l->head) + if (!l->head) { l->head = l->tail = o; - else { + } else { l->tail->next = o; l->tail = o; } @@ -161,9 +161,9 @@ void llist_add_sorted(llist_t * l, void *data, llist_fn_cmp_t fn_cmp) o->data = data; o->next = NULL; - if (!l->head) + if (!l->head) { l->head = l->tail = o; - else if (fn_cmp(o->data, l->tail->data) >= 0) { + } else if (fn_cmp(o->data, l->tail->data) >= 0) { l->tail->next = o; l->tail = o; } else if (fn_cmp(o->data, l->head->data) < 0) { @@ -186,9 +186,9 @@ void llist_remove(llist_t * l, llist_item_t * i) { llist_item_t *j = NULL; - if (l->head && i == l->head) + if (l->head && i == l->head) { l->head = i->next; - else { + } else { for (j = l->head; j && j->next != i; j = j->next) ; } -- cgit v1.2.3-54-g00ecf