diff --git a/ChangeLog b/ChangeLog index f232e08fe..1724842a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-07-04 Pavel Roskin <proski@gnu.org> + * kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to + grub_addr_t before casting it to the void pointer to fix a + warning. Non-addressable regions are discarded earlier. + (grub_arch_modules_addr): Cast _end to grub_addr_t. + * kern/i386/linuxbios/table.c: Include grub/misc.h. + (check_signature): Don't shadow table_header. + (grub_linuxbios_table_iterate): Cast numeric constants to + grub_linuxbios_table_header_t. + * include/grub/i386/linuxbios/init.h: Add noreturn attribute to + grub_stop(). + * kern/ieee1275/init.c: Cast _start and _end to grub_addr_t to prevent warnings. diff --git a/include/grub/i386/linuxbios/init.h b/include/grub/i386/linuxbios/init.h index 85b896b06..e67007414 100644 --- a/include/grub/i386/linuxbios/init.h +++ b/include/grub/i386/linuxbios/init.h @@ -22,7 +22,7 @@ #include <grub/symbol.h> #include <grub/i386/pc/memory.h> -void EXPORT_FUNC(grub_stop) (void); +void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_stop_floppy) (void); #endif diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 9a8a40877..362131129 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -140,7 +140,7 @@ grub_machine_init (void) quarter); } else - grub_mm_init_region ((void *) addr, (grub_size_t) size); + grub_mm_init_region ((void *) (grub_addr_t) addr, (grub_size_t) size); return 0; } @@ -168,5 +168,5 @@ grub_machine_fini (void) grub_addr_t grub_arch_modules_addr (void) { - return ALIGN_UP(_end, GRUB_MOD_ALIGN); + return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN); } diff --git a/kern/i386/linuxbios/table.c b/kern/i386/linuxbios/table.c index 1adab639a..dac89113a 100644 --- a/kern/i386/linuxbios/table.c +++ b/kern/i386/linuxbios/table.c @@ -19,6 +19,7 @@ #include <grub/machine/memory.h> #include <grub/types.h> #include <grub/err.h> +#include <grub/misc.h> static grub_err_t grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) @@ -27,9 +28,9 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) grub_linuxbios_table_item_t table_item; auto int check_signature (grub_linuxbios_table_header_t); - int check_signature (grub_linuxbios_table_header_t table_header) + int check_signature (grub_linuxbios_table_header_t tbl_header) { - if (! grub_memcmp (table_header->signature, "LBIO", 4)) + if (! grub_memcmp (tbl_header->signature, "LBIO", 4)) return 1; return 0; @@ -37,11 +38,13 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) /* Assuming table_header is aligned to its size (8 bytes). */ - for (table_header = 0x500; table_header < 0x1000; table_header++) + for (table_header = (grub_linuxbios_table_header_t) 0x500; + table_header < (grub_linuxbios_table_header_t) 0x1000; table_header++) if (check_signature (table_header)) goto signature_found; - for (table_header = 0xf0000; table_header < 0x100000; table_header++) + for (table_header = (grub_linuxbios_table_header_t) 0xf0000; + table_header < (grub_linuxbios_table_header_t) 0x100000; table_header++) if (check_signature (table_header)) goto signature_found;