r4939 - in trunk/varnish-cache: bin include lib/libvarnishapi

phk at varnish-cache.org phk at varnish-cache.org
Tue Jun 8 14:07:47 CEST 2010


Author: phk
Date: 2010-06-08 14:07:47 +0200 (Tue, 08 Jun 2010)
New Revision: 4939

Modified:
   trunk/varnish-cache/bin/flint.lnt
   trunk/varnish-cache/include/varnishapi.h
   trunk/varnish-cache/lib/libvarnishapi/vsc.c
   trunk/varnish-cache/lib/libvarnishapi/vslapi.h
   trunk/varnish-cache/lib/libvarnishapi/vsm.c
Log:
FlexeLint VSC api



Modified: trunk/varnish-cache/bin/flint.lnt
===================================================================
--- trunk/varnish-cache/bin/flint.lnt	2010-06-08 11:43:51 UTC (rev 4938)
+++ trunk/varnish-cache/bin/flint.lnt	2010-06-08 12:07:47 UTC (rev 4939)
@@ -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

Modified: trunk/varnish-cache/include/varnishapi.h
===================================================================
--- trunk/varnish-cache/include/varnishapi.h	2010-06-08 11:43:51 UTC (rev 4938)
+++ trunk/varnish-cache/include/varnishapi.h	2010-06-08 12:07:47 UTC (rev 4939)
@@ -106,13 +106,13 @@
 	 *	-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 @@
 	 * 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
 	 */

Modified: trunk/varnish-cache/lib/libvarnishapi/vsc.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/vsc.c	2010-06-08 11:43:51 UTC (rev 4938)
+++ trunk/varnish-cache/lib/libvarnishapi/vsc.c	2010-06-08 12:07:47 UTC (rev 4939)
@@ -87,7 +87,7 @@
 }
 
 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 @@
 /*--------------------------------------------------------------------*/
 
 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 @@
 /*--------------------------------------------------------------------*/
 
 struct vsc_main *
-VSC_Main(struct VSM_data *vd)
+VSC_Main(const struct VSM_data *vd)
 {
 	struct vsm_chunk *sha;
 

Modified: trunk/varnish-cache/lib/libvarnishapi/vslapi.h
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/vslapi.h	2010-06-08 11:43:51 UTC (rev 4938)
+++ trunk/varnish-cache/lib/libvarnishapi/vslapi.h	2010-06-08 12:07:47 UTC (rev 4939)
@@ -107,5 +107,5 @@
 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);
 

Modified: trunk/varnish-cache/lib/libvarnishapi/vsm.c
===================================================================
--- trunk/varnish-cache/lib/libvarnishapi/vsm.c	2010-06-08 11:43:51 UTC (rev 4938)
+++ trunk/varnish-cache/lib/libvarnishapi/vsm.c	2010-06-08 12:07:47 UTC (rev 4939)
@@ -48,7 +48,6 @@
 #include "vsm.h"
 #include "vre.h"
 #include "vbm.h"
-#include "vqueue.h"
 #include "miniobj.h"
 #include "varnishapi.h"
 
@@ -84,7 +83,7 @@
 	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 @@
 	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 @@
 /*--------------------------------------------------------------------*/
 
 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 @@
 /*--------------------------------------------------------------------*/
 
 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;
 




More information about the varnish-commit mailing list