From 94bc45af05169e1ae98f5e76a13b55b7226dcdd6 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 24 Aug 2004 20:32:47 +0000 Subject: [PATCH] 2004-08-24 Marco Gerards * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional. (grub_boot_fini) [GRUB_UTIL]: Likewise. (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise. (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise. * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'. (grub_hfs_iterate_dir): Make the function static. Add prototypes for `node_found' and `it_dir'. (grub_hfs_dir): Add prototype for `dir_hook'. * fs/minix.c (grub_minix_get_file_block): Add prototype for `grub_get_indir'. Rename `indir' in two blocks to `indir16' and `indir32' to silence a gcc warning. * include/grub/fs.h (grub_hfs_init): New prototype. (grub_hfs_fini): Likewise. --- ChangeLog | 20 ++++++++++++++++++++ commands/boot.c | 5 +++-- fs/hfs.c | 12 ++++++++++-- fs/minix.c | 14 ++++++++------ include/grub/fs.h | 2 ++ 5 files changed, 43 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index b22d59a4d..95a834e6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2004-08-24 Marco Gerards + + * commands/boot.c (grub_boot_init) [GRUB_UTIL]: Make conditional. + (grub_boot_fini) [GRUB_UTIL]: Likewise. + (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise. + (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise. + + * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'. + (grub_hfs_iterate_dir): Make the function static. Add prototypes + for `node_found' and `it_dir'. + (grub_hfs_dir): Add prototype for `dir_hook'. + + * fs/minix.c (grub_minix_get_file_block): Add prototype for + `grub_get_indir'. Rename `indir' in two blocks to `indir16' + and `indir32' to silence a gcc warning. + + * include/grub/fs.h (grub_hfs_init): New prototype. + (grub_hfs_fini): Likewise. + + 2004-08-21 Yoshinori K. Okuji Each disk device has its own id now. This is useful to make use diff --git a/commands/boot.c b/commands/boot.c index 7d2301bd6..79d9105e3 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -38,6 +38,7 @@ grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)), +#ifdef GRUB_UTIL void grub_boot_init (void) { @@ -50,7 +51,7 @@ grub_boot_fini (void) { grub_unregister_command ("boot"); } - +#else /* ! GRUB_UTIL */ GRUB_MOD_INIT { (void)mod; /* To stop warning. */ @@ -62,4 +63,4 @@ GRUB_MOD_FINI { grub_unregister_command ("boot"); } - +#endif /* ! GRUB_UTIL */ diff --git a/fs/hfs.c b/fs/hfs.c index 07a02cd06..7b405a157 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -523,6 +523,8 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, int found = -1; int isleaf = 0; + auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *); + int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) { int cmp = 1; @@ -576,7 +578,7 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, /* Iterate over the directory with the id DIR. The tree is searched starting with the node ROOT_IDX. For every entry in this directory call HOOK. */ -grub_err_t +static grub_err_t grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, unsigned int dir, int (*hook) (struct grub_hfs_record *)) { @@ -586,9 +588,13 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, /* The lowest key possible with DIR as root directory. */ struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""}; + + auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *); + auto int it_dir (struct grub_hfs_node * __attribute ((unused)), + struct grub_hfs_record *); + int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) - { struct grub_hfs_catalog_key *ckey = rec->key; @@ -723,6 +729,8 @@ grub_hfs_dir (grub_device_t device, const char *path, { int inode; + auto int dir_hook (struct grub_hfs_record *rec); + int dir_hook (struct grub_hfs_record *rec) { char fname[32] = { 0 }; diff --git a/fs/minix.c b/fs/minix.c index 22db7f205..1639c8f0a 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -126,26 +126,28 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) struct grub_minix_sblock *sblock = &data->sblock; int indir; + auto int grub_get_indir (int, int); + /* Read the block pointer in ZONE, on the offset NUM. */ int grub_get_indir (int zone, int num) { if (data->version == 1) { - grub_uint16_t indir; + grub_uint16_t indir16; grub_disk_read (data->disk, zone << GRUB_MINIX_LOG2_ZONESZ, sizeof (grub_uint16_t) * num, - sizeof (grub_uint16_t), (char *) &indir); - return grub_le_to_cpu16 (indir); + sizeof (grub_uint16_t), (char *) &indir16); + return grub_le_to_cpu16 (indir16); } else { - grub_uint32_t indir; + grub_uint32_t indir32; grub_disk_read (data->disk, zone << GRUB_MINIX_LOG2_ZONESZ, sizeof (grub_uint32_t) * num, - sizeof (grub_uint32_t), (char *) &indir); - return grub_le_to_cpu32 (indir); + sizeof (grub_uint32_t), (char *) &indir32); + return grub_le_to_cpu32 (indir32); } } diff --git a/include/grub/fs.h b/include/grub/fs.h index 18f57d0e4..a3cedf533 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -74,6 +74,8 @@ void grub_ufs_init (void); void grub_ufs_fini (void); void grub_minix_init (void); void grub_minix_fini (void); +void grub_hfs_init (void); +void grub_hfs_fini (void); #endif /* GRUB_UTIL */ #endif /* ! GRUB_FS_HEADER */