Date: Thu, 13 Aug 2009 19:47:14 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r196199 - projects/mips/sys/mips/include Message-ID: <200908131947.n7DJlEo8011192@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908131947.n7DJlEo8011192>