Module Name:    src
Committed By:   christos
Date:           Mon Sep  9 23:27:43 UTC 2013

Modified Files:
        src/usr.sbin/mtree: compare.c create.c spec.c

Log Message:
use intmax_t instead of long long. fixes wrong cast for time_t.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/usr.sbin/mtree/compare.c
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/mtree/create.c
cvs rdiff -u -r1.85 -r1.86 src/usr.sbin/mtree/spec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/mtree/compare.c
diff -u src/usr.sbin/mtree/compare.c:1.55 src/usr.sbin/mtree/compare.c:1.56
--- src/usr.sbin/mtree/compare.c:1.55	Thu Oct  4 20:59:35 2012
+++ src/usr.sbin/mtree/compare.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $	*/
+/*	$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)compare.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: compare.c,v 1.55 2012/10/05 00:59:35 christos Exp $");
+__RCSID("$NetBSD: compare.c,v 1.56 2013/09/09 23:27:43 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -192,9 +192,9 @@ typeerr:		LABEL;
 	    (s->type == F_BLOCK || s->type == F_CHAR) &&
 	    s->st_rdev != p->fts_statp->st_rdev) {
 		LABEL;
-		printf("%sdevice (%#llx, %#llx",
-		    tab, (long long)s->st_rdev,
-		    (long long)p->fts_statp->st_rdev);
+		printf("%sdevice (%#jx, %#jx",
+		    tab, (uintmax_t)s->st_rdev,
+		    (uintmax_t)p->fts_statp->st_rdev);
 		if (uflag) {
 			if ((unlink(p->fts_accpath) == -1) ||
 			    (mknod(p->fts_accpath,
@@ -283,9 +283,9 @@ typeerr:		LABEL;
 	}
 	if (s->flags & F_SIZE && s->st_size != p->fts_statp->st_size) {
 		LABEL;
-		printf("%ssize (%lld, %lld)\n",
-		    tab, (long long)s->st_size,
-		    (long long)p->fts_statp->st_size);
+		printf("%ssize (%ju, %ju)\n",
+		    tab, (uintmax_t)s->st_size,
+		    (uintmax_t)p->fts_statp->st_size);
 		tab = "\t";
 	}
 	/*

Index: src/usr.sbin/mtree/create.c
diff -u src/usr.sbin/mtree/create.c:1.69 src/usr.sbin/mtree/create.c:1.70
--- src/usr.sbin/mtree/create.c:1.69	Sun Feb  3 14:15:17 2013
+++ src/usr.sbin/mtree/create.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $	*/
+/*	$NetBSD: create.c,v 1.70 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)create.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: create.c,v 1.69 2013/02/03 19:15:17 christos Exp $");
+__RCSID("$NetBSD: create.c,v 1.70 2013/09/09 23:27:43 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -216,22 +216,22 @@ statf(int indent, FTSENT *p)
 		    p->fts_statp->st_mode & MBITS);
 	if (keys & F_DEV &&
 	    (S_ISBLK(p->fts_statp->st_mode) || S_ISCHR(p->fts_statp->st_mode)))
-		output(indent, &offset, "device=%#llx",
-		    (long long)p->fts_statp->st_rdev);
+		output(indent, &offset, "device=%#jx",
+		    (uintmax_t)p->fts_statp->st_rdev);
 	if (keys & F_NLINK && p->fts_statp->st_nlink != 1)
 		output(indent, &offset, "nlink=%u", p->fts_statp->st_nlink);
 	if (keys & F_SIZE &&
 	    (flavor != F_NETBSD6 || S_ISREG(p->fts_statp->st_mode)))
-		output(indent, &offset, "size=%lld",
-		    (long long)p->fts_statp->st_size);
+		output(indent, &offset, "size=%ju",
+		    (uintmax_t)p->fts_statp->st_size);
 	if (keys & F_TIME)
 #if defined(BSD4_4) && !defined(HAVE_NBTOOL_CONFIG_H)
-		output(indent, &offset, "time=%ld.%09ld",
-		    (long)p->fts_statp->st_mtimespec.tv_sec,
+		output(indent, &offset, "time=%jd.%09ld",
+		    (intmax_t)p->fts_statp->st_mtimespec.tv_sec,
 		    p->fts_statp->st_mtimespec.tv_nsec);
 #else
-		output(indent, &offset, "time=%ld.%09ld",
-		    (long)p->fts_statp->st_mtime, (long)0);
+		output(indent, &offset, "time=%jd.%09ld",
+		    (intmax_t)p->fts_statp->st_mtime, (long)0);
 #endif
 	if (keys & F_CKSUM && S_ISREG(p->fts_statp->st_mode)) {
 		if ((fd = open(p->fts_accpath, O_RDONLY, 0)) < 0 ||

Index: src/usr.sbin/mtree/spec.c
diff -u src/usr.sbin/mtree/spec.c:1.85 src/usr.sbin/mtree/spec.c:1.86
--- src/usr.sbin/mtree/spec.c:1.85	Thu Dec 20 11:43:16 2012
+++ src/usr.sbin/mtree/spec.c	Mon Sep  9 19:27:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $	*/
+/*	$NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 1989, 1993
@@ -67,7 +67,7 @@
 #if 0
 static char sccsid[] = "@(#)spec.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: spec.c,v 1.85 2012/12/20 16:43:16 christos Exp $");
+__RCSID("$NetBSD: spec.c,v 1.86 2013/09/09 23:27:43 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -350,16 +350,18 @@ dump_nodes(const char *dir, NODE *root, 
 			appendfield(pathlast, "mode=%#o", cur->st_mode);
 		if (MATCHFLAG(F_DEV) &&
 		    (cur->type == F_BLOCK || cur->type == F_CHAR))
-			appendfield(pathlast, "device=%#llx", (long long)cur->st_rdev);
+			appendfield(pathlast, "device=%#jx",
+			    (uintmax_t)cur->st_rdev);
 		if (MATCHFLAG(F_NLINK))
 			appendfield(pathlast, "nlink=%d", cur->st_nlink);
 		if (MATCHFLAG(F_SLINK))
 			appendfield(pathlast, "link=%s", vispath(cur->slink));
 		if (MATCHFLAG(F_SIZE))
-			appendfield(pathlast, "size=%lld", (long long)cur->st_size);
+			appendfield(pathlast, "size=%ju",
+			    (uintmax_t)cur->st_size);
 		if (MATCHFLAG(F_TIME))
-			appendfield(pathlast, "time=%lld.%09ld",
-			    (long long)cur->st_mtimespec.tv_sec,
+			appendfield(pathlast, "time=%jd.%09ld",
+			    (intmax_t)cur->st_mtimespec.tv_sec,
 			    cur->st_mtimespec.tv_nsec);
 		if (MATCHFLAG(F_CKSUM))
 			appendfield(pathlast, "cksum=%lu", cur->cksum);

Reply via email to