mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-26 00:59:55 +00:00
* 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:
1 parent
e89c2d48a9
commit
d28e1163c3
3 files changed
+240
-244
No files matched your search
+10
-7
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user