Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1CngJr-0005PI-U2 for mharc-grub-devel@gnu.org; Sun, 09 Jan 2005 11:53:36 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CngFK-0004e4-Ne for grub-devel@gnu.org; Sun, 09 Jan 2005 11:48:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CngF6-0004Wg-5T for grub-devel@gnu.org; Sun, 09 Jan 2005 11:48:43 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CngF5-0004Pj-Ne for grub-devel@gnu.org; Sun, 09 Jan 2005 11:48:39 -0500 Received: from [145.74.66.11] (helo=mail-cn.han.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cnfjn-0000Bg-JU for grub-devel@gnu.org; Sun, 09 Jan 2005 11:16:19 -0500 Received: from vscan-cn.han.nl (venus.han.nl [145.74.65.6]) by mail-cn.han.nl (Postfix) with ESMTP id 2040097D3 for ; Sun, 9 Jan 2005 17:16:10 +0100 (CET) Received: from mail-cn.han.nl ([145.74.66.11]) by vscan-cn.han.nl (venus.han.nl [145.74.65.6]) (amavisd-new, port 10024) with ESMTP id 24359-02 for ; Sun, 9 Jan 2005 17:16:09 +0100 (CET) Received: from mail1.han.nl (mail1.han.nl [145.74.103.11]) by mail-cn.han.nl (Postfix) with ESMTP id 0E57D95D7 for ; Sun, 9 Jan 2005 17:16:09 +0100 (CET) Received: from marco.marco-g.com (mgerards.xs4all.nl [82.92.27.129]) by mail1.han.nl (Postfix) with ESMTP id AD3BCC047 for ; Sun, 9 Jan 2005 17:16:08 +0100 (CET) Mail-Copies-To: metgerards@student.han.nl To: grub-devel@gnu.org From: Marco Gerards Date: Sun, 09 Jan 2005 16:15:46 +0000 Message-ID: <87llb2h93h.fsf@marco.marco-g.com> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new (2.2.0) at vscan-cn.han.nl Subject: 64 bits fixes X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Jan 2005 16:53:34 -0000 Hi, Some prototypes do not match with the function definitions and cause a warning because of that. Here is a patch to fix that. I think the patch is ok, so I will commit it if I don't hear anything before Wednesday. If someone proofreads the patch please check if the cast is right. Thanks, Marco 2005-01-09 Marco Gerards * include/grub/mm.h (grub_mm_init_region): Change the type of the `unsigned' arguments to `grub_size_t'. (grub_malloc): Likewise. (grub_realloc): Likewise. (grub_memalign): Likewise. * kern/i386/dl.c (grub_arch_dl_check_header): Likewise. * kern/powerpc/dl.c (grub_arch_dl_check_header): Likewise. * util/misc.c (grub_malloc): Likewise. (grub_realloc): Likewise. * kern/mm.c (get_header_from_pointer): Change the casts to `unsigned' into a cast to `grub_size_t'. Index: include/grub/mm.h =================================================================== RCS file: /cvsroot/grub/grub2/include/grub/mm.h,v retrieving revision 1.3 diff -u -p -u -p -r1.3 mm.h --- include/grub/mm.h 4 Apr 2004 13:46:00 -0000 1.3 +++ include/grub/mm.h 9 Jan 2005 16:06:17 -0000 @@ -24,11 +24,11 @@ #include #include -void grub_mm_init_region (void *addr, unsigned size); -void *EXPORT_FUNC(grub_malloc) (unsigned size); +void grub_mm_init_region (void *addr, grub_size_t size); +void *EXPORT_FUNC(grub_malloc) (grub_size_t size); void EXPORT_FUNC(grub_free) (void *ptr); -void *EXPORT_FUNC(grub_realloc) (void *ptr, unsigned size); -void *EXPORT_FUNC(grub_memalign) (unsigned align, unsigned size); +void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size); +void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size); /* For debugging. */ #define MM_DEBUG 1 Index: kern/mm.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/mm.c,v retrieving revision 1.8 diff -u -p -u -p -r1.8 mm.c --- kern/mm.c 12 Jul 2004 17:53:07 -0000 1.8 +++ kern/mm.c 9 Jan 2005 16:06:18 -0000 @@ -72,12 +72,12 @@ static grub_mm_region_t base; static void get_header_from_pointer (void *ptr, grub_mm_header_t *p, grub_mm_region_t *r) { - if ((unsigned) ptr & (GRUB_MM_ALIGN - 1)) + if ((grub_addr_t) ptr & (GRUB_MM_ALIGN - 1)) grub_fatal ("unaligned pointer %p", ptr); for (*r = base; *r; *r = (*r)->next) - if ((unsigned) ptr > (*r)->addr - && (unsigned) ptr <= (*r)->addr + (*r)->size) + if ((grub_addr_t) ptr > (*r)->addr + && (grub_addr_t) ptr <= (*r)->addr + (*r)->size) break; if (! *r) Index: kern/i386/dl.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/i386/dl.c,v retrieving revision 1.3 diff -u -p -u -p -r1.3 dl.c --- kern/i386/dl.c 4 Apr 2004 13:46:02 -0000 1.3 +++ kern/i386/dl.c 9 Jan 2005 16:06:18 -0000 @@ -25,7 +25,7 @@ /* Check if EHDR is a valid ELF header. */ int -grub_arch_dl_check_header (void *ehdr, unsigned size) +grub_arch_dl_check_header (void *ehdr, grub_size_t size) { Elf32_Ehdr *e = ehdr; Index: kern/powerpc/dl.c =================================================================== RCS file: /cvsroot/grub/grub2/kern/powerpc/dl.c,v retrieving revision 1.2 diff -u -p -u -p -r1.2 dl.c --- kern/powerpc/dl.c 27 Dec 2004 13:46:20 -0000 1.2 +++ kern/powerpc/dl.c 9 Jan 2005 16:06:18 -0000 @@ -25,7 +25,7 @@ /* Check if EHDR is a valid ELF header. */ int -grub_arch_dl_check_header (void *ehdr, unsigned size) +grub_arch_dl_check_header (void *ehdr, grub_size_t size) { Elf32_Ehdr *e = ehdr; Index: util/misc.c =================================================================== RCS file: /cvsroot/grub/grub2/util/misc.c,v retrieving revision 1.11 diff -u -p -u -p -r1.11 misc.c --- util/misc.c 5 Jan 2005 13:33:16 -0000 1.11 +++ util/misc.c 9 Jan 2005 16:06:18 -0000 @@ -206,7 +206,7 @@ grub_util_write_image (const char *img, } void * -grub_malloc (unsigned size) +grub_malloc (grub_size_t size) { return xmalloc (size); } @@ -218,7 +218,7 @@ grub_free (void *ptr) } void * -grub_realloc (void *ptr, unsigned size) +grub_realloc (void *ptr, grub_size_t size) { return xrealloc (ptr, size); }