Remove nested functions from ELF iterators
PATCH 1/1 Remove nested functions from ELF iterators
Part five. In this case, the hooks already had void * arguments for user data, so it was just a matter of moving functions up to the top level, although I did take the opportunity to add typedefs for the hook types. No verbose ChangeLog this time since there are no interface changes. Size changes:
DOWN: obj/amd64-efi/grub-core/elf.mod (6888 > 6880) - change: -8
DOWN: obj/i386-coreboot/grub-core/elf.mod (4424 > 4408) - change: -16
DOWN: obj/i386-efi/grub-core/elf.mod (4536 > 4528) - change: -8
DOWN: obj/i386-ieee1275/grub-core/elf.mod (4424 > 4408) - change: -16
DOWN: obj/i386-pc/grub-core/elf.mod (4424 > 4408) - change: -16
=== modified file 'ChangeLog'
ChangeLog +4 -0
@@ -1,3 +1,7 @@ +2013-01-16 Colin Watson <[email protected]> + + Remove nested functions from ELF iterators. + 2013-01-16 Vladimir Serbinenko <[email protected]> Improve bidi handling in entry editor.
=== modified file 'grub-core/kern/elf.c'
kern/elf.c +206 -167
471 lines not on this page · raw message
=== modified file 'grub-core/loader/i386/bsd.c'
loader/i386/bsd.c +2 -2
@@ -1311,7 +1311,7 @@ grub_bsd_load_aout (grub_file_t file, co bss_size); } -static int NESTED_FUNC_ATTR +static int grub_bsd_elf32_size_hook (grub_elf_t elf __attribute__ ((unused)),Elf32_Phdr *phdr,void *arg __attribute__ ((unused))) {
@@ -1353,7 +1353,7 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr,return GRUB_ERR_NONE ; } -static int NESTED_FUNC_ATTR +static int grub_bsd_elf64_size_hook (grub_elf_t elf __attribute__ ((unused)),Elf64_Phdr *phdr,void *arg __attribute__ ((unused))) {
=== modified file 'include/grub/elfload.h'
grub/elfload.h +7 -4
@@ -41,6 +41,11 @@ typedef grub_err_t (*grub_elf32_load_hootypedef grub_err_t (*grub_elf64_load_hook_t ) (Elf64_Phdr *phdr,grub_addr_t *addr,int *load); +typedef int (*grub_elf32_phdr_iterate_hook_t ) + (grub_elf_t elf,Elf32_Phdr *phdr,void *arg); +typedef int (*grub_elf64_phdr_iterate_hook_t ) + (grub_elf_t elf,Elf64_Phdr *phdr,void *arg); +grub_elf_t grub_elf_open (const char *);grub_elf_t grub_elf_file (grub_file_t file,const char *filename);grub_err_t grub_elf_close (grub_elf_t );
@@ -63,12 +68,10 @@ grub_err_t grub_elf64_load (grub_elf_t,grub_err_t grub_elf32_phdr_iterate (grub_elf_t elf,const char *filename, - int NESTED_FUNC_ATTR (*hook) (grub_elf_t, Elf32_Phdr *, void *), -void *hook_arg); +grub_elf32_phdr_iterate_hook_t hook,void *hook_arg);grub_err_t grub_elf64_phdr_iterate (grub_elf_t elf,const char *filename, - int NESTED_FUNC_ATTR (*hook) (grub_elf_t, Elf64_Phdr *, void *), -void *hook_arg); +grub_elf64_phdr_iterate_hook_t hook,void *hook_arg);#endif /* ! GRUB_ELFLOAD_HEADER */
Thanks,
Signature · 1 line
Colin Watson [[email protected]]