Fix cnp bug in _gtk_bitmask_intersects

We need to use the allocated codepath if *any* argument is
allocated, not if one arg is not allocated.
This bug caused unnecessary calls to _gtk_bitmask_is_allocated,
as well as return completely wrong result if both bitmask are
allocated.
This commit is contained in:
Alexander Larsson 2012-11-09 09:05:47 +01:00
parent 8a40d8fe2a
commit 77912a65e2

View File

@ -159,8 +159,8 @@ static inline gboolean
_gtk_bitmask_intersects (const GtkBitmask *mask, _gtk_bitmask_intersects (const GtkBitmask *mask,
const GtkBitmask *other) const GtkBitmask *other)
{ {
if (!_gtk_bitmask_is_allocated (mask) || if (_gtk_bitmask_is_allocated (mask) ||
!_gtk_bitmask_is_allocated (other)) _gtk_bitmask_is_allocated (other))
return _gtk_allocated_bitmask_intersects (mask, other); return _gtk_allocated_bitmask_intersects (mask, other);
else else
return _gtk_bitmask_to_bits (mask) & _gtk_bitmask_to_bits (other); return _gtk_bitmask_to_bits (mask) & _gtk_bitmask_to_bits (other);