Misc cleanup.
* kern/command.c (grub_register_command_prio): Use
grub_zalloc() instead of explicitly zeroing data.
* kern/list.c: Include `<grub/mm.h>'.
(grub_named_list_find): Replace `0' with `NULL'.
* normal/autofs.c (struct grub_fs_module_list): Remove ad-hoc type.
(fs_module_list): Change type to `grub_named_list_t'. Update all
users.
* normal/dyncmd.c (read_command_list): Add space between function
call and parenthesis.
* normal/handler.c (read_handler_list): Likewise.
+2009-11-09 Robert Millan <rmh.grub@aybabtu.com>
+
+ Misc cleanup.
+
+ * kern/command.c (grub_register_command_prio): Use
+ grub_zalloc() instead of explicitly zeroing data.
+ * kern/list.c: Include `<grub/mm.h>'.
+ (grub_named_list_find): Replace `0' with `NULL'.
+ * normal/autofs.c (struct grub_fs_module_list): Remove ad-hoc type.
+ (fs_module_list): Change type to `grub_named_list_t'. Update all
+ users.
+ * normal/dyncmd.c (read_command_list): Add space between function
+ call and parenthesis.
+ * normal/handler.c (read_handler_list): Likewise.
+
2009-11-09 Robert Millan <rmh.grub@aybabtu.com>
* normal/auth.c (punishment_delay): Moved from here ...
{
grub_command_t cmd;
- cmd = (grub_command_t) grub_malloc (sizeof (*cmd));
+ cmd = (grub_command_t) grub_zalloc (sizeof (*cmd));
if (! cmd)
return 0;
cmd->flags = GRUB_COMMAND_FLAG_BOTH;
cmd->prio = prio;
- cmd->data = 0;
grub_prio_list_insert (GRUB_AS_PRIO_LIST_P (&grub_command_list),
GRUB_AS_PRIO_LIST (cmd));
#include <grub/list.h>
#include <grub/misc.h>
+#include <grub/mm.h>
void
grub_list_push (grub_list_t *head, grub_list_t item)
void *
grub_named_list_find (grub_named_list_t head, const char *name)
{
- grub_named_list_t result = 0;
+ grub_named_list_t result = NULL;
auto int list_find (grub_named_list_t item);
int list_find (grub_named_list_t item)
#include <grub/normal.h>
/* This is used to store the names of filesystem modules for auto-loading. */
-struct grub_fs_module_list
-{
- char *name;
- struct grub_fs_module_list *next;
-};
-typedef struct grub_fs_module_list *grub_fs_module_list_t;
-
-static grub_fs_module_list_t fs_module_list = 0;
+static grub_named_list_t fs_module_list;
/* The auto-loading hook for filesystems. */
static int
autoload_fs_module (void)
{
- grub_fs_module_list_t p;
+ grub_named_list_t p;
- while ((p = fs_module_list) != 0)
+ while ((p = fs_module_list) != NULL)
{
if (! grub_dl_get (p->name) && grub_dl_load (p->name))
return 1;
char *buf;
char *p;
char *q;
- grub_fs_module_list_t fs_mod;
+ grub_named_list_t fs_mod;
buf = grub_file_getline (file);
if (! buf)
if (file)
{
char *buf = 0;
- for (;; grub_free(buf))
+ for (;; grub_free (buf))
{
char *p, *name, *modname;
grub_command_t cmd;
if (file)
{
char *buf = 0;
- for (;; grub_free(buf))
+ for (;; grub_free (buf))
{
char *p;