Commit 635bc5f3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Give libvarnishapi a good flexelinting

parent d68a7210
-esym(850, av) -esym(850, av)
-esym(785, VSL_tags)
-esym(528, iter_call) // Flexelint bug
-e712 // 14 Info 712 Loss of precision (___) (___ to ___) -e712 // 14 Info 712 Loss of precision (___) (___ to ___)
-e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___ -e747 // 16 Info 747 Significant prototype coercion (___) ___ to ___
......
...@@ -9,4 +9,5 @@ flexelint \ ...@@ -9,4 +9,5 @@ flexelint \
-I../.. \ -I../.. \
../flint.lnt \ ../flint.lnt \
flint.lnt \ flint.lnt \
*.c *.c \
../../lib/libvarnishapi/*.c
...@@ -66,7 +66,7 @@ int VSC_Open(struct VSM_data *vd, int diag); ...@@ -66,7 +66,7 @@ int VSC_Open(struct VSM_data *vd, int diag);
* args and returns as VSM_Open() * args and returns as VSM_Open()
*/ */
struct VSC_C_main *VSC_Main(struct VSM_data *vd); struct VSC_C_main *VSC_Main(const struct VSM_data *vd);
/* /*
* return Main stats structure * return Main stats structure
* returns NULL until child has been started. * returns NULL until child has been started.
...@@ -84,7 +84,7 @@ struct VSC_point { ...@@ -84,7 +84,7 @@ struct VSC_point {
typedef int VSC_iter_f(void *priv, const struct VSC_point *const pt); typedef int VSC_iter_f(void *priv, const struct VSC_point *const pt);
int VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv); int VSC_Iter(const struct VSM_data *vd, VSC_iter_f *func, void *priv);
/* /*
* Iterate over all statistics counters, calling "func" for * Iterate over all statistics counters, calling "func" for
* each counter not suppressed by any "-f" arguments. * each counter not suppressed by any "-f" arguments.
......
...@@ -126,8 +126,8 @@ struct VSM_head *VSM_Head(const struct VSM_data *vd); ...@@ -126,8 +126,8 @@ struct VSM_head *VSM_Head(const struct VSM_data *vd);
* Return the head of the VSM. * Return the head of the VSM.
*/ */
void VSM__iter0(struct VSM_data *vd, struct VSM_fantom *vf); void VSM__iter0(const struct VSM_data *vd, struct VSM_fantom *vf);
int VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf); int VSM__itern(const struct VSM_data *vd, struct VSM_fantom *vf);
#define VSM_FOREACH_SAFE(vf, vd) \ #define VSM_FOREACH_SAFE(vf, vd) \
for(VSM__iter0((vd), (vf)); VSM__itern((vd), (vf));) for(VSM__iter0((vd), (vf)); VSM__itern((vd), (vf));)
...@@ -137,7 +137,7 @@ int VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf); ...@@ -137,7 +137,7 @@ int VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf);
* vd = "struct VSM_data *" * vd = "struct VSM_data *"
*/ */
int VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf); int VSM_StillValid(const struct VSM_data *vd, struct VSM_fantom *vf);
/* /*
* Return: * Return:
* 0: fantom is invalid now. * 0: fantom is invalid now.
...@@ -145,8 +145,8 @@ int VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf); ...@@ -145,8 +145,8 @@ int VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf);
* 2: a fantom with same dimensions exist, check class/type/ident * 2: a fantom with same dimensions exist, check class/type/ident
*/ */
int VSM_Get(struct VSM_data *vd, struct VSM_fantom *vf, const char *class, int VSM_Get(const struct VSM_data *vd, struct VSM_fantom *vf,
const char *type, const char *ident); const char *class, const char *type, const char *ident);
/* /*
* Find a chunk, produce fantom for it. * Find a chunk, produce fantom for it.
* Returns zero on failure. * Returns zero on failure.
...@@ -166,7 +166,7 @@ void VSM_Close(struct VSM_data *vd); ...@@ -166,7 +166,7 @@ void VSM_Close(struct VSM_data *vd);
*/ */
/* OBSOLETE: Will disappear from Varnish 4.x */ /* OBSOLETE: Will disappear from Varnish 4.x */
void *VSM_Find_Chunk(struct VSM_data *vd, const char *class, void *VSM_Find_Chunk(const struct VSM_data *vd, const char *class,
const char *type, const char *ident, unsigned *lenp); const char *type, const char *ident, unsigned *lenp);
/* /*
* Find a given chunk in the shared memory. * Find a given chunk in the shared memory.
......
...@@ -222,7 +222,7 @@ VSC_Open(struct VSM_data *vd, int diag) ...@@ -222,7 +222,7 @@ VSC_Open(struct VSM_data *vd, int diag)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
struct VSC_C_main * struct VSC_C_main *
VSC_Main(struct VSM_data *vd) VSC_Main(const struct VSM_data *vd)
{ {
struct VSM_fantom vf; struct VSM_fantom vf;
...@@ -316,7 +316,7 @@ iter_call(const struct vsc *vsc, VSC_iter_f *func, void *priv, ...@@ -316,7 +316,7 @@ iter_call(const struct vsc *vsc, VSC_iter_f *func, void *priv,
#undef VSC_DONE #undef VSC_DONE
int int
VSC_Iter(struct VSM_data *vd, VSC_iter_f *func, void *priv) VSC_Iter(const struct VSM_data *vd, VSC_iter_f *func, void *priv)
{ {
struct vsc *vsc; struct vsc *vsc;
struct VSM_fantom vf; struct VSM_fantom vf;
......
...@@ -294,7 +294,7 @@ VSL_Dispatch(struct VSM_data *vd, VSL_handler_f *func, void *priv) ...@@ -294,7 +294,7 @@ VSL_Dispatch(struct VSM_data *vd, VSL_handler_f *func, void *priv)
s |= VSL_S_CLIENT; s |= VSL_S_CLIENT;
if (VSL_BACKEND(p)) if (VSL_BACKEND(p))
s |= VSL_S_BACKEND; s |= VSL_S_BACKEND;
if (func(priv, VSL_TAG(p), u, l, s, VSL_DATA(p), bitmap)) if (func(priv, (enum VSL_tag_e)VSL_TAG(p), u, l, s, VSL_DATA(p), bitmap))
return (1); return (1);
} }
} }
...@@ -326,7 +326,8 @@ VSL_H_Print(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len, ...@@ -326,7 +326,8 @@ VSL_H_Print(void *priv, enum VSL_tag_e tag, unsigned fd, unsigned len,
fprintf(fo, "\"\n"); fprintf(fo, "\"\n");
return (0); return (0);
} }
fprintf(fo, "%5u %-12s %c %.*s\n", fd, VSL_tags[tag], type, len, ptr); fprintf(fo, "%5u %-12s %c %.*s\n",
fd, VSL_tags[tag], type, (int)len, ptr);
return (0); return (0);
} }
......
...@@ -46,7 +46,6 @@ ...@@ -46,7 +46,6 @@
#include "vapi/vsm.h" #include "vapi/vsm.h"
#include "vapi/vsm_int.h" #include "vapi/vsm_int.h"
#include "vbm.h"
#include "vin.h" #include "vin.h"
#include "vsm_api.h" #include "vsm_api.h"
...@@ -288,7 +287,7 @@ VSM_Head(const struct VSM_data *vd) ...@@ -288,7 +287,7 @@ VSM_Head(const struct VSM_data *vd)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void void
VSM__iter0(struct VSM_data *vd, struct VSM_fantom *vf) VSM__iter0(const struct VSM_data *vd, struct VSM_fantom *vf)
{ {
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC); CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
...@@ -296,7 +295,7 @@ VSM__iter0(struct VSM_data *vd, struct VSM_fantom *vf) ...@@ -296,7 +295,7 @@ VSM__iter0(struct VSM_data *vd, struct VSM_fantom *vf)
} }
int int
VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf) VSM__itern(const struct VSM_data *vd, struct VSM_fantom *vf)
{ {
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC); CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
...@@ -327,7 +326,7 @@ VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf) ...@@ -327,7 +326,7 @@ VSM__itern(struct VSM_data *vd, struct VSM_fantom *vf)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
int int
VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf) VSM_StillValid(const struct VSM_data *vd, struct VSM_fantom *vf)
{ {
struct VSM_fantom f2; struct VSM_fantom f2;
...@@ -346,8 +345,8 @@ VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf) ...@@ -346,8 +345,8 @@ VSM_StillValid(struct VSM_data *vd, struct VSM_fantom *vf)
} }
int int
VSM_Get(struct VSM_data *vd, struct VSM_fantom *vf, const char *class, VSM_Get(const struct VSM_data *vd, struct VSM_fantom *vf,
const char *type, const char *ident) const char *class, const char *type, const char *ident)
{ {
CHECK_OBJ_NOTNULL(vd, VSM_MAGIC); CHECK_OBJ_NOTNULL(vd, VSM_MAGIC);
...@@ -367,8 +366,8 @@ VSM_Get(struct VSM_data *vd, struct VSM_fantom *vf, const char *class, ...@@ -367,8 +366,8 @@ VSM_Get(struct VSM_data *vd, struct VSM_fantom *vf, const char *class,
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void * void *
VSM_Find_Chunk(struct VSM_data *vd, const char *class, const char *type, VSM_Find_Chunk(const struct VSM_data *vd, const char *class,
const char *ident, unsigned *lenp) const char *type, const char *ident, unsigned *lenp)
{ {
struct VSM_fantom vf; struct VSM_fantom vf;
......
...@@ -56,8 +56,5 @@ struct VSM_data { ...@@ -56,8 +56,5 @@ struct VSM_data {
struct vsl *vsl; struct vsl *vsl;
}; };
struct VSM_chunk *VSM_find_alloc(struct VSM_data *vd, const char *class,
const char *type, const char *ident);
void VSC_Delete(struct VSM_data *vd); void VSC_Delete(struct VSM_data *vd);
void VSL_Delete(struct VSM_data *vd); void VSL_Delete(struct VSM_data *vd);
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