Looks Good.
On Mon, Mar 21, 2011 at 2:10 PM, Ben Pfaff <[email protected]> wrote: > --- > lib/list.c | 76 > ++++++++++++++++++++++++++++++------------------------------ > 1 files changed, 38 insertions(+), 38 deletions(-) > > diff --git a/lib/list.c b/lib/list.c > index 4ffa883..6d5f6fe 100644 > --- a/lib/list.c > +++ b/lib/list.c > @@ -36,10 +36,10 @@ list_poison(struct list *list) > void > list_insert(struct list *before, struct list *elem) > { > - elem->prev = before->prev; > - elem->next = before; > - before->prev->next = elem; > - before->prev = elem; > + elem->prev = before->prev; > + elem->next = before; > + before->prev->next = elem; > + before->prev = elem; > } > > /* Removes elements 'first' though 'last' (exclusive) from their current > list, > @@ -47,19 +47,19 @@ list_insert(struct list *before, struct list *elem) > void > list_splice(struct list *before, struct list *first, struct list *last) > { > - if (first == last) > - return; > - last = last->prev; > - > - /* Cleanly remove 'first'...'last' from its current list. */ > - first->prev->next = last->next; > - last->next->prev = first->prev; > - > - /* Splice 'first'...'last' into new list. */ > - first->prev = before->prev; > - last->next = before; > - before->prev->next = first; > - before->prev = last; > + if (first == last) > + return; > + last = last->prev; > + > + /* Cleanly remove 'first'...'last' from its current list. */ > + first->prev->next = last->next; > + last->next->prev = first->prev; > + > + /* Splice 'first'...'last' into new list. */ > + first->prev = before->prev; > + last->next = before; > + before->prev->next = first; > + before->prev = last; > } > > /* Inserts 'elem' at the beginning of 'list', so that it becomes the front in > @@ -67,7 +67,7 @@ list_splice(struct list *before, struct list *first, struct > list *last) > void > list_push_front(struct list *list, struct list *elem) > { > - list_insert(list->next, elem); > + list_insert(list->next, elem); > } > > /* Inserts 'elem' at the end of 'list', so that it becomes the back in > @@ -75,7 +75,7 @@ list_push_front(struct list *list, struct list *elem) > void > list_push_back(struct list *list, struct list *elem) > { > - list_insert(list, elem); > + list_insert(list, elem); > } > > /* Puts 'elem' in the position currently occupied by 'position'. > @@ -102,9 +102,9 @@ list_moved(struct list *list) > struct list * > list_remove(struct list *elem) > { > - elem->prev->next = elem->next; > - elem->next->prev = elem->prev; > - return elem->next; > + elem->prev->next = elem->next; > + elem->next->prev = elem->prev; > + return elem->next; > } > > /* Removes the front element from 'list' and returns it. Undefined behavior > if > @@ -112,9 +112,9 @@ list_remove(struct list *elem) > struct list * > list_pop_front(struct list *list) > { > - struct list *front = list->next; > - list_remove(front); > - return front; > + struct list *front = list->next; > + list_remove(front); > + return front; > } > > /* Removes the back element from 'list' and returns it. > @@ -122,9 +122,9 @@ list_pop_front(struct list *list) > struct list * > list_pop_back(struct list *list) > { > - struct list *back = list->prev; > - list_remove(back); > - return back; > + struct list *back = list->prev; > + list_remove(back); > + return back; > } > > /* Returns the front element in 'list'. > @@ -132,8 +132,8 @@ list_pop_back(struct list *list) > struct list * > list_front(struct list *list) > { > - assert(!list_is_empty(list)); > - return list->next; > + assert(!list_is_empty(list)); > + return list->next; > } > > /* Returns the back element in 'list'. > @@ -141,8 +141,8 @@ list_front(struct list *list) > struct list * > list_back(struct list *list) > { > - assert(!list_is_empty(list)); > - return list->prev; > + assert(!list_is_empty(list)); > + return list->prev; > } > > /* Returns the number of elements in 'list'. > @@ -150,17 +150,17 @@ list_back(struct list *list) > size_t > list_size(const struct list *list) > { > - const struct list *e; > - size_t cnt = 0; > + const struct list *e; > + size_t cnt = 0; > > - for (e = list->next; e != list; e = e->next) > - cnt++; > - return cnt; > + for (e = list->next; e != list; e = e->next) > + cnt++; > + return cnt; > } > > /* Returns true if 'list' is empty, false otherwise. */ > bool > list_is_empty(const struct list *list) > { > - return list->next == list; > + return list->next == list; > } > -- > 1.7.1 > > _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
