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

@ -88,7 +88,7 @@ grub_jpeg_get_byte (struct grub_jpeg_data *data)
grub_uint8_t r;
r = 0;
grub_file_read (data->file, (char *) &r, 1);
grub_file_read (data->file, &r, 1);
return r;
}
@ -99,7 +99,7 @@ grub_jpeg_get_word (struct grub_jpeg_data *data)
grub_uint16_t r;
r = 0;
grub_file_read (data->file, (char *) &r, sizeof (grub_uint16_t));
grub_file_read (data->file, &r, sizeof (grub_uint16_t));
return grub_be_to_cpu16 (r);
}
@ -181,7 +181,7 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data)
return grub_error (GRUB_ERR_BAD_FILE_TYPE,
"jpeg: too many huffman tables");
if (grub_file_read (data->file, (char *) &count, sizeof (count)) !=
if (grub_file_read (data->file, &count, sizeof (count)) !=
sizeof (count))
return grub_errno;
@ -194,7 +194,7 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data)
if (grub_errno)
return grub_errno;
if (grub_file_read (data->file, (char *) data->huff_value[id], n) != n)
if (grub_file_read (data->file, data->huff_value[id], n) != n)
return grub_errno;
base = 0;
@ -234,7 +234,7 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data)
return grub_error (GRUB_ERR_BAD_FILE_TYPE,
"jpeg: too many quantization tables");
if (grub_file_read (data->file, (char *) &data->quan_table[id], 64) != 64)
if (grub_file_read (data->file, &data->quan_table[id], 64) != 64)
return grub_errno;
if (data->file->offset != next_marker)

View file

@ -118,7 +118,7 @@ grub_png_get_dword (struct grub_png_data *data)
grub_uint32_t r;
r = 0;
grub_file_read (data->file, (char *) &r, sizeof (grub_uint32_t));
grub_file_read (data->file, &r, sizeof (grub_uint32_t));
return grub_be_to_cpu32 (r);
}
@ -160,7 +160,7 @@ grub_png_get_byte (struct grub_png_data *data)
}
r = 0;
grub_file_read (data->file, (char *) &r, 1);
grub_file_read (data->file, &r, 1);
if (data->inside_idat)
data->idat_remain--;
@ -781,7 +781,7 @@ grub_png_decode_png (struct grub_png_data *data)
{
grub_uint8_t magic[8];
if (grub_file_read (data->file, (char *) &magic[0], 8) != 8)
if (grub_file_read (data->file, &magic[0], 8) != 8)
return grub_errno;
if (grub_memcmp (magic, png_magic, sizeof (png_magic)))

View file

@ -98,7 +98,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap,
for (x = 0; x < header->image_width;)
{
if (grub_file_read (file, (char *)&type, sizeof (type)) != sizeof(type))
if (grub_file_read (file, &type, sizeof (type)) != sizeof(type))
return grub_errno;
if (type & 0x80)
@ -107,7 +107,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap,
type &= 0x7f;
type++;
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -132,7 +132,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap,
while (type)
{
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -177,7 +177,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap,
for (x = 0; x < header->image_width;)
{
if (grub_file_read (file, (char *)&type, sizeof (type)) != sizeof(type))
if (grub_file_read (file, &type, sizeof (type)) != sizeof(type))
return grub_errno;
if (type & 0x80)
@ -186,7 +186,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap,
type &= 0x7f;
type++;
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -212,7 +212,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap,
while (type)
{
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -257,7 +257,7 @@ tga_load_truecolor_R8G8B8 (struct grub_video_bitmap *bitmap,
for (x = 0; x < header->image_width; x++)
{
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -294,7 +294,7 @@ tga_load_truecolor_R8G8B8A8 (struct grub_video_bitmap *bitmap,
for (x = 0; x < header->image_width; x++)
{
if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel)
if (grub_file_read (file, &tmp[0], bytes_per_pixel)
!= bytes_per_pixel)
return grub_errno;
@ -327,7 +327,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap,
not going to support developer area & extensions at this point. */
/* Read TGA header from beginning of file. */
if (grub_file_read (file, (char*)&header, sizeof (header))
if (grub_file_read (file, &header, sizeof (header))
!= sizeof (header))
{
grub_file_close (file);