]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix spurious warning.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 23 Jun 2011 18:05:39 +0000 (20:05 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 23 Jun 2011 18:05:39 +0000 (20:05 +0200)
* grub-core/partmap/acorn.c (grub_acorn_boot_block): Make a union.
(acorn_partition_map_find): Use .bin member.

ChangeLog
grub-core/partmap/acorn.c

index 0ea09a0ab15ffd7622dcc5c354b6e7e827d9276a..a455d9b6b414aecfcfc7264459e2e06799d18987 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-06-23  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Fix spurious warning.
+
+       * grub-core/partmap/acorn.c (grub_acorn_boot_block): Make a union.
+       (acorn_partition_map_find): Use .bin member.
+
 2011-06-23  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/kern/emu/getroot.c (grub_guess_root_device): Don't accept
index 9a68ddd92c5b635ab3640ae49476007fc7b89039..341b8ac5fda16db0bbe511d20335d4b15d52c3e0 100644 (file)
@@ -34,11 +34,18 @@ GRUB_MOD_LICENSE ("GPLv3+");
 
 struct grub_acorn_boot_block
 {
-  grub_uint8_t misc[0x1C0];
-  struct grub_filecore_disc_record disc_record;
-  grub_uint8_t flags;
-  grub_uint16_t start_cylinder;
-  grub_uint8_t checksum;
+  union
+  {
+    struct
+    {
+      grub_uint8_t misc[0x1C0];
+      struct grub_filecore_disc_record disc_record;
+      grub_uint8_t flags;
+      grub_uint16_t start_cylinder;
+      grub_uint8_t checksum;
+    } __attribute__ ((packed, aligned));
+    grub_uint8_t bin[0x200];
+  };
 } __attribute__ ((packed, aligned));
 
 struct linux_part
@@ -71,7 +78,7 @@ acorn_partition_map_find (grub_disk_t disk, struct linux_part *m,
     goto fail;
 
   for (i = 0; i != 0x1ff; ++i)
-    checksum = (checksum & 0xff) + (checksum >> 8) + boot.misc[i];
+    checksum = ((checksum & 0xff) + (checksum >> 8) + boot.bin[i]);
 
   if ((grub_uint8_t) checksum != boot.checksum)
     goto fail;