]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-04-15 Pavel Roskin <proski@gnu.org>
authorproski <proski@localhost>
Wed, 15 Apr 2009 20:45:09 +0000 (20:45 +0000)
committerproski <proski@localhost>
Wed, 15 Apr 2009 20:45:09 +0000 (20:45 +0000)
* include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and
LONG_MAX to GRUB_LONG_MAX.  Introduce GRUB_LONG_MIN.  Update all
users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new
definitions.

ChangeLog
disk/i386/pc/biosdisk.c
disk/raid.c
fs/fshelp.c
include/grub/types.h
kern/i386/coreboot/init.c
util/hostdisk.c

index 02e89cda865ab9ddbb2a77482d3833cee9967a0b..2c9b65757e92edf036e43e30d426a38b746b48b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-04-15  Pavel Roskin  <proski@gnu.org>
+
+       * include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and
+       LONG_MAX to GRUB_LONG_MAX.  Introduce GRUB_LONG_MIN.  Update all
+       users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new
+       definitions.
+
 2009-04-15  Felix Zielcke  <fzielcke@z-51.de>
 
        * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages,
index 120d46f2518206d1d1eb160bf6133e15b5975ffc..ba1eb77b85bf30e2c46babc5a69d8d4f768b406c 100644 (file)
@@ -120,7 +120,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
     {
       data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM;
       data->sectors = 32;
-      total_sectors = ULONG_MAX;  /* TODO: get the correct size.  */
+      total_sectors = GRUB_ULONG_MAX;  /* TODO: get the correct size.  */
     }
   else if (drive & 0x80)
     {
index 4d6422236687a9decf2a74572aa3ffba4c155388..2b3130b204acbd85178743478ae1197cdf45126e 100644 (file)
@@ -604,7 +604,7 @@ grub_raid_scan_device (int head_only)
       if (!disk)
         return 0;
 
-      if (disk->total_sectors == ULONG_MAX)
+      if (disk->total_sectors == GRUB_ULONG_MAX)
         {
           grub_disk_close (disk);
           return 0;
index a5eccdd682df33f955128273dfe0a74fd52d8b9b..89b62387fef49502505abba6959243498a1aba38 100644 (file)
@@ -83,7 +83,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode,
          if (filetype == GRUB_FSHELP_UNKNOWN ||
               (grub_strcmp (name, filename) &&
                (! (filetype & GRUB_FSHELP_CASE_INSENSITIVE) ||
-                grub_strncasecmp (name, filename, LONG_MAX))))
+                grub_strncasecmp (name, filename, GRUB_LONG_MAX))))
            {
              grub_free (node);
              return 0;
index 8d51b66f7a29cde241103f66d7ee79dddb9fdaaa..50f8f58d5c83043ebb7c50c196defea3921c72ea 100644 (file)
@@ -93,11 +93,13 @@ typedef grub_int32_t        grub_ssize_t;
 #endif
 
 #if GRUB_CPU_SIZEOF_VOID_P == 8
-# define ULONG_MAX 18446744073709551615UL
-# define LONG_MAX 9223372036854775807UL
+# define GRUB_ULONG_MAX 18446744073709551615UL
+# define GRUB_LONG_MAX 9223372036854775807UL
+# define GRUB_LONG_MIN -9223372036854775808UL
 #else
-# define ULONG_MAX 4294967295UL
-# define LONG_MAX 2147483647UL
+# define GRUB_ULONG_MAX 4294967295UL
+# define GRUB_LONG_MAX 2147483647UL
+# define GRUB_LONG_MIN -2147483648UL
 #endif
 
 /* The type for representing a file offset.  */
index 13484886df7e7789c0c37810211fc95b5c06e012..fdaf6fd84de36060eabb23223cebe9bf0796c063 100644 (file)
@@ -81,13 +81,13 @@ grub_machine_init (void)
   {
 #if GRUB_CPU_SIZEOF_VOID_P == 4
     /* Restrict ourselves to 32-bit memory space.  */
-    if (addr > ULONG_MAX)
+    if (addr > GRUB_ULONG_MAX)
       {
-       grub_upper_mem = ULONG_MAX;
+       grub_upper_mem = GRUB_ULONG_MAX;
        return 0;
       }
-    if (addr + size > ULONG_MAX)
-      size = ULONG_MAX - addr;
+    if (addr + size > GRUB_ULONG_MAX)
+      size = GRUB_ULONG_MAX - addr;
 #endif
 
     grub_upper_mem = grub_max (grub_upper_mem, addr + size);
index 2fd1010a25ca3837cf2e1f8116cc7362f76ae3eb..aa41703fedb7a0cafa25a966c2cdd063adec4ea2 100644 (file)
@@ -1004,7 +1004,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
        
        p++;
        n = strtol (p, &q, 10);
-       if (p != q && n != LONG_MIN && n != LONG_MAX)
+       if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX)
          {
            dos_part = (int) n;
            
@@ -1035,7 +1035,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
                 {
                   p++;
                   n = strtol (p, &q, 10);
-                  if (p != q && n != LONG_MIN && n != LONG_MAX)
+                  if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX)
                     {
                       dos_part = (int) n - 1;