svn commit: r195580 - projects/mips/sys/mips/include
Warner Losh
imp at FreeBSD.org
Fri Jul 10 19:06:16 UTC 2009
Author: imp
Date: Fri Jul 10 19:06:15 2009
New Revision: 195580
URL: http://svn.freebsd.org/changeset/base/195580
Log:
Fixed aligned macros...
# I'm not sure bde will like this, but I want to commit it for others to review
# as well. :)
Modified:
projects/mips/sys/mips/include/param.h
Modified: projects/mips/sys/mips/include/param.h
==============================================================================
--- projects/mips/sys/mips/include/param.h Fri Jul 10 19:04:32 2009 (r195579)
+++ projects/mips/sys/mips/include/param.h Fri Jul 10 19:06:15 2009 (r195580)
@@ -80,11 +80,11 @@
/*
* Round p (pointer or byte index) up to a correctly-aligned value for all
* data types (int, long, ...). The result is u_int and must be cast to
- * any desired pointer type.
+ * any desired pointer type. XXX u_int isn't big enough to hod a pointer.
*/
#define _ALIGNBYTES 7
-#define _ALIGN(p) (((u_int)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
-#define ALIGNED_POINTER(p, t) ((((u_int32_t)(p)) & (sizeof (t) - 1)) == 0)
+#define _ALIGN(p) (((uintptr_t)(p) + _ALIGNBYTES) &~ _ALIGNBYTES)
+#define ALIGNED_POINTER(p, t) ((((uintptr_t)(p)) & (sizeof (t) - 1)) == 0)
#define ALIGNBYTES _ALIGNBYTES
#define ALIGN(p) _ALIGN(p)
More information about the svn-src-projects
mailing list