mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-24 08:06:52 +02:00
avoid warning in gutils.h when using gcc with -Wconversion
Old solution to avoid warning with gcc flag -Wconversion does not work with gcc >=4.3 since the behaviour for that flag has been changed, ref. http://gcc.gnu.org/wiki/NewWconversion. Now cast for __builtin_clzl is required, which itself is declared to return int. https://bugzilla.gnome.org/show_bug.cgi?id=619026
This commit is contained in:
parent
be6955a008
commit
2ef1a8ef05
@ -304,7 +304,7 @@ g_bit_storage (gulong number)
|
|||||||
{
|
{
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
|
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
|
||||||
return G_LIKELY (number) ?
|
return G_LIKELY (number) ?
|
||||||
((GLIB_SIZEOF_LONG * 8U - 1) ^ __builtin_clzl(number)) + 1 : 1;
|
((GLIB_SIZEOF_LONG * 8U - 1) ^ (guint) __builtin_clzl(number)) + 1 : 1;
|
||||||
#else
|
#else
|
||||||
register guint n_bits = 0;
|
register guint n_bits = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user