1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Fix qsort callouts used for sorting memory regions during boot. vm_offset_t

is unsigned, so we can't use signed arithmetic.

Tripped over by:	jhb
This commit is contained in:
Jake Burkholder 2002-01-08 04:43:04 +00:00
parent 338f7e3e47
commit 77a240d5da
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89036

View File

@ -216,14 +216,32 @@ static int om_cmp(const void *a, const void *b);
static int
mr_cmp(const void *a, const void *b)
{
return ((const struct mem_region *)a)->mr_start -
((const struct mem_region *)b)->mr_start;
const struct mem_region *mra;
const struct mem_region *mrb;
mra = a;
mrb = b;
if (mra->mr_start < mrb->mr_start)
return (-1);
else if (mra->mr_start > mrb->mr_start)
return (1);
else
return (0);
}
static int
om_cmp(const void *a, const void *b)
{
return ((const struct ofw_map *)a)->om_start -
((const struct ofw_map *)b)->om_start;
const struct ofw_map *oma;
const struct ofw_map *omb;
oma = a;
omb = b;
if (oma->om_start < omb->om_start)
return (-1);
else if (oma->om_start > omb->om_start)
return (1);
else
return (0);
}
/*