From 1759aa57d47b6d93334e058aab382ea44834d196 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Jul 2008 02:12:54 +0000 Subject: [PATCH] 2008-07-04 Pavel Roskin * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a pointer, which can cause warnings. Support 64-bit addresses. --- ChangeLog | 3 +++ include/grub/misc.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 179dc2994..baed5558a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-04 Pavel Roskin + * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a + pointer, which can cause warnings. Support 64-bit addresses. + * util/elf/grub-mkimage.c: Use GRUB_TARGET_SIZEOF_LONG instead of sizeof(long). This fixes PowerPC image generation on x86_64. diff --git a/include/grub/misc.h b/include/grub/misc.h index 86bc456e4..3d89a6080 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -25,7 +25,7 @@ #include #include -#define ALIGN_UP(addr, align) ((long)((char *)addr + align - 1) & ~(align - 1)) +#define ALIGN_UP(addr, align) (((grub_uint64_t)addr + align - 1) & ~(align - 1)) #define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args); /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */