Commit Graph

8 Commits

Author SHA1 Message Date
Matthias Clasen
0f096d6ad9 bitmask: add an assertion
The static analysis in ci is complaining about
this, since it doesn't know that start is always
smaller than end.
2020-05-25 20:56:09 -04:00
Benjamin Otte
7c762fe1c4 bitmask: Use gsize, not size_t
We want to use the same type everywhere to avoid surprises.
2015-09-27 15:12:22 +02:00
Ignacio Casal Quinteiro
4a7da1e143 Do not return on void functions 2015-02-19 14:46:32 +01:00
Benjamin Otte
e8f2eeac92 bitmask: Fix intersection code
With the fix in 77912a65e2, another bug
got visible: booleans are 32 bits, so if the intersection between the 2
bitmasks happened in higher bits, the return value would be truncated to
FALSE.

This actually made slider handles disappear, so it was pretty visible.
2012-11-10 18:35:37 +01:00
Alexander Larsson
77912a65e2 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.
2012-11-09 10:11:47 +01:00
John Ralls
b2a8e6ed04 Fix compile error from splitting bitmask code
GtkBitMask was typedef'd twice.
2012-03-01 16:26:38 -08:00
Neil Roberts
6044dfc35b bitmask: Don't allocate memory for small bitmasks
Code taken more or less verbatim from CoglBitmask.
2012-03-01 15:10:36 +01:00
Benjamin Otte
27eb83a410 bitmask: Split bitmask code into two
This does nothing but turn all GtkBitmask functions into static inline
functions that call the gtk_allocated_bitmask_*() equivalent.

The implementation of the static functions has also been put into a
private header, to not scare people who want to see how things are
implemented.
2012-03-01 15:10:36 +01:00