+2009-06-08 Pavel Roskin <proski@gnu.org>
+
+ * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning
+ about aliasing.
+
2009-06-08 Felix Zielcke <fzielcke@z-51.de>
* Makefile.in (uninstall): Remove all $lib_DATA files.
int inode = data->rootdir;
char *next;
char *origpath;
- struct grub_hfs_filerec frec;
- struct grub_hfs_dirrec *dir = (struct grub_hfs_dirrec *) &frec;
- frec.type = GRUB_HFS_FILETYPE_DIR;
+ union {
+ struct grub_hfs_filerec frec;
+ struct grub_hfs_dirrec dir;
+ } fdrec;
+
+ fdrec.frec.type = GRUB_HFS_FILETYPE_DIR;
if (path[0] != '/')
{
while (path && grub_strlen (path))
{
- if (frec.type != GRUB_HFS_FILETYPE_DIR)
+ if (fdrec.frec.type != GRUB_HFS_FILETYPE_DIR)
{
grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory");
goto fail;
/* Lookup this node. */
if (! grub_hfs_find_node (data, (char *) &key, data->cat_root,
- 0, (char *) &frec, sizeof (frec)))
+ 0, (char *) &fdrec.frec, sizeof (fdrec.frec)))
{
grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found");
goto fail;
if (grub_errno)
goto fail;
- inode = grub_be_to_cpu32 (dir->dirid);
+ inode = grub_be_to_cpu32 (fdrec.dir.dirid);
path = next;
}
if (retdata)
- grub_memcpy (retdata, &frec, sizeof (frec));
+ grub_memcpy (retdata, &fdrec.frec, sizeof (fdrec.frec));
if (retinode)
*retinode = inode;