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.
This commit is contained in:
proski 2009-04-15 20:45:09 +00:00
parent 6b4c4aa38b
commit 41bb0fe9a6
7 changed files with 22 additions and 13 deletions

View File

@ -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,

View 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)
{

View 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;

View 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;

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

View 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);

View 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;