Commit e74a5a03 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Constify VSB_len() and VSB_data()

parent 801f3a62
...@@ -76,8 +76,8 @@ int VSB_putc(struct vsb *, int); ...@@ -76,8 +76,8 @@ int VSB_putc(struct vsb *, int);
int VSB_trim(struct vsb *); int VSB_trim(struct vsb *);
int VSB_error(const struct vsb *); int VSB_error(const struct vsb *);
int VSB_finish(struct vsb *); int VSB_finish(struct vsb *);
char *VSB_data(struct vsb *); char *VSB_data(const struct vsb *);
ssize_t VSB_len(struct vsb *); ssize_t VSB_len(const struct vsb *);
int VSB_done(const struct vsb *); int VSB_done(const struct vsb *);
void VSB_delete(struct vsb *); void VSB_delete(struct vsb *);
void VSB_quote(struct vsb *s, const char *p, int len, int how); void VSB_quote(struct vsb *s, const char *p, int len, int how);
......
...@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD: head/sys/kern/subr_vsb.c 222004 2011-05-17 06:36:32Z phk $") ...@@ -77,7 +77,7 @@ __FBSDID("$FreeBSD: head/sys/kern/subr_vsb.c 222004 2011-05-17 06:36:32Z phk $")
*/ */
#if !defined(NDEBUG) #if !defined(NDEBUG)
static void static void
_assert_VSB_integrity(const char *fun, struct vsb *s) _assert_VSB_integrity(const char *fun, const struct vsb *s)
{ {
(void)fun; (void)fun;
...@@ -93,7 +93,7 @@ _assert_VSB_integrity(const char *fun, struct vsb *s) ...@@ -93,7 +93,7 @@ _assert_VSB_integrity(const char *fun, struct vsb *s)
} }
static void static void
_assert_VSB_state(const char *fun, struct vsb *s, int state) _assert_VSB_state(const char *fun, const struct vsb *s, int state)
{ {
(void)fun; (void)fun;
...@@ -490,7 +490,7 @@ VSB_finish(struct vsb *s) ...@@ -490,7 +490,7 @@ VSB_finish(struct vsb *s)
* Return a pointer to the vsb data. * Return a pointer to the vsb data.
*/ */
char * char *
VSB_data(struct vsb *s) VSB_data(const struct vsb *s)
{ {
assert_VSB_integrity(s); assert_VSB_integrity(s);
...@@ -503,7 +503,7 @@ VSB_data(struct vsb *s) ...@@ -503,7 +503,7 @@ VSB_data(struct vsb *s)
* Return the length of the vsb data. * Return the length of the vsb data.
*/ */
ssize_t ssize_t
VSB_len(struct vsb *s) VSB_len(const struct vsb *s)
{ {
assert_VSB_integrity(s); assert_VSB_integrity(s);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment