]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/script/argv.c (round_up_exp): unsigned is 32-bit on all
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 13:11:19 +0000 (14:11 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 22 Jan 2011 13:11:19 +0000 (14:11 +0100)
supported platforms. Put a compile time assert for this rather than
generate a warning with 32-bit shift.

ChangeLog
grub-core/script/argv.c

index 16be610ea09e87cc58249e7e4ac0c5c7cbe8aad4..9e4ea21dd3f465025638709d75a8319a2d46515c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-22  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/script/argv.c (round_up_exp): unsigned is 32-bit on all
+       supported platforms. Put a compile time assert for this rather than
+       generate a warning with 32-bit shift.
+
 2011-01-22  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/disk/scsi.c (grub_scsi_read): Fix binary and check and make
index 50f810fcfbb11e6d146dd91f354cab32300e0792..856828d7b15e0a46a611ed036757838e9098c1c8 100644 (file)
@@ -25,6 +25,8 @@
 static unsigned
 round_up_exp (unsigned v)
 {
+  COMPILE_TIME_ASSERT (sizeof (v) == 4);
+
   v--;
   v |= v >> 1;
   v |= v >> 2;
@@ -32,9 +34,6 @@ round_up_exp (unsigned v)
   v |= v >> 8;
   v |= v >> 16;
 
-  if (sizeof (v) > 4)
-    v |= v >> 32;
-
   v++;
   v += (v == 0);