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> 2009-04-15 Felix Zielcke <fzielcke@z-51.de>
* disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, * 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->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM;
data->sectors = 32; 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) else if (drive & 0x80)
{ {

View file

@ -604,7 +604,7 @@ grub_raid_scan_device (int head_only)
if (!disk) if (!disk)
return 0; return 0;
if (disk->total_sectors == ULONG_MAX) if (disk->total_sectors == GRUB_ULONG_MAX)
{ {
grub_disk_close (disk); grub_disk_close (disk);
return 0; 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 || if (filetype == GRUB_FSHELP_UNKNOWN ||
(grub_strcmp (name, filename) && (grub_strcmp (name, filename) &&
(! (filetype & GRUB_FSHELP_CASE_INSENSITIVE) || (! (filetype & GRUB_FSHELP_CASE_INSENSITIVE) ||
grub_strncasecmp (name, filename, LONG_MAX)))) grub_strncasecmp (name, filename, GRUB_LONG_MAX))))
{ {
grub_free (node); grub_free (node);
return 0; return 0;

View file

@ -93,11 +93,13 @@ typedef grub_int32_t grub_ssize_t;
#endif #endif
#if GRUB_CPU_SIZEOF_VOID_P == 8 #if GRUB_CPU_SIZEOF_VOID_P == 8
# define ULONG_MAX 18446744073709551615UL # define GRUB_ULONG_MAX 18446744073709551615UL
# define LONG_MAX 9223372036854775807UL # define GRUB_LONG_MAX 9223372036854775807UL
# define GRUB_LONG_MIN -9223372036854775808UL
#else #else
# define ULONG_MAX 4294967295UL # define GRUB_ULONG_MAX 4294967295UL
# define LONG_MAX 2147483647UL # define GRUB_LONG_MAX 2147483647UL
# define GRUB_LONG_MIN -2147483648UL
#endif #endif
/* The type for representing a file offset. */ /* The type for representing a file offset. */

View file

@ -81,13 +81,13 @@ grub_machine_init (void)
{ {
#if GRUB_CPU_SIZEOF_VOID_P == 4 #if GRUB_CPU_SIZEOF_VOID_P == 4
/* Restrict ourselves to 32-bit memory space. */ /* 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; return 0;
} }
if (addr + size > ULONG_MAX) if (addr + size > GRUB_ULONG_MAX)
size = ULONG_MAX - addr; size = GRUB_ULONG_MAX - addr;
#endif #endif
grub_upper_mem = grub_max (grub_upper_mem, addr + size); 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++; p++;
n = strtol (p, &q, 10); 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; dos_part = (int) n;
@ -1035,7 +1035,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev)
{ {
p++; p++;
n = strtol (p, &q, 10); 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; dos_part = (int) n - 1;