[2120] 2009-04-15 Pavel Roskin <[email protected]>

Pavel Roskin <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2120
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2120
Author:   proski
Date:     2009-04-15 20:45:09 +0000 (Wed, 15 Apr 2009)
Log Message:
-----------
2009-04-15  Pavel Roskin  <[email protected]>

	* 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.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/disk/i386/pc/biosdisk.c
    trunk/grub2/disk/raid.c
    trunk/grub2/fs/fshelp.c
    trunk/grub2/include/grub/types.h
    trunk/grub2/kern/i386/coreboot/init.c
    trunk/grub2/util/hostdisk.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/ChangeLog	2009-04-15 20:45:09 UTC (rev 2120)
@@ -1,3 +1,10 @@
+2009-04-15  Pavel Roskin  <[email protected]>
+
+	* 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  <[email protected]>
 
 	* disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages,

Modified: trunk/grub2/disk/i386/pc/biosdisk.c
===================================================================
--- trunk/grub2/disk/i386/pc/biosdisk.c	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/disk/i386/pc/biosdisk.c	2009-04-15 20:45:09 UTC (rev 2120)
@@ -120,7 +120,7 @@
     {
       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)
     {

Modified: trunk/grub2/disk/raid.c
===================================================================
--- trunk/grub2/disk/raid.c	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/disk/raid.c	2009-04-15 20:45:09 UTC (rev 2120)
@@ -604,7 +604,7 @@
       if (!disk)
         return 0;
 
-      if (disk->total_sectors == ULONG_MAX)
+      if (disk->total_sectors == GRUB_ULONG_MAX)
         {
           grub_disk_close (disk);
           return 0;

Modified: trunk/grub2/fs/fshelp.c
===================================================================
--- trunk/grub2/fs/fshelp.c	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/fs/fshelp.c	2009-04-15 20:45:09 UTC (rev 2120)
@@ -83,7 +83,7 @@
 	  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;

Modified: trunk/grub2/include/grub/types.h
===================================================================
--- trunk/grub2/include/grub/types.h	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/include/grub/types.h	2009-04-15 20:45:09 UTC (rev 2120)
@@ -93,11 +93,13 @@
 #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.  */

Modified: trunk/grub2/kern/i386/coreboot/init.c
===================================================================
--- trunk/grub2/kern/i386/coreboot/init.c	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/kern/i386/coreboot/init.c	2009-04-15 20:45:09 UTC (rev 2120)
@@ -81,13 +81,13 @@
   {
 #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);

Modified: trunk/grub2/util/hostdisk.c
===================================================================
--- trunk/grub2/util/hostdisk.c	2009-04-15 16:39:02 UTC (rev 2119)
+++ trunk/grub2/util/hostdisk.c	2009-04-15 20:45:09 UTC (rev 2120)
@@ -1004,7 +1004,7 @@
 	
 	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 @@
                 {
                   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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.