]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-01-03 Marco Gerards <marco@gnu.org>
authormarco_g <marco_g@localhost>
Tue, 3 Jan 2006 16:27:31 +0000 (16:27 +0000)
committermarco_g <marco_g@localhost>
Tue, 3 Jan 2006 16:27:31 +0000 (16:27 +0000)
* fs/hfsplus.c (grub_hfsplus_read_block): Convert the offset of
the HFS+ filesystem to filesystem blocks.
(grub_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a
GCC warning is silenced.

ChangeLog
fs/hfsplus.c

index 8348f90ffdfabb8d42ed91ef682bacff440d95aa..520da5797dc7fb00c8b83132233b91312051952b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-01-03  Marco Gerards  <marco@gnu.org>
+
+       * fs/hfsplus.c (grub_hfsplus_read_block): Convert the offset of
+       the HFS+ filesystem to filesystem blocks.
+       (grub_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a
+       GCC warning is silenced.
+
 2006-01-03  Marco Gerards  <marco@gnu.org>
 
        * partmap/apple.c (apple_partition_map_iterate): Convert the data
index b6682685dd0285e47671f7bd05989bfd3a4df304..b29fb1f3c84fccdf0935a6d8fa98299e9503a4a5 100644 (file)
@@ -279,7 +279,8 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, int fileblock)
       /* Try to find this block in the current set of extents.  */
       blk = grub_hfsplus_find_block (extents, fileblock, &retry);
       if (blk != -1)
-       return blk + node->data->embedded_offset;
+       return blk + (node->data->embedded_offset >> (node->data->log2blksize
+                                                     - GRUB_DISK_SECTOR_BITS));
 
       /* The previous iteration of this loop allocated memory.  The
         code above used this memory, it can be free'ed now.  */
@@ -704,8 +705,11 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir,
 
       catkey = (struct grub_hfsplus_catkey *) record;
 
-      fileinfo = (record + grub_be_to_cpu16 (catkey->keylen)
-                 + 2 + grub_be_to_cpu16(catkey->keylen) % 2);
+      fileinfo =
+       (struct grub_hfsplus_catfile *) ((char *) record 
+                                        + grub_be_to_cpu16 (catkey->keylen)
+                                        + 2 + (grub_be_to_cpu16(catkey->keylen)
+                                               % 2));
 
       /* Stop iterating when the last directory entry was found.  */
       if (grub_be_to_cpu32 (catkey->parent) != dir->fileid)