[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
64 bits fixes
From: |
Marco Gerards |
Subject: |
64 bits fixes |
Date: |
Sun, 09 Jan 2005 16:15:46 +0000 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
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 <address@hidden>
* 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 <grub/types.h>
#include <grub/symbol.h>
-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);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- 64 bits fixes,
Marco Gerards <=