svn commit: r248680 - head/sbin/fsck_ffs

Sean Bruno sbruno at FreeBSD.org
Sun Mar 24 10:41:30 UTC 2013


Author: sbruno
Date: Sun Mar 24 10:41:29 2013
New Revision: 248680
URL: http://svnweb.freebsd.org/changeset/base/248680

Log:
  Resolve clang compile errors on amd64/i386 for certain by casting.
  
  compile tested with clang on i386, amd64
  compile tested with gcc on i386, amd64, sparc64
  
  Submitted by:	delphij

Modified:
  head/sbin/fsck_ffs/fsutil.c

Modified: head/sbin/fsck_ffs/fsutil.c
==============================================================================
--- head/sbin/fsck_ffs/fsutil.c	Sun Mar 24 10:14:25 2013	(r248679)
+++ head/sbin/fsck_ffs/fsutil.c	Sun Mar 24 10:41:29 2013	(r248680)
@@ -507,8 +507,8 @@ static void printIOstats(void)
 
 	clock_gettime(CLOCK_REALTIME_PRECISE, &finishpass);
 	timespecsub(&finishpass, &startpass);
-	printf("Running time: %ld.%03ld msec\n",
-		finishpass.tv_sec, finishpass.tv_nsec / 1000000);
+	printf("Running time: %jd.%03ld msec\n",
+		(intmax_t)finishpass.tv_sec, finishpass.tv_nsec / 1000000);
 	printf("buffer reads by type:\n");
 	for (totalmsec = 0, i = 0; i < BT_NUMBUFTYPES; i++)
 		totalmsec += readtime[i].tv_sec * 1000 +
@@ -519,10 +519,10 @@ static void printIOstats(void)
 		if (readcnt[i] == 0)
 			continue;
 		msec = readtime[i].tv_sec * 1000 + readtime[i].tv_nsec / 1000000;
-		printf("%21s:%8ld %2ld.%ld%% %4ld.%03ld sec %2lld.%lld%%\n",
+		printf("%21s:%8ld %2ld.%ld%% %4jd.%03ld sec %2lld.%lld%%\n",
 		    buftype[i], readcnt[i], readcnt[i] * 100 / diskreads,
 		    (readcnt[i] * 1000 / diskreads) % 10,
-		    readtime[i].tv_sec, readtime[i].tv_nsec / 1000000,
+		    (intmax_t)readtime[i].tv_sec, readtime[i].tv_nsec / 1000000,
 		    msec * 100 / totalmsec, (msec * 1000 / totalmsec) % 10);
 	}
 	printf("\n");


More information about the svn-src-all mailing list