X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flist.c;h=227546e95f3bdbbeaa5e30c64783f0e18259d1f3;hb=bbb8dee92d639331e8bd81823638267dcc895396;hp=804a7e56adc10e452f008ffafed9ca2010931ce1;hpb=1e3f34c7693bcabae8e443ac1b246680ef9b60e2;p=sliver-openvswitch.git diff --git a/lib/list.c b/lib/list.c index 804a7e56a..227546e95 100644 --- a/lib/list.c +++ b/lib/list.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009, 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ */ #include #include "list.h" -#include /* Initializes 'list' as an empty list. */ void @@ -47,8 +46,9 @@ list_insert(struct list *before, struct list *elem) void list_splice(struct list *before, struct list *first, struct list *last) { - if (first == last) + if (first == last) { return; + } last = last->prev; /* Cleanly remove 'first'...'last' from its current list. */ @@ -138,7 +138,7 @@ list_front(const struct list *list_) { struct list *list = CONST_CAST(struct list *, list_); - assert(!list_is_empty(list)); + ovs_assert(!list_is_empty(list)); return list->next; } @@ -149,7 +149,7 @@ list_back(const struct list *list_) { struct list *list = CONST_CAST(struct list *, list_); - assert(!list_is_empty(list)); + ovs_assert(!list_is_empty(list)); return list->prev; } @@ -161,8 +161,9 @@ list_size(const struct list *list) const struct list *e; size_t cnt = 0; - for (e = list->next; e != list; e = e->next) + for (e = list->next; e != list; e = e->next) { cnt++; + } return cnt; }