diff --git a/ChangeLog b/ChangeLog index b2808c324..5e9314ed3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2013-10-18 Vladimir Serbinenko + + * grub-core/disk/ldm.c: Rename variables and arguments to prevent + shadowing. + * grub-core/kern/disk.c: Likewise. + * grub-core/kern/misc.c: Likewise. + * include/grub/parser.h: Likewise. + * include/grub/script_sh.h: Likewise. + * include/grub/zfs/zfs.h: Likewise. + 2013-10-18 Vladimir Serbinenko * grub-core/disk/luks.c (configure_ciphers): Fix spurious warning. diff --git a/grub-core/disk/ldm.c b/grub-core/disk/ldm.c index a2e26b262..f681eea7f 100644 --- a/grub-core/disk/ldm.c +++ b/grub-core/disk/ldm.c @@ -707,16 +707,16 @@ make_vg (grub_disk_t disk, if (comp->segment_alloc == 1) { - unsigned index; + unsigned node_index; ptr += *ptr + 1; if (ptr + *ptr + 1 >= vblk[i].dynamic + sizeof (vblk[i].dynamic)) { goto fail2; } - index = read_int (ptr + 1, *ptr); - if (index < comp->segments->node_count) - comp->segments->nodes[index] = part; + node_index = read_int (ptr + 1, *ptr); + if (node_index < comp->segments->node_count) + comp->segments->nodes[node_index] = part; } else { diff --git a/grub-core/kern/disk.c b/grub-core/kern/disk.c index 76ff4505d..b58158eeb 100644 --- a/grub-core/kern/disk.c +++ b/grub-core/kern/disk.c @@ -72,12 +72,12 @@ static void grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id, grub_disk_addr_t sector) { - unsigned index; + unsigned cache_index; struct grub_disk_cache *cache; sector &= ~(GRUB_DISK_CACHE_SIZE - 1); - index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + index; + cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); + cache = grub_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector && cache->data) @@ -111,10 +111,10 @@ grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id, grub_disk_addr_t sector) { struct grub_disk_cache *cache; - unsigned index; + unsigned cache_index; - index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + index; + cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); + cache = grub_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector) @@ -138,10 +138,10 @@ grub_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id, grub_disk_addr_t sector) { struct grub_disk_cache *cache; - unsigned index; + unsigned cache_index; - index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + index; + cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); + cache = grub_disk_cache_table + cache_index; if (cache->dev_id == dev_id && cache->disk_id == disk_id && cache->sector == sector) @@ -152,11 +152,11 @@ static grub_err_t grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id, grub_disk_addr_t sector, const char *data) { - unsigned index; + unsigned cache_index; struct grub_disk_cache *cache; - index = grub_disk_cache_get_index (dev_id, disk_id, sector); - cache = grub_disk_cache_table + index; + cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector); + cache = grub_disk_cache_table + cache_index; cache->lock = 1; grub_free (cache->data); diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 027bfde92..c2a9163a3 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -641,7 +641,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a const char *fmt; auto void write_char (unsigned char ch); auto void write_str (const char *s); - auto void write_fill (const char ch, int n); + auto void write_fill (const char ch, int count_fill); void write_char (unsigned char ch) { diff --git a/include/grub/parser.h b/include/grub/parser.h index bf9c7c67d..64f9f5cc2 100644 --- a/include/grub/parser.h +++ b/include/grub/parser.h @@ -62,8 +62,8 @@ EXPORT_FUNC (grub_parser_cmdline_state) (grub_parser_state_t state, grub_err_t EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline, - grub_reader_getline_t getline, - void *getline_data, + grub_reader_getline_t getline_func, + void *getline_func_data, int *argc, char ***argv); struct grub_parser @@ -81,7 +81,8 @@ struct grub_parser grub_err_t (*fini) (void); grub_err_t (*parse_line) (char *line, - grub_reader_getline_t getline, void *getline_data); + grub_reader_getline_t getline_func, + void *getline_func_data); }; typedef struct grub_parser *grub_parser_t; @@ -89,6 +90,7 @@ grub_err_t grub_parser_execute (char *source); grub_err_t grub_rescue_parse_line (char *line, - grub_reader_getline_t getline, void *getline_data); + grub_reader_getline_t getline_func, + void *getline_func_data); #endif /* ! GRUB_PARSER_HEADER */ diff --git a/include/grub/script_sh.h b/include/grub/script_sh.h index 57bdd4d3c..360c2be1f 100644 --- a/include/grub/script_sh.h +++ b/include/grub/script_sh.h @@ -290,16 +290,16 @@ grub_script_arg_add (struct grub_parser_param *state, grub_script_arg_type_t type, char *str); struct grub_script *grub_script_parse (char *script, - grub_reader_getline_t getline, - void *getline_data); + grub_reader_getline_t getline_func, + void *getline_func_data); void grub_script_free (struct grub_script *script); struct grub_script *grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem); struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser, char *script, - grub_reader_getline_t getline, - void *getline_data); + grub_reader_getline_t getline_func, + void *getline_func_data); void grub_script_lexer_fini (struct grub_lexer_param *); void grub_script_lexer_ref (struct grub_lexer_param *); void grub_script_lexer_deref (struct grub_lexer_param *); @@ -387,7 +387,8 @@ grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *c grub_err_t grub_normal_parse_line (char *line, - grub_reader_getline_t getline, void *getline_data); + grub_reader_getline_t getline_func, + void *getline_func_data); static inline struct grub_script * grub_script_ref (struct grub_script *script) diff --git a/include/grub/zfs/zfs.h b/include/grub/zfs/zfs.h index 8bf091974..4ee513887 100644 --- a/include/grub/zfs/zfs.h +++ b/include/grub/zfs/zfs.h @@ -131,7 +131,7 @@ int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name, grub_uint64_t *out); char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, const char *name, - grub_size_t index); + grub_size_t array_index); int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, const char *name); grub_err_t