2008-07-02 Pavel Roskin <proski@gnu.org>

* fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t
	for file offsets, use grub_off_t instead.  Fix printf format
	warnings.
This commit is contained in:
proski 2008-07-02 20:02:54 +00:00
parent ca62e5986f
commit c9c8e6063f
2 changed files with 14 additions and 7 deletions

View file

@ -1,5 +1,9 @@
2008-07-02 Pavel Roskin <proski@gnu.org> 2008-07-02 Pavel Roskin <proski@gnu.org>
* fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t
for file offsets, use grub_off_t instead. Fix printf format
warnings.
* fs/reiserfs.c: Remove #warning, TODO list items don't belong * fs/reiserfs.c: Remove #warning, TODO list items don't belong
there. Real unexpected warnings should not drown in the noise there. Real unexpected warnings should not drown in the noise
about known problems. about known problems.

View file

@ -1079,7 +1079,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
grub_uint16_t item_size; grub_uint16_t item_size;
grub_uint32_t *indirect_block_ptr = 0; grub_uint32_t *indirect_block_ptr = 0;
grub_uint64_t current_key_offset = 1; grub_uint64_t current_key_offset = 1;
grub_size_t initial_position, current_position, final_position, length; grub_off_t initial_position, current_position, final_position, length;
grub_disk_addr_t block; grub_disk_addr_t block;
grub_off_t offset; grub_off_t offset;
@ -1094,9 +1094,11 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
current_position = 0; current_position = 0;
final_position = MIN (len + initial_position, file->size); final_position = MIN (len + initial_position, file->size);
grub_dprintf ("reiserfs", grub_dprintf ("reiserfs",
"Reading from %d to %d (%d instead of requested %d)\n", "Reading from %lld to %lld (%lld instead of requested %ld)\n",
initial_position, final_position, (unsigned long long) initial_position,
final_position - initial_position, len); (unsigned long long) final_position,
(unsigned long long) (final_position - initial_position),
(unsigned long) len);
while (current_position < final_position) while (current_position < final_position)
{ {
grub_reiserfs_set_key_offset (&key, current_key_offset); grub_reiserfs_set_key_offset (&key, current_key_offset);
@ -1191,9 +1193,10 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len)
current_key_offset = current_position + 1; current_key_offset = current_position + 1;
} }
grub_dprintf("reiserfs", grub_dprintf ("reiserfs",
"Have successfully read %d bytes (%d requested)\n", "Have successfully read %lld bytes (%ld requested)\n",
current_position - initial_position, len); (unsigned long long) (current_position - initial_position),
(unsigned long) len);
return current_position - initial_position; return current_position - initial_position;
/* /*
switch (found.type) switch (found.type)