Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/cpuctl/arch Use uintmax_t for freqency computations...



details:   https://anonhg.NetBSD.org/src/rev/665cf1271e4c
branches:  trunk
changeset: 777680:665cf1271e4c
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Feb 29 23:34:01 2012 +0000

description:
Use uintmax_t for freqency computations to avoid differences between
platforms.

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 4fd300e73125 -r 665cf1271e4c usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Wed Feb 29 22:53:47 2012 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Wed Feb 29 23:34:01 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.27 2012/02/03 05:07:17 yamt Exp $   */
+/*     $NetBSD: i386.c,v 1.28 2012/02/29 23:34:01 joerg Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.27 2012/02/03 05:07:17 yamt Exp $");
+__RCSID("$NetBSD: i386.c,v 1.28 2012/02/29 23:34:01 joerg Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -1394,9 +1394,9 @@
        aprint_normal("%s: %s", cpuname, cpu_model);
 
        if (ci->ci_tsc_freq != 0)
-               aprint_normal(", %qd.%02qd MHz",
-                   (ci->ci_tsc_freq + 4999) / 1000000,
-                   ((ci->ci_tsc_freq + 4999) / 10000) % 100);
+               aprint_normal(", %ju.%02ju MHz",
+                   ((uintmax_t)ci->ci_tsc_freq + 4999) / 1000000,
+                   (((uintmax_t)ci->ci_tsc_freq + 4999) / 10000) % 100);
        if (ci->ci_signature != 0)
                aprint_normal(", id 0x%x", ci->ci_signature);
        aprint_normal("\n");



Home | Main Index | Thread Index | Old Index