svn commit: r196199 - projects/mips/sys/mips/include
Warner Losh
imp at FreeBSD.org
Thu Aug 13 19:47:14 UTC 2009
Author: imp
Date: Thu Aug 13 19:47:13 2009
New Revision: 196199
URL: http://svn.freebsd.org/changeset/base/196199
Log:
Use unsigned long instead of unsigned for the integer casts here. The
former works for both ILP32 and LP64 programming models, while the
latter fails LP64.
# uintpr_t is better, but iirc, we can't pollute the name space to use it
# I likely need to audit all my uintptr_t changes for that issue...
Modified:
projects/mips/sys/mips/include/param.h
Modified: projects/mips/sys/mips/include/param.h
==============================================================================
--- projects/mips/sys/mips/include/param.h Thu Aug 13 17:54:11 2009 (r196198)
+++ projects/mips/sys/mips/include/param.h Thu Aug 13 19:47:13 2009 (r196199)
@@ -152,10 +152,10 @@
/*
* Conversion macros
*/
-#define mips_round_page(x) ((((unsigned)(x)) + NBPG - 1) & ~(NBPG-1))
-#define mips_trunc_page(x) ((unsigned)(x) & ~(NBPG-1))
-#define mips_btop(x) ((unsigned)(x) >> PGSHIFT)
-#define mips_ptob(x) ((unsigned)(x) << PGSHIFT)
+#define mips_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG-1))
+#define mips_trunc_page(x) ((unsigned long)(x) & ~(NBPG-1))
+#define mips_btop(x) ((unsigned long)(x) >> PGSHIFT)
+#define mips_ptob(x) ((unsigned long)(x) << PGSHIFT)
#define round_page mips_round_page
#define trunc_page mips_trunc_page
#define atop(x) ((unsigned long)(x) >> PAGE_SHIFT)
More information about the svn-src-projects
mailing list