git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3b91749
)
ofpbuf: Mark ofpbuf_headroom(), ofpbuf_tailroom() parameters const.
author
Ben Pfaff
<blp@nicira.com>
Thu, 11 Feb 2010 22:59:01 +0000
(14:59 -0800)
committer
Ben Pfaff
<blp@nicira.com>
Fri, 12 Feb 2010 21:55:46 +0000
(13:55 -0800)
lib/ofpbuf.c
patch
|
blob
|
history
lib/ofpbuf.h
patch
|
blob
|
history
diff --git
a/lib/ofpbuf.c
b/lib/ofpbuf.c
index
bb21679
..
fd01ea8
100644
(file)
--- a/
lib/ofpbuf.c
+++ b/
lib/ofpbuf.c
@@
-103,7
+103,7
@@
ofpbuf_delete(struct ofpbuf *b)
* commonly, the data in a ofpbuf is at its beginning, and thus the ofpbuf's
* headroom is 0.) */
size_t
* commonly, the data in a ofpbuf is at its beginning, and thus the ofpbuf's
* headroom is 0.) */
size_t
-ofpbuf_headroom(
struct ofpbuf *b)
+ofpbuf_headroom(
const struct ofpbuf *b)
{
return (char*)b->data - (char*)b->base;
}
{
return (char*)b->data - (char*)b->base;
}
@@
-111,7
+111,7
@@
ofpbuf_headroom(struct ofpbuf *b)
/* Returns the number of bytes that may be appended to the tail end of ofpbuf
* 'b' before the ofpbuf must be reallocated. */
size_t
/* Returns the number of bytes that may be appended to the tail end of ofpbuf
* 'b' before the ofpbuf must be reallocated. */
size_t
-ofpbuf_tailroom(
struct ofpbuf *b)
+ofpbuf_tailroom(
const struct ofpbuf *b)
{
return (char*)ofpbuf_end(b) - (char*)ofpbuf_tail(b);
}
{
return (char*)ofpbuf_end(b) - (char*)ofpbuf_tail(b);
}
diff --git
a/lib/ofpbuf.h
b/lib/ofpbuf.h
index
259e703
..
b65f79e
100644
(file)
--- a/
lib/ofpbuf.h
+++ b/
lib/ofpbuf.h
@@
-64,8
+64,8
@@
void ofpbuf_reserve(struct ofpbuf *, size_t);
void *ofpbuf_push_uninit(struct ofpbuf *b, size_t);
void *ofpbuf_push(struct ofpbuf *b, const void *, size_t);
void *ofpbuf_push_uninit(struct ofpbuf *b, size_t);
void *ofpbuf_push(struct ofpbuf *b, const void *, size_t);
-size_t ofpbuf_headroom(struct ofpbuf *);
-size_t ofpbuf_tailroom(struct ofpbuf *);
+size_t ofpbuf_headroom(
const
struct ofpbuf *);
+size_t ofpbuf_tailroom(
const
struct ofpbuf *);
void ofpbuf_prealloc_headroom(struct ofpbuf *, size_t);
void ofpbuf_prealloc_tailroom(struct ofpbuf *, size_t);
void ofpbuf_trim(struct ofpbuf *);
void ofpbuf_prealloc_headroom(struct ofpbuf *, size_t);
void ofpbuf_prealloc_tailroom(struct ofpbuf *, size_t);
void ofpbuf_trim(struct ofpbuf *);