* 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.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-10-18 16:54:57 +02:00
parent 7b3aca00fa
commit 3cd910a212
7 changed files with 40 additions and 27 deletions

View file

@ -1,3 +1,13 @@
2013-10-18 Vladimir Serbinenko <phcoder@gmail.com>
* 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 <phcoder@gmail.com> 2013-10-18 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/luks.c (configure_ciphers): Fix spurious warning. * grub-core/disk/luks.c (configure_ciphers): Fix spurious warning.

View file

@ -707,16 +707,16 @@ make_vg (grub_disk_t disk,
if (comp->segment_alloc == 1) if (comp->segment_alloc == 1)
{ {
unsigned index; unsigned node_index;
ptr += *ptr + 1; ptr += *ptr + 1;
if (ptr + *ptr + 1 >= vblk[i].dynamic if (ptr + *ptr + 1 >= vblk[i].dynamic
+ sizeof (vblk[i].dynamic)) + sizeof (vblk[i].dynamic))
{ {
goto fail2; goto fail2;
} }
index = read_int (ptr + 1, *ptr); node_index = read_int (ptr + 1, *ptr);
if (index < comp->segments->node_count) if (node_index < comp->segments->node_count)
comp->segments->nodes[index] = part; comp->segments->nodes[node_index] = part;
} }
else else
{ {

View file

@ -72,12 +72,12 @@ static void
grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id, grub_disk_cache_invalidate (unsigned long dev_id, unsigned long disk_id,
grub_disk_addr_t sector) grub_disk_addr_t sector)
{ {
unsigned index; unsigned cache_index;
struct grub_disk_cache *cache; struct grub_disk_cache *cache;
sector &= ~(GRUB_DISK_CACHE_SIZE - 1); sector &= ~(GRUB_DISK_CACHE_SIZE - 1);
index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
cache = grub_disk_cache_table + index; cache = grub_disk_cache_table + cache_index;
if (cache->dev_id == dev_id && cache->disk_id == disk_id if (cache->dev_id == dev_id && cache->disk_id == disk_id
&& cache->sector == sector && cache->data) && 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) grub_disk_addr_t sector)
{ {
struct grub_disk_cache *cache; struct grub_disk_cache *cache;
unsigned index; unsigned cache_index;
index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
cache = grub_disk_cache_table + index; cache = grub_disk_cache_table + cache_index;
if (cache->dev_id == dev_id && cache->disk_id == disk_id if (cache->dev_id == dev_id && cache->disk_id == disk_id
&& cache->sector == sector) && cache->sector == sector)
@ -138,10 +138,10 @@ grub_disk_cache_unlock (unsigned long dev_id, unsigned long disk_id,
grub_disk_addr_t sector) grub_disk_addr_t sector)
{ {
struct grub_disk_cache *cache; struct grub_disk_cache *cache;
unsigned index; unsigned cache_index;
index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
cache = grub_disk_cache_table + index; cache = grub_disk_cache_table + cache_index;
if (cache->dev_id == dev_id && cache->disk_id == disk_id if (cache->dev_id == dev_id && cache->disk_id == disk_id
&& cache->sector == sector) && 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_cache_store (unsigned long dev_id, unsigned long disk_id,
grub_disk_addr_t sector, const char *data) grub_disk_addr_t sector, const char *data)
{ {
unsigned index; unsigned cache_index;
struct grub_disk_cache *cache; struct grub_disk_cache *cache;
index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache_index = grub_disk_cache_get_index (dev_id, disk_id, sector);
cache = grub_disk_cache_table + index; cache = grub_disk_cache_table + cache_index;
cache->lock = 1; cache->lock = 1;
grub_free (cache->data); grub_free (cache->data);

View file

@ -641,7 +641,7 @@ grub_vsnprintf_real (char *str, grub_size_t max_len, const char *fmt0, va_list a
const char *fmt; const char *fmt;
auto void write_char (unsigned char ch); auto void write_char (unsigned char ch);
auto void write_str (const char *s); 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) void write_char (unsigned char ch)
{ {

View file

@ -62,8 +62,8 @@ EXPORT_FUNC (grub_parser_cmdline_state) (grub_parser_state_t state,
grub_err_t grub_err_t
EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline, EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline,
grub_reader_getline_t getline, grub_reader_getline_t getline_func,
void *getline_data, void *getline_func_data,
int *argc, char ***argv); int *argc, char ***argv);
struct grub_parser struct grub_parser
@ -81,7 +81,8 @@ struct grub_parser
grub_err_t (*fini) (void); grub_err_t (*fini) (void);
grub_err_t (*parse_line) (char *line, 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; typedef struct grub_parser *grub_parser_t;
@ -89,6 +90,7 @@ grub_err_t grub_parser_execute (char *source);
grub_err_t grub_err_t
grub_rescue_parse_line (char *line, 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 */ #endif /* ! GRUB_PARSER_HEADER */

View file

@ -290,16 +290,16 @@ grub_script_arg_add (struct grub_parser_param *state,
grub_script_arg_type_t type, char *str); grub_script_arg_type_t type, char *str);
struct grub_script *grub_script_parse (char *script, struct grub_script *grub_script_parse (char *script,
grub_reader_getline_t getline, grub_reader_getline_t getline_func,
void *getline_data); void *getline_func_data);
void grub_script_free (struct grub_script *script); void grub_script_free (struct grub_script *script);
struct grub_script *grub_script_create (struct grub_script_cmd *cmd, struct grub_script *grub_script_create (struct grub_script_cmd *cmd,
struct grub_script_mem *mem); struct grub_script_mem *mem);
struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser, struct grub_lexer_param *grub_script_lexer_init (struct grub_parser_param *parser,
char *script, char *script,
grub_reader_getline_t getline, grub_reader_getline_t getline_func,
void *getline_data); void *getline_func_data);
void grub_script_lexer_fini (struct grub_lexer_param *); void grub_script_lexer_fini (struct grub_lexer_param *);
void grub_script_lexer_ref (struct grub_lexer_param *); void grub_script_lexer_ref (struct grub_lexer_param *);
void grub_script_lexer_deref (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_err_t
grub_normal_parse_line (char *line, 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 * static inline struct grub_script *
grub_script_ref (struct grub_script *script) grub_script_ref (struct grub_script *script)

View file

@ -131,7 +131,7 @@ int grub_zfs_nvlist_lookup_uint64 (const char *nvlist, const char *name,
grub_uint64_t *out); grub_uint64_t *out);
char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist, char *grub_zfs_nvlist_lookup_nvlist_array (const char *nvlist,
const char *name, const char *name,
grub_size_t index); grub_size_t array_index);
int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist, int grub_zfs_nvlist_lookup_nvlist_array_get_nelm (const char *nvlist,
const char *name); const char *name);
grub_err_t grub_err_t