2009-06-10 Pavel Roskin <proski@gnu.org>

* kern/file.c (grub_file_read): Use void pointer for the buffer.
	Adjust all callers.
This commit is contained in:
proski 2009-06-10 23:47:49 +00:00
parent 27d5fef717
commit 5c5215d5e2
22 changed files with 59 additions and 56 deletions

View file

@ -636,7 +636,7 @@ grub_bsd_load_aout (grub_file_t file)
if ((grub_file_seek (file, 0)) == (grub_off_t) - 1)
return grub_errno;
if (grub_file_read (file, (char *) &ah, sizeof (ah)) != sizeof (ah))
if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah))
return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header");
if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32)
@ -988,7 +988,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
grub_file_read (file, (char *) kern_end, file->size);
grub_file_read (file, (void *) kern_end, file->size);
if ((!grub_errno) &&
(!grub_freebsd_add_meta_module (0, argc, argv, kern_end, file->size)))
kern_end = ALIGN_PAGE (kern_end + file->size);

View file

@ -616,7 +616,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (! file)
goto fail;
if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh))
if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
{
grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
goto fail;
@ -851,7 +851,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
len = prot_size;
if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
if (grub_errno == GRUB_ERR_NONE)

View file

@ -163,7 +163,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (! file)
goto fail;
if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh))
if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
{
grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
goto fail;
@ -257,7 +257,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
goto fail;
initrd_size = grub_file_size (file);
if (grub_file_read (file, (char *) GRUB_OFW_LINUX_INITRD_ADDR,
if (grub_file_read (file, (void *) GRUB_OFW_LINUX_INITRD_ADDR,
initrd_size) != (int) initrd_size)
{
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");

View file

@ -602,7 +602,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
if (! file)
goto fail;
if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh))
if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
{
grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
goto fail;
@ -838,7 +838,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
len = prot_size;
if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
if (grub_errno == GRUB_ERR_NONE)

View file

@ -68,7 +68,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags)
goto fail;
/* Read the first block. */
if (grub_file_read (file, (char *) 0x7C00, GRUB_DISK_SECTOR_SIZE)
if (grub_file_read (file, (void *) 0x7C00, GRUB_DISK_SECTOR_SIZE)
!= GRUB_DISK_SECTOR_SIZE)
{
if (grub_errno == GRUB_ERR_NONE)

View file

@ -79,7 +79,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh))
if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh))
{
grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header");
goto fail;
@ -264,7 +264,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
}
len = prot_size;
if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len)
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
if (grub_errno == GRUB_ERR_NONE)
@ -361,7 +361,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
goto fail;
}
if (grub_file_read (file, (void *)addr, size) != size)
if (grub_file_read (file, (void *) addr, size) != size)
{
grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file");
goto fail;