Commit 1a0e526e authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

FlexeLint VSC api



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4939 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent faaab4e3
......@@ -11,8 +11,8 @@
-esym(528, svnid) // Sym not ref
-efile(451, shmlog_tags.h) // No include guard
-efile(451, stat_field.h) // No include guard
-efile(451, vsl_tags.h) // No include guard
-efile(451, vsc_fields.h) // No include guard
///////////////////////////////////////////////////////////////////////
// assert() support, common to libvarnish and libvarnishapi
......
......@@ -106,13 +106,13 @@ int VSM_ReOpen(struct VSM_data *vd, int diag);
* -1 failure to reopen.
*/
struct vsm_head *VSM_Head(struct VSM_data *vd);
struct vsm_head *VSM_Head(const struct VSM_data *vd);
/*
* Return the head of the VSM.
*/
void *VSM_Find_Chunk(struct VSM_data *vd, const char *class, const char *type,
const char *ident, unsigned *lenp);
void *VSM_Find_Chunk(const struct VSM_data *vd, const char *class,
const char *type, const char *ident, unsigned *lenp);
/*
* Find a given chunk in the shared memory.
* Returns pointer or NULL.
......@@ -161,7 +161,7 @@ int VSC_Open(struct VSM_data *vd, int diag);
* args and returns as VSM_Open()
*/
struct vsc_main *VSC_Main(struct VSM_data *vd);
struct vsc_main *VSC_Main(const struct VSM_data *vd);
/*
* return Main stats structure
*/
......
......@@ -87,7 +87,7 @@ VSC_Setup(struct VSM_data *vd)
}
void
vsc_delete(struct VSM_data *vd)
vsc_delete(const struct VSM_data *vd)
{
struct vsc_sf *sf;
struct vsc *vsc = vd->vsc;
......@@ -106,7 +106,7 @@ vsc_delete(struct VSM_data *vd)
/*--------------------------------------------------------------------*/
static int
vsc_sf_arg(struct VSM_data *vd, const char *opt)
vsc_sf_arg(const struct VSM_data *vd, const char *opt)
{
struct vsc *vsc;
struct vsc_sf *sf;
......@@ -219,7 +219,7 @@ VSC_Open(struct VSM_data *vd, int diag)
/*--------------------------------------------------------------------*/
struct vsc_main *
VSC_Main(struct VSM_data *vd)
VSC_Main(const struct VSM_data *vd)
{
struct vsm_chunk *sha;
......
......@@ -107,5 +107,5 @@ struct VSM_data {
struct vsm_chunk *vsm_find_alloc(const struct VSM_data *vd, const char *class,
const char *type, const char *ident);
void vsc_delete(struct VSM_data *vd);
void vsc_delete(const struct VSM_data *vd);
......@@ -48,7 +48,6 @@ SVNID("$Id$")
#include "vsm.h"
#include "vre.h"
#include "vbm.h"
#include "vqueue.h"
#include "miniobj.h"
#include "varnishapi.h"
......@@ -84,7 +83,7 @@ VSM_New(void)
vd->r_fd = -1;
/* XXX: Allocate only if -r option given ? */
vd->rbuflen = 256; /* XXX ?? */
vd->rbuf = malloc(vd->rbuflen * 4);
vd->rbuf = malloc(vd->rbuflen * 4L);
assert(vd->rbuf != NULL);
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
......@@ -206,7 +205,7 @@ vsl_open(struct VSM_data *vd, int diag)
vd->vsl_end = (uint8_t *)vd->vsl_lh + slh.shm_size;
while(slh.alloc_seq == 0)
usleep(50000); /* XXX limit total sleep */
(void)usleep(50000); /* XXX limit total sleep */
vd->alloc_seq = slh.alloc_seq;
return (0);
}
......@@ -268,7 +267,7 @@ VSM_ReOpen(struct VSM_data *vd, int diag)
/*--------------------------------------------------------------------*/
struct vsm_head *
VSM_Head(struct VSM_data *vd)
VSM_Head(const struct VSM_data *vd)
{
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
......@@ -302,8 +301,8 @@ vsm_find_alloc(const struct VSM_data *vd, const char *class, const char *type, c
/*--------------------------------------------------------------------*/
void *
VSM_Find_Chunk(struct VSM_data *vd, const char *class, const char *type, const char *ident,
unsigned *lenp)
VSM_Find_Chunk(const struct VSM_data *vd, const char *class, const char *type,
const char *ident, unsigned *lenp)
{
struct vsm_chunk *sha;
......
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