Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 165257
Collapse All | Expand All

(-)glib-2.12.7/tests/bit-test.c (-3 / +3 lines)
Lines 13-19 Link Here
13
  if (nth_bit >= 0)
13
  if (nth_bit >= 0)
14
    {
14
    {
15
      if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
15
      if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
16
	mask &= -(1<<(nth_bit+1));
16
	mask &= -(1UL<<(nth_bit+1));
17
      else
17
      else
18
	mask = 0;
18
	mask = 0;
19
    }
19
    }
Lines 26-32 Link Here
26
  if (nth_bit >= 0)
26
  if (nth_bit >= 0)
27
    {
27
    {
28
      if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
28
      if (G_LIKELY (nth_bit < GLIB_SIZEOF_LONG * 8 - 1))
29
	mask &= -(1<<(nth_bit+1));
29
	mask &= -(1UL<<(nth_bit+1));
30
      else
30
      else
31
	mask = 0;
31
	mask = 0;
32
    }
32
    }
Lines 37-43 Link Here
37
builtin_bit_nth_msf (gulong mask, gint nth_bit)
37
builtin_bit_nth_msf (gulong mask, gint nth_bit)
38
{
38
{
39
  if (nth_bit >= 0 && nth_bit < GLIB_SIZEOF_LONG * 8)
39
  if (nth_bit >= 0 && nth_bit < GLIB_SIZEOF_LONG * 8)
40
    mask &= (1<<nth_bit)-1;
40
    mask &= (1UL<<nth_bit)-1;
41
  return mask ? GLIB_SIZEOF_LONG * 8 - 1 - __builtin_clzl(mask) : -1;
41
  return mask ? GLIB_SIZEOF_LONG * 8 - 1 - __builtin_clzl(mask) : -1;
42
}
42
}
43
43

Return to bug 165257