mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
Fix tests on x86_64.
2007-01-04 Behdad Esfahbod <behdad@gnome.org> * tests/bit-test.c (builtin_bit_nth_lsf1), (builtin_bit_nth_lsf2), (builtin_bit_nth_msf): Fix tests on x86_64. svn path=/trunk/; revision=5216
This commit is contained in:
parent
c7006f9ec5
commit
46dae95f4a
@ -1,3 +1,8 @@
|
|||||||
|
2007-01-04 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
|
* tests/bit-test.c (builtin_bit_nth_lsf1), (builtin_bit_nth_lsf2),
|
||||||
|
(builtin_bit_nth_msf): Fix tests on x86_64.
|
||||||
|
|
||||||
2007-01-03 Behdad Esfahbod <behdad@gnome.org>
|
2007-01-03 Behdad Esfahbod <behdad@gnome.org>
|
||||||
|
|
||||||
* glib/goption.c (_g_unichar_get_width), (_g_utf8_strwidth),
|
* glib/goption.c (_g_unichar_get_width), (_g_utf8_strwidth),
|
||||||
|
@ -13,7 +13,7 @@ builtin_bit_nth_lsf1 (gulong mask, gint nth_bit)
|
|||||||
if (nth_bit >= 0)
|
if (nth_bit >= 0)
|
||||||
{
|
{
|
||||||
if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
|
if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
|
||||||
mask &= -(1<<(nth_bit+1));
|
mask &= -(1UL<<(nth_bit+1));
|
||||||
else
|
else
|
||||||
mask = 0;
|
mask = 0;
|
||||||
}
|
}
|
||||||
@ -26,7 +26,7 @@ builtin_bit_nth_lsf2 (gulong mask, gint nth_bit)
|
|||||||
if (nth_bit >= 0)
|
if (nth_bit >= 0)
|
||||||
{
|
{
|
||||||
if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
|
if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
|
||||||
mask &= -(1<<(nth_bit+1));
|
mask &= -(1UL<<(nth_bit+1));
|
||||||
else
|
else
|
||||||
mask = 0;
|
mask = 0;
|
||||||
}
|
}
|
||||||
@ -37,7 +37,7 @@ static gint
|
|||||||
builtin_bit_nth_msf (gulong mask, gint nth_bit)
|
builtin_bit_nth_msf (gulong mask, gint nth_bit)
|
||||||
{
|
{
|
||||||
if (nth_bit >= 0 && nth_bit < GLIB_SIZEOF_LONG * 8)
|
if (nth_bit >= 0 && nth_bit < GLIB_SIZEOF_LONG * 8)
|
||||||
mask &= (1<<nth_bit)-1;
|
mask &= (1UL<<nth_bit)-1;
|
||||||
return mask ? GLIB_SIZEOF_LONG * 8 - 1 - __builtin_clzl(mask) : -1;
|
return mask ? GLIB_SIZEOF_LONG * 8 - 1 - __builtin_clzl(mask) : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user