[Midnightbsd-cvs] src: identcpu.c: This can cause some odd casting issues in some

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat May 17 00:55:53 EDT 2008


Log Message:
-----------
This can cause some odd casting issues in some situations.  Say the clock is very high...

Modified Files:
--------------
    src/sys/i386/i386:
        identcpu.c (r1.1.1.2 -> r1.2)

-------------- next part --------------
Index: identcpu.c
===================================================================
RCS file: /home/cvs/src/sys/i386/i386/identcpu.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -L sys/i386/i386/identcpu.c -L sys/i386/i386/identcpu.c -u -r1.1.1.2 -r1.2
--- sys/i386/i386/identcpu.c
+++ sys/i386/i386/identcpu.c
@@ -39,7 +39,8 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/i386/i386/identcpu.c,v 1.145.2.2 2006/02/23 15:03:42 dwmalone Exp $");
+/*$FreeBSD: src/sys/i386/i386/identcpu.c,v 1.145.2.2 2006/02/23 15:03:42 dwmalone Exp $ */
+__MBSDID("$MIdnightBSD$");
 
 #include "opt_cpu.h"
 
@@ -611,18 +612,18 @@
 #if defined(I586_CPU)
 	case CPUCLASS_586:
 		hw_clockrate = (tsc_freq + 5000) / 1000000;
-		printf("%jd.%02d-MHz ",
-		       (intmax_t)(tsc_freq + 4999) / 1000000,
-		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		printf("%lld.%02lld-MHz ",
+		       (tsc_freq + 4999LL) / 1000000LL,
+		       ((tsc_freq + 4999LL) / 10000LL) % 100LL);
 		printf("586");
 		break;
 #endif
 #if defined(I686_CPU)
 	case CPUCLASS_686:
 		hw_clockrate = (tsc_freq + 5000) / 1000000;
-		printf("%jd.%02d-MHz ",
-		       (intmax_t)(tsc_freq + 4999) / 1000000,
-		       (u_int)((tsc_freq + 4999) / 10000) % 100);
+		printf("%lld.%02lld-MHz ",
+		       (tsc_freq + 4999LL) / 1000000LL,
+		       ((tsc_freq + 4999LL) / 10000LL) % 100LL);
 		printf("686");
 		break;
 #endif


More information about the Midnightbsd-cvs mailing list