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

More FlexeLinting

parent af0c665e
...@@ -137,7 +137,6 @@ ...@@ -137,7 +137,6 @@
// Review all below this line /////////////////////////////////////////////// // Review all below this line ///////////////////////////////////////////////
-e713 // 42 Loss of precision (___) (___ to ___) -e713 // 42 Loss of precision (___) (___ to ___)
-e574 // 48 Signed-unsigned mix with relational
-e840 // Use of nul character in a string literal (see: vcc_if.c) -e840 // Use of nul character in a string literal (see: vcc_if.c)
-e663 // Suspicious array to pointer conversion -e663 // Suspicious array to pointer conversion
-e778 // Constant expression evaluates to 0 in operation '___' -e778 // Constant expression evaluates to 0 in operation '___'
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
-e732 // Loss of sign (arg. no. 2) (int to unsigned -e732 // Loss of sign (arg. no. 2) (int to unsigned
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
-e788 // enum constant '___' not used within defaulted switch -e788 // enum constant '___' not used within defaulted switch
-e641 // Converting enum '___' to '___' -e641 // Converting enum '___' to '___'
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
-e767 // Macro redef (system queue.h vs ours ) -e767 // Macro redef (system queue.h vs ours )
-e574 // Signed-unsigned mix with relational
-e712 // Loss of precision (assignment) (long long to -e712 // Loss of precision (assignment) (long long to
-e747 // Significant prototype coercion (arg. no. 2) long -e747 // Significant prototype coercion (arg. no. 2) long
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
-e732 // Loss of sign (arg. no. 2) (int to unsigned -e732 // Loss of sign (arg. no. 2) (int to unsigned
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// Varnishstat specific // Varnishstat specific
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
-e732 // Loss of sign (arg. no. 2) (int to unsigned -e732 // Loss of sign (arg. no. 2) (int to unsigned
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// Varnishstat specific // Varnishstat specific
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// General stylistic issues // General stylistic issues
-e574 // Signed-unsigned mix with relational
-e641 // Converting enum '...' to int -e641 // Converting enum '...' to int
-e716 // while(1) ... -e716 // while(1) ...
-e726 // Extraneous comma ignored -e726 // Extraneous comma ignored
......
...@@ -75,9 +75,10 @@ ...@@ -75,9 +75,10 @@
#define REPLACE(ptr, val) \ #define REPLACE(ptr, val) \
do { \ do { \
const char *_vreplace = (val); \
free(ptr); \ free(ptr); \
if ((val) != NULL) { \ if (_vreplace != NULL) { \
ptr = strdup(val); \ ptr = strdup(_vreplace); \
AN((ptr)); \ AN((ptr)); \
} else { \ } else { \
ptr = NULL; \ ptr = NULL; \
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
-e732 // Loss of sign (arg. no. 2) (int to unsigned -e732 // Loss of sign (arg. no. 2) (int to unsigned
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
-e712 // Loss of precision (assignment) (long long to -e712 // Loss of precision (assignment) (long long to
-e747 // Significant prototype coercion (arg. no. 2) long -e747 // Significant prototype coercion (arg. no. 2) long
......
...@@ -172,7 +172,7 @@ vsl_match_IX(struct VSL_data *vsl, const vslf_list *list, ...@@ -172,7 +172,7 @@ vsl_match_IX(struct VSL_data *vsl, const vslf_list *list,
const struct vslf *vslf; const struct vslf *vslf;
(void)vsl; (void)vsl;
tag = VSL_TAG(c->rec.ptr); tag = (enum VSL_tag_e)VSL_TAG(c->rec.ptr);
cdata = VSL_CDATA(c->rec.ptr); cdata = VSL_CDATA(c->rec.ptr);
len = VSL_LEN(c->rec.ptr); len = VSL_LEN(c->rec.ptr);
...@@ -194,7 +194,7 @@ VSL_Match(struct VSL_data *vsl, const struct VSL_cursor *c) ...@@ -194,7 +194,7 @@ VSL_Match(struct VSL_data *vsl, const struct VSL_cursor *c)
CHECK_OBJ_NOTNULL(vsl, VSL_MAGIC); CHECK_OBJ_NOTNULL(vsl, VSL_MAGIC);
if (c == NULL || c->rec.ptr == NULL) if (c == NULL || c->rec.ptr == NULL)
return (0); return (0);
tag = VSL_TAG(c->rec.ptr); tag = (enum VSL_tag_e)VSL_TAG(c->rec.ptr);
if (tag <= SLT__Bogus || tag >= SLT__Reserved) if (tag <= SLT__Bogus || tag >= SLT__Reserved)
return (0); return (0);
if (vsl->c_opt && !VSL_CLIENT(c->rec.ptr)) if (vsl->c_opt && !VSL_CLIENT(c->rec.ptr))
...@@ -245,7 +245,7 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo) ...@@ -245,7 +245,7 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
return (0); return (0);
if (fo == NULL) if (fo == NULL)
fo = stdout; fo = stdout;
tag = VSL_TAG(c->rec.ptr); tag = (enum VSL_tag_e)VSL_TAG(c->rec.ptr);
vxid = VSL_ID(c->rec.ptr); vxid = VSL_ID(c->rec.ptr);
len = VSL_LEN(c->rec.ptr); len = VSL_LEN(c->rec.ptr);
type = VSL_CLIENT(c->rec.ptr) ? 'c' : VSL_BACKEND(c->rec.ptr) ? type = VSL_CLIENT(c->rec.ptr) ? 'c' : VSL_BACKEND(c->rec.ptr) ?
...@@ -283,7 +283,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo) ...@@ -283,7 +283,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
return (0); return (0);
if (fo == NULL) if (fo == NULL)
fo = stdout; fo = stdout;
tag = VSL_TAG(c->rec.ptr); tag = (enum VSL_tag_e)VSL_TAG(c->rec.ptr);
len = VSL_LEN(c->rec.ptr); len = VSL_LEN(c->rec.ptr);
data = VSL_CDATA(c->rec.ptr); data = VSL_CDATA(c->rec.ptr);
......
...@@ -859,7 +859,7 @@ vtx_scan(struct VSLQ *vslq, struct vtx *vtx) ...@@ -859,7 +859,7 @@ vtx_scan(struct VSLQ *vslq, struct vtx *vtx)
continue; continue;
} }
tag = VSL_TAG(ptr); tag = (enum VSL_tag_e)VSL_TAG(ptr);
assert(tag != SLT__Batch); assert(tag != SLT__Batch);
switch (tag) { switch (tag) {
...@@ -1247,14 +1247,14 @@ vslq_next(struct VSLQ *vslq) ...@@ -1247,14 +1247,14 @@ vslq_next(struct VSLQ *vslq)
if (i != 1) if (i != 1)
return (i); return (i);
tag = VSL_TAG(c->rec.ptr); tag = (enum VSL_tag_e)VSL_TAG(c->rec.ptr);
if (tag == SLT__Batch) { if (tag == SLT__Batch) {
vxid = VSL_BATCHID(c->rec.ptr); vxid = VSL_BATCHID(c->rec.ptr);
len = VSL_END(c->rec.ptr, VSL_BATCHLEN(c->rec.ptr)) - len = VSL_END(c->rec.ptr, VSL_BATCHLEN(c->rec.ptr)) -
c->rec.ptr; c->rec.ptr;
if (len == 0) if (len == 0)
return (i); return (i);
tag = VSL_TAG(VSL_NEXT(c->rec.ptr)); tag = (enum VSL_tag_e)VSL_TAG(VSL_NEXT(c->rec.ptr));
} else { } else {
vxid = VSL_ID(c->rec.ptr); vxid = VSL_ID(c->rec.ptr);
len = VSL_NEXT(c->rec.ptr) - c->rec.ptr; len = VSL_NEXT(c->rec.ptr) - c->rec.ptr;
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
-e506 // Constant value boolean -e506 // Constant value boolean
-e774 // Boolean within 'if' always evaluates to False -e774 // Boolean within 'if' always evaluates to False
-e713 // Loss of precision (assignment) (unsigned long long to long long) -e713 // Loss of precision (assignment) (unsigned long long to long long)
-e574 // Signed-unsigned mix with relational
-e539 // Did not expect positive indentation -e539 // Did not expect positive indentation
-e734 // Loss of precision (assignment) (31 bits to 8 bits) -e734 // Loss of precision (assignment) (31 bits to 8 bits)
-e747 // Significant prototype coercion (arg. no. 2) long -e747 // Significant prototype coercion (arg. no. 2) long
......
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