diff --git a/ChangeLog b/ChangeLog index 04211e958..99ec49b6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-04-01 Pavel Roskin + * disk/ata.c (grub_ata_open): Don't lose precision in disk->id. + * disk/host.c (grub_host_open): Likewise. + * disk/loopback.c (grub_loopback_open): Likewise. + * disk/memdisk.c (grub_memdisk_open): Use a string pointer for + disk->id as in disk/host.c, not a multi-character constant. + * util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The later is obsolete, potentially dangerous and sets a bad example. * util/i386/efi/grub-mkimage.c (make_header): Likewise. diff --git a/disk/ata.c b/disk/ata.c index 90ed0e101..e75af9031 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -615,7 +615,7 @@ grub_ata_open (const char *name, grub_disk_t disk) else disk->total_sectors = dev->size; - disk->id = (int) dev; + disk->id = (unsigned long) dev; disk->has_partitions = !dev->atapi; disk->data = dev; diff --git a/disk/host.c b/disk/host.c index ccd410169..bb8828a6c 100644 --- a/disk/host.c +++ b/disk/host.c @@ -41,7 +41,7 @@ grub_host_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); disk->total_sectors = 0; - disk->id = (int) "host"; + disk->id = (unsigned long) "host"; disk->has_partitions = 0; disk->data = 0; diff --git a/disk/loopback.c b/disk/loopback.c index 521c710f8..709c422df 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -177,7 +177,7 @@ grub_loopback_open (const char *name, grub_disk_t disk) /* Use the filesize for the disk size, round up to a complete sector. */ disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1) / GRUB_DISK_SECTOR_SIZE); - disk->id = (int) dev; + disk->id = (unsigned long) dev; disk->has_partitions = dev->has_partitions; disk->data = file; diff --git a/disk/memdisk.c b/disk/memdisk.c index c77eef174..840ef369c 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -41,7 +41,7 @@ grub_memdisk_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a memdisk"); disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE; - disk->id = (int) 'mdsk'; + disk->id = (unsigned long) "mdsk"; disk->has_partitions = 0; return GRUB_ERR_NONE;