Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Nov 2012 22:53:57 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r243313 - in head/tools/regression/sockets: sblock unix_seqpacket_exercise zerosend
Message-ID:  <201211192253.qAJMrvYt057344@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Mon Nov 19 22:53:57 2012
New Revision: 243313
URL: http://svnweb.freebsd.org/changeset/base/243313

Log:
  Use '%zd' format specifier for ssize_t
  
  Found by: clang

Modified:
  head/tools/regression/sockets/sblock/sblock.c
  head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c
  head/tools/regression/sockets/zerosend/zerosend.c

Modified: head/tools/regression/sockets/sblock/sblock.c
==============================================================================
--- head/tools/regression/sockets/sblock/sblock.c	Mon Nov 19 22:46:17 2012	(r243312)
+++ head/tools/regression/sockets/sblock/sblock.c	Mon Nov 19 22:53:57 2012	(r243313)
@@ -76,7 +76,7 @@ blocking_recver(int fd)
 	if (len == 0)
 		errx(-1, "FAIL: blocking_recver: recv: eof");
 	if (len != 1)
-		errx(-1, "FAIL: blocking_recver: recv: %d bytes", len);
+		errx(-1, "FAIL: blocking_recver: recv: %zd bytes", len);
 	if (interrupted)
 		errx(-1, "FAIL: blocking_recver: interrupted wrong pid");
 }
@@ -134,7 +134,7 @@ signaller(pid_t locking_recver_pid, int 
 		return;
 	}
 	if (len != sizeof(ch)) {
-		warnx("signaller send ret %d", len);
+		warnx("signaller send ret %zd", len);
 		return;
 	}
 	if (close(fd) < 0) {

Modified: head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c
==============================================================================
--- head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c	Mon Nov 19 22:46:17 2012	(r243312)
+++ head/tools/regression/sockets/unix_seqpacket_exercise/unix_seqpacket_exercise.c	Mon Nov 19 22:53:57 2012	(r243313)
@@ -50,21 +50,21 @@ __FBSDID("$FreeBSD$");
 #define	SEQPACKET_SNDBUF	(131072-16)
 
 #define	FAILERR(str)		err(-1, "%s: %s", __func__, str)
-#define	FAILNERR(str, n)	err(-1, "%s %d: %s", __func__, n, str)
-#define	FAILNMERR(str, n, m)	err(-1, "%s %d %d: %s", __func__, n, m, str)
+#define	FAILNERR(str, n)	err(-1, "%s %zd: %s", __func__, n, str)
+#define	FAILNMERR(str, n, m)	err(-1, "%s %zd %d: %s", __func__, n, m, str)
 #define	FAILERRX(str)		errx(-1, "%s: %s", __func__, str)
-#define	FAILNERRX(str, n)	errx(-1, "%s %d: %s", __func__, n, str)
-#define	FAILNMERRX(str, n, m)	errx(-1, "%s %d %d: %s", __func__, n, m, str)
+#define	FAILNERRX(str, n)	errx(-1, "%s %zd: %s", __func__, n, str)
+#define	FAILNMERRX(str, n, m)	errx(-1, "%s %zd %d: %s", __func__, n, m, str)
 
 static int ann = 0;
 
 #define	ANN()		(ann ? warnx("%s: start", __func__) : 0)
-#define	ANNN(n)		(ann ? warnx("%s %d: start", __func__, (n)) : 0)
-#define	ANNNM(n, m)	(ann ? warnx("%s %d %d: start", __func__, (n), (m)) : 0)
+#define	ANNN(n)		(ann ? warnx("%s %zd: start", __func__, (n)) : 0)
+#define	ANNNM(n, m)	(ann ? warnx("%s %zd %d: start", __func__, (n), (m)):0)
 
 #define	OK()		warnx("%s: ok", __func__)
-#define	OKN(n)		warnx("%s %d: ok", __func__, (n))
-#define	OKNM(n, m)	warnx("%s %d %d: ok", __func__, (n), (m))
+#define	OKN(n)		warnx("%s %zd: ok", __func__, (n))
+#define	OKNM(n, m)	warnx("%s %zd %d: ok", __func__, (n), (m))
 
 #ifdef SO_NOSIGPIPE
 #define	NEW_SOCKET(s) do {						\
@@ -168,7 +168,7 @@ server(int s_listen)
 					break;
 				}
 				if (ssize_send != ssize_recv)
-					warnx("server: recv %d sent %d",
+					warnx("server: recv %zd sent %zd",
 					    ssize_recv, ssize_send);
 			} while (1);
 			close(s_accept);

Modified: head/tools/regression/sockets/zerosend/zerosend.c
==============================================================================
--- head/tools/regression/sockets/zerosend/zerosend.c	Mon Nov 19 22:46:17 2012	(r243312)
+++ head/tools/regression/sockets/zerosend/zerosend.c	Mon Nov 19 22:53:57 2012	(r243313)
@@ -56,7 +56,7 @@ try_0send(const char *test, int fd)
 	if (len < 0)
 		err(-1, "%s: try_0send", test);
 	if (len != 0)
-		errx(-1, "%s: try_0send: returned %d", test, len);
+		errx(-1, "%s: try_0send: returned %zd", test, len);
 }
 
 static void
@@ -70,7 +70,7 @@ try_0write(const char *test, int fd)
 	if (len < 0)
 		err(-1, "%s: try_0write", test);
 	if (len != 0)
-		errx(-1, "%s: try_0write: returned %d", test, len);
+		errx(-1, "%s: try_0write: returned %zd", test, len);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211192253.qAJMrvYt057344>