[3.0] 7ab7c49 Various code-polishings to make OmnitiOS happy.

Tollef Fog Heen tfheen at varnish-cache.org
Thu Apr 25 14:55:37 CEST 2013


commit 7ab7c4998adbf604736e4eebe7e64c8993798eb8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Sep 6 12:05:04 2012 +0000

    Various code-polishings to make OmnitiOS happy.
    
    Some of them are rather pedantic:  "NULL" vs "(char*)0" -- Really ?

diff --git a/bin/varnishd/cache_waiter_ports.c b/bin/varnishd/cache_waiter_ports.c
index e599260..364dd2c 100644
--- a/bin/varnishd/cache_waiter_ports.c
+++ b/bin/varnishd/cache_waiter_ports.c
@@ -159,7 +159,8 @@ vca_main(void *arg)
 
 	while (1) {
 		port_event_t ev[MAX_EVENTS];
-		int nevents, ei, ret;
+		uint_t nevents;
+		int ei, ret;
 		double now, deadline;
 
 		/*
@@ -242,6 +243,7 @@ vca_main(void *arg)
 			timeout = &max_ts;
 		}
 	}
+	NEEDLESS_RETURN(NULL);
 }
 
 static void
diff --git a/bin/varnishd/mgt_child.c b/bin/varnishd/mgt_child.c
index ee74452..9f2a94d 100644
--- a/bin/varnishd/mgt_child.c
+++ b/bin/varnishd/mgt_child.c
@@ -478,7 +478,7 @@ mgt_sigchld(const struct vev *e, int what)
 	assert(r == child_pid);
 	vsb = VSB_new_auto();
 	XXXAN(vsb);
-	VSB_printf(vsb, "Child (%d) %s", r, status ? "died" : "ended");
+	VSB_printf(vsb, "Child (%ld) %s", (long)r, status ? "died" : "ended");
 	if (WIFEXITED(status) && WEXITSTATUS(status)) {
 		VSB_printf(vsb, " status=%d", WEXITSTATUS(status));
 		exit_status |= 0x20;
diff --git a/bin/varnishd/mgt_vcc.c b/bin/varnishd/mgt_vcc.c
index b39c245..cb7e6a3 100644
--- a/bin/varnishd/mgt_vcc.c
+++ b/bin/varnishd/mgt_vcc.c
@@ -174,7 +174,7 @@ run_vcc(void *priv)
 static void
 run_cc(void *priv)
 {
-	(void)execl("/bin/sh", "/bin/sh", "-c", priv, NULL);
+	(void)execl("/bin/sh", "/bin/sh", "-c", priv, (char*)0);
 }
 
 /*--------------------------------------------------------------------
diff --git a/bin/varnishd/storage_persistent.c b/bin/varnishd/storage_persistent.c
index 8acbc20..8e5910a 100644
--- a/bin/varnishd/storage_persistent.c
+++ b/bin/varnishd/storage_persistent.c
@@ -321,7 +321,7 @@ smp_open(const struct stevedore *st)
 	/* We trust the parent to give us a valid silo, for good measure: */
 	AZ(smp_valid_silo(sc));
 
-	AZ(mprotect(sc->base, 4096, PROT_READ));
+	AZ(mprotect((void*)sc->base, 4096, PROT_READ));
 
 	sc->ident = SIGN_DATA(&sc->idn);
 
diff --git a/bin/varnishd/storage_persistent_mgt.c b/bin/varnishd/storage_persistent_mgt.c
index 3bd5809..f1cfee6 100644
--- a/bin/varnishd/storage_persistent_mgt.c
+++ b/bin/varnishd/storage_persistent_mgt.c
@@ -168,7 +168,7 @@ smp_mgt_init(struct stevedore *parent, int ac, char * const *av)
 	else
 		target = NULL;
 
-	sc->base = mmap(target, sc->mediasize, PROT_READ|PROT_WRITE,
+	sc->base = (void*)mmap(target, sc->mediasize, PROT_READ|PROT_WRITE,
 	    MAP_NOCORE | MAP_NOSYNC | MAP_SHARED, sc->fd, 0);
 
 	if (sc->base == MAP_FAILED)
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 56db682..fcd299c 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -390,10 +390,10 @@ varnish_launch(struct varnish *v)
 		AZ(close(v->fds[3]));
 		for (i = 3; i <getdtablesize(); i++)
 			(void)close(i);
-		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(vsb), NULL));
+		AZ(execl("/bin/sh", "/bin/sh", "-c", VSB_data(vsb), (char*)0));
 		exit(1);
 	} else {
-		vtc_log(v->vl, 3, "PID: %d", v->pid);
+		vtc_log(v->vl, 3, "PID: %ld", (long)v->pid);
 	}
 	AZ(close(v->fds[0]));
 	AZ(close(v->fds[3]));



More information about the varnish-commit mailing list