git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dpif-linux: Use MAX_PORTS instead of hard-coded 65535.
[sliver-openvswitch.git]
/
lib
/
list.c
diff --git
a/lib/list.c
b/lib/list.c
index
a236f8c
..
227546e
100644
(file)
--- a/
lib/list.c
+++ b/
lib/list.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2008, 2009, 2010, 2011
Nicira Networks
.
+ * 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.
*
* 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 <config.h>
#include "list.h"
*/
#include <config.h>
#include "list.h"
-#include <assert.h>
/* Initializes 'list' as an empty list. */
void
/* 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)
{
void
list_splice(struct list *before, struct list *first, struct list *last)
{
- if (first == last)
+ if (first == last)
{
return;
return;
+ }
last = last->prev;
/* Cleanly remove 'first'...'last' from its current list. */
last = last->prev;
/* Cleanly remove 'first'...'last' from its current list. */
@@
-136,9
+136,9
@@
list_pop_back(struct list *list)
struct list *
list_front(const struct list *list_)
{
struct list *
list_front(const struct list *list_)
{
- struct list *list =
(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;
}
return list->next;
}
@@
-147,9
+147,9
@@
list_front(const struct list *list_)
struct list *
list_back(const struct list *list_)
{
struct list *
list_back(const struct list *list_)
{
- struct list *list =
(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;
}
return list->prev;
}
@@
-161,8
+161,9
@@
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)
+ for (e = list->next; e != list; e = e->next)
{
cnt++;
cnt++;
+ }
return cnt;
}
return cnt;
}