From fd8706be29972742fc5cebd41ded932441faa0df Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Thu, 30 May 2002 06:33:07 +0000 Subject: [PATCH] Add compile time asserts for the size of struct gpt_hdr and struct gpt_ent. Use offsetof() for struct gpt_hdr to exclude padding. --- sys/geom/geom_gpt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c index a127ed0d6bb7..568420dbbaa1 100644 --- a/sys/geom/geom_gpt.c +++ b/sys/geom/geom_gpt.c @@ -57,6 +57,9 @@ #include #include +CTASSERT(offsetof(struct gpt_hdr, padding) == 92); +CTASSERT(sizeof(struct gpt_ent) == 128); + /* * XXX: GEOM is not dynamic enough. We are forced to use a compile-time * limit. The minimum number of partitions (128) as required by EFI is