Fixed ROUNDDN to avoid truncating the result when the first argument
doesn't fit in 32 bits and the second one does.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@3478 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/core.h b/coregrind/core.h
index bbab507..134b1d0 100644
--- a/coregrind/core.h
+++ b/coregrind/core.h
@@ -114,7 +114,7 @@
/* Useful macros */
/* a - alignment - must be a power of 2 */
-#define ROUNDDN(p, a) ((Addr)(p) & ~((a)-1))
+#define ROUNDDN(p, a) ((Addr)(p) & ~((Addr)(a)-1))
#define ROUNDUP(p, a) ROUNDDN((p)+(a)-1, (a))
#define PGROUNDDN(p) ROUNDDN(p, VKI_PAGE_SIZE)
#define PGROUNDUP(p) ROUNDUP(p, VKI_PAGE_SIZE)