* grub-core/fs/bfs.c: Remove variable length arrays. Reduces afs.mod and

bfs.mod size by 556 resp 740 bytes (288 resp 334 compressed).
	* include/grub/types.h (grub_unaligned_uint64_t): New type.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-10-20 13:11:40 +02:00
parent e89c2d48a9
commit d28e1163c3
3 changed files with 240 additions and 244 deletions

View file

@ -291,15 +291,18 @@ static inline void grub_set_unaligned32 (void *ptr, grub_uint32_t val)
dd->d = val;
}
struct grub_unaligned_uint64
{
grub_uint64_t val;
} __attribute__ ((packed));
typedef struct grub_unaligned_uint64 grub_unaligned_uint64_t;
static inline grub_uint64_t grub_get_unaligned64 (const void *ptr)
{
struct grub_unaligned_uint64_t
{
grub_uint64_t d;
} __attribute__ ((packed));
const struct grub_unaligned_uint64_t *dd
= (const struct grub_unaligned_uint64_t *)ptr;
return dd->d;
const struct grub_unaligned_uint64 *dd
= (const struct grub_unaligned_uint64 *) ptr;
return dd->val;
}
static inline void grub_set_unaligned64 (void *ptr, grub_uint64_t val)