From 96c713b69da081ad76f1c6cca2bcd9123b54e956 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 18 Jan 2010 23:37:11 +0100 Subject: [PATCH] Eliminate variable-length types in parameters --- include/grub/i386/netbsd_bootinfo.h | 8 ++++---- include/grub/i386/openbsd_bootarg.h | 6 +++--- loader/i386/bsd.c | 6 ++++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/grub/i386/netbsd_bootinfo.h b/include/grub/i386/netbsd_bootinfo.h index 5cda9d570..fd429a251 100644 --- a/include/grub/i386/netbsd_bootinfo.h +++ b/include/grub/i386/netbsd_bootinfo.h @@ -60,7 +60,7 @@ struct grub_netbsd_bootinfo { grub_uint32_t bi_count; - grub_addr_t bi_data[0]; + grub_uint32_t bi_data[0]; }; struct grub_netbsd_btinfo_common @@ -73,14 +73,14 @@ struct grub_netbsd_btinfo_common struct grub_netbsd_btinfo_bootdisk { - int labelsector; /* label valid if != -1 */ + grub_uint32_t labelsector; /* label valid if != 0xffffffff */ struct { grub_uint16_t type, checksum; char packname[16]; } label; - int biosdev; - int partition; + grub_uint32_t biosdev; + grub_uint32_t partition; }; struct grub_netbsd_btinfo_symtab diff --git a/include/grub/i386/openbsd_bootarg.h b/include/grub/i386/openbsd_bootarg.h index ccbe1ca12..cd99b14f2 100644 --- a/include/grub/i386/openbsd_bootarg.h +++ b/include/grub/i386/openbsd_bootarg.h @@ -64,9 +64,9 @@ struct grub_openbsd_bootargs { - int ba_type; - int ba_size; - struct grub_openbsd_bootargs *ba_next; + grub_uint32_t ba_type; + grub_uint32_t ba_size; + grub_uint32_t ba_next; } __attribute__ ((packed)); #endif diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 7f9617543..ed9a1dbae 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -822,9 +822,11 @@ grub_openbsd_boot (void) buf = (grub_uint8_t *) pm; pa->ba_size = (char *) pm - (char *) pa; - pa->ba_next = (struct grub_openbsd_bootargs *) (buf - buf0 + buf_target); - pa = pa->ba_next; + pa->ba_next = buf - buf0 + buf_target; + pa = (struct grub_openbsd_bootargs *) buf; pa->ba_type = OPENBSD_BOOTARG_END; + pa->ba_size = 0; + pa->ba_next = 0; pa++; buf = (grub_uint8_t *) pa;