mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-01 13:23:07 +02:00
Merge branch 'use-ptrdiff' into 'main'
Cast to ptrdiff_t instead of subtracting by null See merge request GNOME/glib!2631
This commit is contained in:
commit
91407cd7ef
@ -263,16 +263,15 @@ msort_r (void *b, size_t n, size_t s, GCompareDataFunc cmp, void *arg)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((s & (sizeof (guint32) - 1)) == 0
|
if ((s & (sizeof (guint32) - 1)) == 0
|
||||||
&& ((char *) b - (char *) 0) % ALIGNOF_GUINT32 == 0)
|
&& (guintptr) b % ALIGNOF_GUINT32 == 0)
|
||||||
{
|
{
|
||||||
if (s == sizeof (guint32))
|
if (s == sizeof (guint32))
|
||||||
p.var = 0;
|
p.var = 0;
|
||||||
else if (s == sizeof (guint64)
|
else if (s == sizeof (guint64)
|
||||||
&& ((char *) b - (char *) 0) % ALIGNOF_GUINT64 == 0)
|
&& (guintptr) b % ALIGNOF_GUINT64 == 0)
|
||||||
p.var = 1;
|
p.var = 1;
|
||||||
else if ((s & (sizeof (unsigned long) - 1)) == 0
|
else if ((s & (sizeof (unsigned long) - 1)) == 0
|
||||||
&& ((char *) b - (char *) 0)
|
&& (guintptr) b % ALIGNOF_UNSIGNED_LONG == 0)
|
||||||
% ALIGNOF_UNSIGNED_LONG == 0)
|
|
||||||
p.var = 2;
|
p.var = 2;
|
||||||
}
|
}
|
||||||
msort_with_tmp (&p, b, n);
|
msort_with_tmp (&p, b, n);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user