diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-12-18 18:28:40 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-12-18 18:28:40 +0000 |
commit | b137578a69dfa31265779c4e4f7d30fd9ebc4b2e (patch) | |
tree | d0d012cd294619eb57e56ad3ef1a12d06c18b833 | |
parent | 62ac240a38c3dca6e543c007d142407ac47631c7 (diff) |
Use %zu/%d to print size_t/ssize_t. Cast recno_t (a.k.a. u_int32_t)
to (unsigned long) to match %lu formats. Makes gcc happier and
quieter.
ok deraadt@
-rw-r--r-- | sys/dev/microcode/bnx/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/cirruslogic/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/fxp/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/kue/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/tusb3410/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/typhoon/build.c | 4 | ||||
-rw-r--r-- | sys/dev/microcode/yds/build.c | 4 | ||||
-rw-r--r-- | usr.bin/vi/common/msg.c | 9 |
8 files changed, 19 insertions, 18 deletions
diff --git a/sys/dev/microcode/bnx/build.c b/sys/dev/microcode/bnx/build.c index 2b8a66f936f..665b243b719 100644 --- a/sys/dev/microcode/bnx/build.c +++ b/sys/dev/microcode/bnx/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.7 2014/07/12 19:01:49 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.8 2016/12/18 18:28:38 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -149,7 +149,7 @@ write_firmware(char *filename, void *header, size_t hlen, printf("\n"); errx(1, "%s: short write", filename); } - printf("+%d", rlen); + printf("+%zd", rlen); fflush(stdout); total += rlen; } diff --git a/sys/dev/microcode/cirruslogic/build.c b/sys/dev/microcode/cirruslogic/build.c index 724b47e8fe1..bd956ca412d 100644 --- a/sys/dev/microcode/cirruslogic/build.c +++ b/sys/dev/microcode/cirruslogic/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.2 2005/05/17 18:48:52 jason Exp $ */ +/* $OpenBSD: build.c,v 1.3 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -30,7 +30,7 @@ main(int argc, char *argv[]) ssize_t rlen; int fd; - printf("creating %s length %d\n", FILENAME, sizeof BA1Struct); + printf("creating %s length %zu\n", FILENAME, sizeof BA1Struct); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (fd == -1) err(1, "%s", FILENAME); diff --git a/sys/dev/microcode/fxp/build.c b/sys/dev/microcode/fxp/build.c index 7fd5ed0bb69..80b4eb1d413 100644 --- a/sys/dev/microcode/fxp/build.c +++ b/sys/dev/microcode/fxp/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.3 2005/05/17 18:48:52 jason Exp $ */ +/* $OpenBSD: build.c,v 1.4 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -44,7 +44,7 @@ output(const char *name, const u_int32_t *ucode, const int ucode_len) int fd, i; u_int32_t dword; - printf("creating %s length %d (microcode: %d DWORDS)\n", + printf("creating %s length %d (microcode: %zu DWORDS)\n", name, ucode_len, ucode_len / sizeof(u_int32_t)); fd = open(name, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (fd == -1) diff --git a/sys/dev/microcode/kue/build.c b/sys/dev/microcode/kue/build.c index 9e8e2e7db5a..a162c8103dc 100644 --- a/sys/dev/microcode/kue/build.c +++ b/sys/dev/microcode/kue/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.6 2014/07/12 19:01:49 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.7 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -53,7 +53,7 @@ main(int argc, char *argv[]) &kf->data[sizeof(kue_code_seg) + sizeof(kue_fix_seg)], sizeof(kue_trig_seg)); - printf("creating %s length %d [%d+%d+%d]\n", + printf("creating %s length %d [%zu+%zu+%zu]\n", FILENAME, len, sizeof(kue_code_seg), sizeof(kue_fix_seg), sizeof(kue_trig_seg)); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); diff --git a/sys/dev/microcode/tusb3410/build.c b/sys/dev/microcode/tusb3410/build.c index 2260c39b4bb..41d9d4c582f 100644 --- a/sys/dev/microcode/tusb3410/build.c +++ b/sys/dev/microcode/tusb3410/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.4 2014/07/13 07:06:23 mpi Exp $ */ +/* $OpenBSD: build.c,v 1.5 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -32,7 +32,7 @@ main(int argc, char *argv[]) ssize_t rlen; int fd; - printf("creating %s length %d\n", FILENAME, sizeof uticom_fw_3410); + printf("creating %s length %zu\n", FILENAME, sizeof uticom_fw_3410); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (fd == -1) err(1, "%s", FILENAME); diff --git a/sys/dev/microcode/typhoon/build.c b/sys/dev/microcode/typhoon/build.c index 0e1f83b17b3..5801194068a 100644 --- a/sys/dev/microcode/typhoon/build.c +++ b/sys/dev/microcode/typhoon/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.2 2005/05/17 18:48:52 jason Exp $ */ +/* $OpenBSD: build.c,v 1.3 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -42,7 +42,7 @@ main(int argc, char *argv[]) int fd; ssize_t rlen; - printf("creating %s length %d\n", FILENAME, sizeof tc990image); + printf("creating %s length %zu\n", FILENAME, sizeof tc990image); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); if (fd == -1) err(1, "%s", FILENAME); diff --git a/sys/dev/microcode/yds/build.c b/sys/dev/microcode/yds/build.c index e1ac354ce70..f515ff9b7b8 100644 --- a/sys/dev/microcode/yds/build.c +++ b/sys/dev/microcode/yds/build.c @@ -1,4 +1,4 @@ -/* $OpenBSD: build.c,v 1.6 2014/07/12 19:01:50 tedu Exp $ */ +/* $OpenBSD: build.c,v 1.7 2016/12/18 18:28:39 krw Exp $ */ /* * Copyright (c) 2004 Theo de Raadt <deraadt@openbsd.org> @@ -69,7 +69,7 @@ main(int argc, char *argv[]) sizeof(yds_ds1_ctrl_mcode)], sizeof(yds_ds1e_ctrl_mcode)); - printf("creating %s length %d [%d+%d+%d]\n", + printf("creating %s length %d [%zu+%zu+%zu]\n", FILENAME, len, sizeof(yds_dsp_mcode), sizeof(yds_ds1_ctrl_mcode), sizeof(yds_ds1e_ctrl_mcode)); fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0644); diff --git a/usr.bin/vi/common/msg.c b/usr.bin/vi/common/msg.c index 4d164ad1236..322a14c574c 100644 --- a/usr.bin/vi/common/msg.c +++ b/usr.bin/vi/common/msg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msg.c,v 1.26 2016/01/06 22:29:38 millert Exp $ */ +/* $OpenBSD: msg.c,v 1.27 2016/12/18 18:28:39 krw Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -438,12 +438,13 @@ msgq_status(SCR *sp, recno_t lno, u_int flags) memcpy(p, "empty file", len); p += len; } else { - (void)snprintf(p, ep - p, "line %lu of %lu [%ld%%]", - lno, last, (lno * 100) / last); + (void)snprintf(p, ep - p, "line %lu of %lu [%lu%%]", + (unsigned long)lno, (unsigned long)last, + (unsigned long)(lno * 100) / last); p += strlen(p); } } else { - (void)snprintf(p, ep - p, "line %lu", lno); + (void)snprintf(p, ep - p, "line %lu", (unsigned long)lno); p += strlen(p); } #ifdef DEBUG |