[master] 94414c2a4 More signed/unsigned FlexeLinting

Poul-Henning Kamp phk at FreeBSD.org
Thu Apr 18 09:32:08 UTC 2019


commit 94414c2a49a9b547026037e48cdc20b39b7c554d
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Apr 18 09:31:38 2019 +0000

    More signed/unsigned FlexeLinting

diff --git a/include/vapi/voptget.h b/include/vapi/voptget.h
index f01ac94f9..51de7c683 100644
--- a/include/vapi/voptget.h
+++ b/include/vapi/voptget.h
@@ -44,7 +44,7 @@ struct vopt_list {
 
 struct vopt_spec {
 	const struct vopt_list	*vopt_list;
-	unsigned		vopt_list_n;
+	int			vopt_list_n;
 	const char		*vopt_optstring;
 	const char		*vopt_synopsis;
 	const char		**vopt_usage;
diff --git a/include/vapi/vsl.h b/include/vapi/vsl.h
index f91c6615a..8a8872acb 100644
--- a/include/vapi/vsl.h
+++ b/include/vapi/vsl.h
@@ -109,7 +109,7 @@ enum VSL_reason_e {
 };
 
 struct VSL_transaction {
-	unsigned		level;
+	int			level;
 	uint32_t		vxid;
 	uint32_t		vxid_parent;
 	enum VSL_transaction_e	type;
diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index 1818767a2..2c3c160fd 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -363,7 +363,7 @@ VSL_PrintTransactions(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 		if (t->level) {
 			/* Print header */
 			if (t->level > 3)
-				VSL_PRINT(fo, "*%1.1u* ", t->level);
+				VSL_PRINT(fo, "*%1.1d* ", t->level);
 			else
 				VSL_PRINT(fo, "%-3.*s ",
 				    (int)(t->level), "***");
@@ -385,7 +385,7 @@ VSL_PrintTransactions(struct VSL_data *vsl, struct VSL_transaction * const pt[],
 			if (!VSL_Match(vsl, t->c))
 				continue;
 			if (t->level > 3)
-				VSL_PRINT(fo, "-%1.1u- ", t->level);
+				VSL_PRINT(fo, "-%1.1d- ", t->level);
 			else if (t->level)
 				VSL_PRINT(fo, "%-3.*s ",
 				    (int)(t->level), "---");
diff --git a/lib/libvarnishapi/vsl_cursor.c b/lib/libvarnishapi/vsl_cursor.c
index 652751c52..c9505d484 100644
--- a/lib/libvarnishapi/vsl_cursor.c
+++ b/lib/libvarnishapi/vsl_cursor.c
@@ -323,7 +323,7 @@ vslc_file_delete(const struct VSL_cursor *cursor)
 
 /* Read n bytes from fd into buf */
 static ssize_t
-vslc_file_readn(int fd, void *buf, size_t n)
+vslc_file_readn(int fd, void *buf, ssize_t n)
 {
 	ssize_t t = 0;
 	ssize_t l;
diff --git a/lib/libvarnishapi/vsl_dispatch.c b/lib/libvarnishapi/vsl_dispatch.c
index 57c45168f..fb284a58a 100644
--- a/lib/libvarnishapi/vsl_dispatch.c
+++ b/lib/libvarnishapi/vsl_dispatch.c
@@ -189,7 +189,7 @@ struct VSLQ {
 	struct vtx_tree		tree;
 	VTAILQ_HEAD(,vtx)	ready;
 	VTAILQ_HEAD(,vtx)	incomplete;
-	unsigned		n_outstanding;
+	int			n_outstanding;
 	struct chunkhead	shmrefs;
 	VTAILQ_HEAD(,vtx)	cache;
 	unsigned		n_cache;
@@ -205,7 +205,7 @@ struct VSLQ {
 		struct VSL_transaction	*ptrans[2];
 		struct VSLC_ptr		start;
 		ssize_t			len;
-		size_t			offset;
+		ssize_t			offset;
 	} raw;
 };
 


More information about the varnish-commit mailing list