From: phk Date: Wed, 30 Jan 2008 10:24:54 +0000 (+0000) Subject: Flexelint silencing: a (), a couple of const and cast. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ee0e89cacf77123a3b8f2bc52bc3bf1eeea5e887;p=varnish Flexelint silencing: a (), a couple of const and cast. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2410 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/include/vsb.h b/varnish-cache/include/vsb.h index f95a1e39..82699447 100644 --- a/varnish-cache/include/vsb.h +++ b/varnish-cache/include/vsb.h @@ -69,11 +69,11 @@ int vsb_vprintf(struct vsb *, const char *, va_list) /* __printflike(2, 0) */; #endif int vsb_putc(struct vsb *, int); int vsb_trim(struct vsb *); -int vsb_overflowed(struct vsb *); +int vsb_overflowed(const struct vsb *); void vsb_finish(struct vsb *); char *vsb_data(struct vsb *); int vsb_len(struct vsb *); -int vsb_done(struct vsb *); +int vsb_done(const struct vsb *); void vsb_delete(struct vsb *); #ifdef __cplusplus }; diff --git a/varnish-cache/lib/libvarnish/vsb.c b/varnish-cache/lib/libvarnish/vsb.c index 3a865dea..998b80ff 100644 --- a/varnish-cache/lib/libvarnish/vsb.c +++ b/varnish-cache/lib/libvarnish/vsb.c @@ -51,7 +51,7 @@ #define VSB_ISFINISHED(s) ((s)->s_flags & VSB_FINISHED) #define VSB_HASOVERFLOWED(s) ((s)->s_flags & VSB_OVERFLOWED) #define VSB_HASROOM(s) ((s)->s_len < (s)->s_size - 1) -#define VSB_FREESPACE(s) ((s)->s_size - (s)->s_len - 1) +#define VSB_FREESPACE(s) ((s)->s_size - ((s)->s_len + 1)) #define VSB_CANEXTEND(s) ((s)->s_flags & VSB_AUTOEXTEND) /* @@ -373,7 +373,7 @@ vsb_putc(struct vsb *s, int c) return (-1); } if (c != '\0') - s->s_buf[s->s_len++] = c; + s->s_buf[s->s_len++] = (char)c; return (0); } @@ -399,7 +399,7 @@ vsb_trim(struct vsb *s) * Check if an vsb overflowed */ int -vsb_overflowed(struct vsb *s) +vsb_overflowed(const struct vsb *s) { return VSB_HASOVERFLOWED(s); } @@ -467,7 +467,7 @@ vsb_delete(struct vsb *s) * Check if an vsb has been finished. */ int -vsb_done(struct vsb *s) +vsb_done(const struct vsb *s) { return(VSB_ISFINISHED(s));