isohybrid: fix isohybrid.c compile
authorFrediano Ziglio <frediano.ziglio@citrix.com>
Fri, 31 Aug 2012 11:00:16 +0000 (12:00 +0100)
committerMatt Fleming <matt.fleming@intel.com>
Wed, 10 Oct 2012 10:00:03 +0000 (11:00 +0100)
Make isohybrid.c compile on gcc 4.4 32 bit instead of producing the
following error,

isohybrid.c: In function ‘lendian_64’:
isohybrid.c:437: error: integer constant is too large for ‘long’ type

Cc: Matthew Garrett <mjg@redhat.com>
Cc: Michal Soltys <soltys@ziu.info>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
utils/isohybrid.c

index ac04bfd..97d43b8 100644 (file)
@@ -434,10 +434,10 @@ lendian_64(const uint64_t s)
        if (*(uint8_t *)&r)
                return s;
 
-       r = (s & 0x00000000000000FF) << 56 | (s & 0xFF00000000000000) >> 56
-            | (s & 0x000000000000FF00) << 40 | (s & 0x00FF000000000000) >> 40
-            | (s & 0x0000000000FF0000) << 24 | (s & 0x0000FF0000000000) >> 24
-            | (s & 0x00000000FF000000) << 8 | (s & 0x000000FF00000000) >> 8;
+       r = (s & 0x00000000000000FFull) << 56 | (s & 0xFF00000000000000ull) >> 56
+            | (s & 0x000000000000FF00ull) << 40 | (s & 0x00FF000000000000ull) >> 40
+            | (s & 0x0000000000FF0000ull) << 24 | (s & 0x0000FF0000000000ull) >> 24
+            | (s & 0x00000000FF000000ull) << 8 | (s & 0x000000FF00000000ull) >> 8;
 
        return r;
 }
@@ -759,7 +759,7 @@ initialise_gpt(uint8_t *gpt, uint32_t current, uint32_t alternate, int primary)
        reverse_uuid(disk_uuid);
     }
 
-    header->signature = lendian_64(0x5452415020494645);
+    header->signature = lendian_64(0x5452415020494645ull);
     header->revision = lendian_int(0x010000);
     header->headerSize = lendian_int(0x5c);
     header->currentLBA = lendian_64(current);