Use FOR_LIST_ELEMENTS convenience macros
This commit is contained in:
parent
42ca71ca47
commit
3f8ae91c09
5 changed files with 8 additions and 8 deletions
|
@ -115,7 +115,7 @@ grub_command_execute (const char *name, int argc, char **argv)
|
|||
return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
|
||||
}
|
||||
|
||||
#define FOR_COMMANDS(var) for ((var) = grub_command_list; (var); (var) = (var)->next)
|
||||
#define FOR_COMMANDS(var) FOR_LIST_ELEMENTS((var), grub_command_list)
|
||||
|
||||
void grub_register_core_commands (void);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ grub_partition_map_unregister (grub_partition_map_t partmap)
|
|||
GRUB_AS_LIST (partmap));
|
||||
}
|
||||
|
||||
#define FOR_PARTITION_MAPS(var) for (var = grub_partition_map_list; var; var = var->next)
|
||||
#define FOR_PARTITION_MAPS(var) FOR_LIST_ELEMENTS((var), (grub_partition_map_list))
|
||||
|
||||
|
||||
static inline grub_disk_addr_t
|
||||
|
|
|
@ -245,10 +245,10 @@ grub_term_unregister_output (grub_term_output_t term)
|
|||
GRUB_AS_LIST (term));
|
||||
}
|
||||
|
||||
#define FOR_ACTIVE_TERM_INPUTS(var) for (var = grub_term_inputs; var; var = var->next)
|
||||
#define FOR_DISABLED_TERM_INPUTS(var) for (var = grub_term_inputs_disabled; var; var = var->next)
|
||||
#define FOR_ACTIVE_TERM_OUTPUTS(var) for (var = grub_term_outputs; var; var = var->next)
|
||||
#define FOR_DISABLED_TERM_OUTPUTS(var) for (var = grub_term_outputs_disabled; var; var = var->next)
|
||||
#define FOR_ACTIVE_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs))
|
||||
#define FOR_DISABLED_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs_disabled))
|
||||
#define FOR_ACTIVE_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs))
|
||||
#define FOR_DISABLED_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs_disabled))
|
||||
|
||||
void EXPORT_FUNC(grub_putchar) (int c);
|
||||
void EXPORT_FUNC(grub_putcode) (grub_uint32_t code,
|
||||
|
|
|
@ -140,7 +140,7 @@ is_authenticated (const char *userlist)
|
|||
if (!superusers)
|
||||
return 1;
|
||||
|
||||
for (user = users; user; user = user->next)
|
||||
FOR_LIST_ELEMENTS (user, users)
|
||||
{
|
||||
if (!(user->authenticated))
|
||||
continue;
|
||||
|
|
|
@ -28,7 +28,7 @@ grub_functional_test (struct grub_extcmd *cmd __attribute__ ((unused)),
|
|||
{
|
||||
grub_test_t test;
|
||||
|
||||
for (test = grub_test_list; test; test = test->next)
|
||||
FOR_LIST_ELEMENTS (test, grub_test_list)
|
||||
grub_test_run (test);
|
||||
return GRUB_ERR_NONE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue