| 1 | /* |
| 2 | * Copyright © 2011 Red Hat Inc. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 | * |
| 17 | * Authors: Benjamin Otte <[email protected]> |
| 18 | */ |
| 19 | |
| 20 | #include <config.h>cxx . . $ `<file>/build/config.h`/ |
| 21 | |
| 22 | #include "gtkallocatedbitmaskprivate.h"cxx . . $ `<file>/gtk/gtkallocatedbitmaskprivate.h`/ |
| 23 | #include "gtkprivate.h"cxx . . $ `<file>/gtk/gtkprivate.h`/ |
| 24 | |
| 25 | |
| 26 | #define VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`! gsize |
| 27 | |
| 28 | #define VALUE_SIZE_BITScxx . . $ `gtk/gtkallocatedbitmask.c:28:9`! (sizeof (VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`!) * 8) |
| 29 | #define VALUE_BITcxx . . $ `gtk/gtkallocatedbitmask.c:29:9`!(idx) (((VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`!) 1) << (idx)) |
| 30 | #define ALL_BITScxx . . $ `gtk/gtkallocatedbitmask.c:30:9`! (~((VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`!) 0)) |
| 31 | |
| 32 | struct _GtkBitmaskcxx . . $ _GtkBitmask# { |
| 33 | gsizecxx . . $ gsize# lencxx . . $ _GtkBitmask#len.; |
| 34 | VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`! datacxx . . $ _GtkBitmask#data.[1]; |
| 35 | }; |
| 36 | |
| 37 | #define ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`!(mask, heap_mask) G_STMT_STARTcxx . . $ `<external>/12741050725406041920/gmacros.h:1027:9`! { \ |
| 38 | if (!_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask)) \ |
| 39 | { \ |
| 40 | heap_mask.data[0] = _gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask); \ |
| 41 | heap_mask.len = heap_mask.data[0] ? 1 : 0; \ |
| 42 | mask = &heap_mask; \ |
| 43 | } \ |
| 44 | } G_STMT_ENDcxx . . $ `<external>/12741050725406041920/gmacros.h:1035:9`! |
| 45 | |
| 46 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 47 | gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 48 | gsizecxx . . $ gsize# size) G_GNUC_WARN_UNUSED_RESULTcxx . . $ `<external>/12741050725406041920/gmacros.h:850:9`!; |
| 49 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 50 | gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 51 | gsizecxx . . $ gsize# size) |
| 52 | { |
| 53 | gsizecxx . . $ gsize# i; |
| 54 | |
| 55 | if (size == mask->lencxx . . $ _GtkBitmask#len.) |
| 56 | return mask; |
| 57 | |
| 58 | mask = g_realloccxx . . $ g_realloc(417ab160f6baadc6). (mask, sizeof (GtkBitmaskcxx . . $ GtkBitmask#) + sizeof(VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`!) * (size - 1)); |
| 59 | |
| 60 | for (i = mask->lencxx . . $ _GtkBitmask#len.; i < size; i++) |
| 61 | mask->datacxx . . $ _GtkBitmask#data.[i] = 0; |
| 62 | |
| 63 | mask->lencxx . . $ _GtkBitmask#len. = size; |
| 64 | |
| 65 | return mask; |
| 66 | } |
| 67 | |
| 68 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 69 | gtk_allocated_bitmask_new_for_bitscxx . . $ gtk_allocated_bitmask_new_for_bits(5a33b18b0c1d2b11). (gsizecxx . . $ gsize# bits) |
| 70 | { |
| 71 | GtkBitmaskcxx . . $ GtkBitmask# *mask; |
| 72 | |
| 73 | mask = g_malloccxx . . $ g_malloc(bfcfa4d6b7f7ef64). (sizeof (GtkBitmaskcxx . . $ GtkBitmask#)); |
| 74 | mask->lencxx . . $ _GtkBitmask#len. = bits ? 1 : 0; |
| 75 | mask->datacxx . . $ _GtkBitmask#data.[0] = bits; |
| 76 | |
| 77 | return mask; |
| 78 | } |
| 79 | |
| 80 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 81 | gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (GtkBitmaskcxx . . $ GtkBitmask# *mask) |
| 82 | { |
| 83 | if (_gtk_bitmask_is_allocatedcxx . . $ `gtk/gtkallocatedbitmaskprivate.h:35:9`! (mask)) |
| 84 | return mask; |
| 85 | else |
| 86 | return gtk_allocated_bitmask_new_for_bitscxx . . $ gtk_allocated_bitmask_new_for_bits(5a33b18b0c1d2b11). (_gtk_bitmask_to_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:29:9`! (mask)); |
| 87 | } |
| 88 | |
| 89 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 90 | _gtk_allocated_bitmask_copycxx . . $ _gtk_allocated_bitmask_copy(5e69b92442e31eb0). (const GtkBitmaskcxx . . $ GtkBitmask# *mask) |
| 91 | { |
| 92 | GtkBitmaskcxx . . $ GtkBitmask# *copy; |
| 93 | |
| 94 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 95 | |
| 96 | copy = gtk_allocated_bitmask_new_for_bitscxx . . $ gtk_allocated_bitmask_new_for_bits(5a33b18b0c1d2b11). (0); |
| 97 | |
| 98 | return _gtk_allocated_bitmask_unioncxx . . $ _gtk_allocated_bitmask_union(34e98e8a5c56d9c8). (copy, mask); |
| 99 | } |
| 100 | |
| 101 | void |
| 102 | _gtk_allocated_bitmask_freecxx . . $ _gtk_allocated_bitmask_free(44a0a5f2c5822bdd). (GtkBitmaskcxx . . $ GtkBitmask# *mask) |
| 103 | { |
| 104 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (mask != NULL); |
| 105 | |
| 106 | g_freecxx . . $ g_free(5d22bdacc48458e8). (mask); |
| 107 | } |
| 108 | |
| 109 | char * |
| 110 | _gtk_allocated_bitmask_to_stringcxx . . $ _gtk_allocated_bitmask_to_string(67d397e5e5befe48). (const GtkBitmaskcxx . . $ GtkBitmask# *mask) |
| 111 | { |
| 112 | GStringcxx . . $ GString# *str = g_string_newcxx . . $ g_string_new(e8737c02110bb79b). (NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!); |
| 113 | |
| 114 | _gtk_allocated_bitmask_printcxx . . $ _gtk_allocated_bitmask_print(70a817151bb95d36). (mask, str); |
| 115 | |
| 116 | return g_string_freecxx . . $ `<external>/2906017559248664336/gstring.h:73:9`! (str, FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!); |
| 117 | } |
| 118 | |
| 119 | void |
| 120 | _gtk_allocated_bitmask_printcxx . . $ _gtk_allocated_bitmask_print(70a817151bb95d36). (const GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 121 | GStringcxx . . $ GString# *string) |
| 122 | { |
| 123 | GtkBitmaskcxx . . $ GtkBitmask# mask_allocated; |
| 124 | int i; |
| 125 | |
| 126 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (mask != NULL); |
| 127 | gtk_internal_return_if_failcxx . . $ `gtk/gtkprivate.h:50:9`! (string != NULL); |
| 128 | |
| 129 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (mask, mask_allocated); |
| 130 | |
| 131 | for (i = mask->lencxx . . $ _GtkBitmask#len. * VALUE_SIZE_BITScxx . . $ `gtk/gtkallocatedbitmask.c:28:9`! - 1; i >= 0; i--) |
| 132 | { |
| 133 | if (_gtk_allocated_bitmask_getcxx . . $ _gtk_allocated_bitmask_get(ec1f9572e2cb12df). (mask, i)) |
| 134 | break; |
| 135 | } |
| 136 | |
| 137 | if (i < 0) |
| 138 | { |
| 139 | g_string_append_ccxx . . $ `<external>/2906017559248664336/gstring.h:215:9`! (string, '0'); |
| 140 | return; |
| 141 | } |
| 142 | |
| 143 | for (; i >= 0; i--) |
| 144 | { |
| 145 | g_string_append_ccxx . . $ `<external>/2906017559248664336/gstring.h:215:9`! (string, _gtk_allocated_bitmask_get (mask, i) ? '1' : '0'); |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | /* NB: Call this function whenever the |
| 150 | * array might have become too large. |
| 151 | * _gtk_allocated_bitmask_is_empty() depends on this. |
| 152 | */ |
| 153 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 154 | gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (GtkBitmaskcxx . . $ GtkBitmask# *mask) G_GNUC_WARN_UNUSED_RESULTcxx . . $ `<external>/12741050725406041920/gmacros.h:850:9`!; |
| 155 | static GtkBitmaskcxx . . $ GtkBitmask# * |
| 156 | gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (GtkBitmaskcxx . . $ GtkBitmask# *mask) |
| 157 | { |
| 158 | guintcxx . . $ guint# i; |
| 159 | |
| 160 | for (i = mask->lencxx . . $ _GtkBitmask#len.; i; i--) |
| 161 | { |
| 162 | if (mask->datacxx . . $ _GtkBitmask#data.[i - 1]) |
| 163 | break; |
| 164 | } |
| 165 | |
| 166 | if (i == 0 || |
| 167 | (i == 1 && mask->datacxx . . $ _GtkBitmask#data.[0] < VALUE_BITcxx . . $ `gtk/gtkallocatedbitmask.c:29:9`! (GTK_BITMASK_N_DIRECT_BITScxx . . $ `gtk/gtkallocatedbitmaskprivate.h:38:9`!))) |
| 168 | { |
| 169 | GtkBitmaskcxx . . $ GtkBitmask# *result = _gtk_bitmask_from_bitscxx . . $ `gtk/gtkallocatedbitmaskprivate.h:32:9`! (i == 0 ? 0 : mask->data[0]); |
| 170 | _gtk_allocated_bitmask_freecxx . . $ _gtk_allocated_bitmask_free(44a0a5f2c5822bdd). (mask); |
| 171 | return result; |
| 172 | } |
| 173 | |
| 174 | return gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (mask, i); |
| 175 | } |
| 176 | |
| 177 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 178 | _gtk_allocated_bitmask_intersectcxx . . $ _gtk_allocated_bitmask_intersect(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 179 | const GtkBitmaskcxx . . $ GtkBitmask# *other) |
| 180 | { |
| 181 | GtkBitmaskcxx . . $ GtkBitmask# other_allocated; |
| 182 | guintcxx . . $ guint# i; |
| 183 | |
| 184 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 185 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (other != NULL, NULL); |
| 186 | |
| 187 | mask = gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (mask); |
| 188 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (other, other_allocated); |
| 189 | |
| 190 | for (i = 0; i < MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (mask->len, other->len); i++) |
| 191 | { |
| 192 | mask->datacxx . . $ _GtkBitmask#data.[i] &= other->datacxx . . $ _GtkBitmask#data.[i]; |
| 193 | } |
| 194 | for (; i < mask->lencxx . . $ _GtkBitmask#len.; i++) |
| 195 | { |
| 196 | mask->datacxx . . $ _GtkBitmask#data.[i] = 0; |
| 197 | } |
| 198 | |
| 199 | return gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (mask); |
| 200 | } |
| 201 | |
| 202 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 203 | _gtk_allocated_bitmask_unioncxx . . $ _gtk_allocated_bitmask_union(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 204 | const GtkBitmaskcxx . . $ GtkBitmask# *other) |
| 205 | { |
| 206 | GtkBitmaskcxx . . $ GtkBitmask# other_allocated; |
| 207 | guintcxx . . $ guint# i; |
| 208 | |
| 209 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 210 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (other != NULL, NULL); |
| 211 | |
| 212 | mask = gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (mask); |
| 213 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (other, other_allocated); |
| 214 | |
| 215 | mask = gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (mask, MAXcxx . . $ `<external>/12741050725406041920/gmacros.h:975:9`! (mask->len, other->len)); |
| 216 | for (i = 0; i < other->lencxx . . $ _GtkBitmask#len.; i++) |
| 217 | { |
| 218 | mask->datacxx . . $ _GtkBitmask#data.[i] |= other->datacxx . . $ _GtkBitmask#data.[i]; |
| 219 | } |
| 220 | |
| 221 | return mask; |
| 222 | } |
| 223 | |
| 224 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 225 | _gtk_allocated_bitmask_subtractcxx . . $ _gtk_allocated_bitmask_subtract(34e98e8a5c56d9c8). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 226 | const GtkBitmaskcxx . . $ GtkBitmask# *other) |
| 227 | { |
| 228 | GtkBitmaskcxx . . $ GtkBitmask# other_allocated; |
| 229 | guintcxx . . $ guint# i, len; |
| 230 | |
| 231 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 232 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (other != NULL, NULL); |
| 233 | |
| 234 | mask = gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (mask); |
| 235 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (other, other_allocated); |
| 236 | |
| 237 | len = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (mask->len, other->len); |
| 238 | for (i = 0; i < len; i++) |
| 239 | { |
| 240 | mask->datacxx . . $ _GtkBitmask#data.[i] &= ~other->datacxx . . $ _GtkBitmask#data.[i]; |
| 241 | } |
| 242 | |
| 243 | return gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (mask); |
| 244 | } |
| 245 | |
| 246 | static inline void |
| 247 | gtk_allocated_bitmask_indexescxx . . $ gtk_allocated_bitmask_indexes(dd8e06a7e3347f10). (guintcxx . . $ guint# index_, |
| 248 | guintcxx . . $ guint# *array_index, |
| 249 | guintcxx . . $ guint# *bit_index) |
| 250 | { |
| 251 | *array_index = index_ / VALUE_SIZE_BITScxx . . $ `gtk/gtkallocatedbitmask.c:28:9`!; |
| 252 | *bit_index = index_ % VALUE_SIZE_BITScxx . . $ `gtk/gtkallocatedbitmask.c:28:9`!; |
| 253 | } |
| 254 | |
| 255 | gbooleancxx . . $ gboolean# |
| 256 | _gtk_allocated_bitmask_getcxx . . $ _gtk_allocated_bitmask_get(ec1f9572e2cb12df). (const GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 257 | guintcxx . . $ guint# index_) |
| 258 | { |
| 259 | guintcxx . . $ guint# array_index, bit_index; |
| 260 | |
| 261 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, FALSE); |
| 262 | |
| 263 | gtk_allocated_bitmask_indexescxx . . $ gtk_allocated_bitmask_indexes(dd8e06a7e3347f10). (index_, &array_index, &bit_index); |
| 264 | |
| 265 | if (array_index >= mask->lencxx . . $ _GtkBitmask#len.) |
| 266 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 267 | |
| 268 | return (mask->datacxx . . $ _GtkBitmask#data.[array_index] & VALUE_BITcxx . . $ `gtk/gtkallocatedbitmask.c:29:9`! (bit_index)) ? TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`! : FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 269 | } |
| 270 | |
| 271 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 272 | _gtk_allocated_bitmask_setcxx . . $ _gtk_allocated_bitmask_set(d4be56091f3b3606). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 273 | guintcxx . . $ guint# index_, |
| 274 | gbooleancxx . . $ gboolean# value) |
| 275 | { |
| 276 | guintcxx . . $ guint# array_index, bit_index; |
| 277 | |
| 278 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 279 | |
| 280 | mask = gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (mask); |
| 281 | gtk_allocated_bitmask_indexescxx . . $ gtk_allocated_bitmask_indexes(dd8e06a7e3347f10). (index_, &array_index, &bit_index); |
| 282 | |
| 283 | if (value) |
| 284 | { |
| 285 | if (array_index >= mask->lencxx . . $ _GtkBitmask#len.) |
| 286 | mask = gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (mask, array_index + 1); |
| 287 | |
| 288 | mask->datacxx . . $ _GtkBitmask#data.[array_index] |= VALUE_BITcxx . . $ `gtk/gtkallocatedbitmask.c:29:9`! (bit_index); |
| 289 | } |
| 290 | else |
| 291 | { |
| 292 | if (array_index < mask->lencxx . . $ _GtkBitmask#len.) |
| 293 | { |
| 294 | mask->datacxx . . $ _GtkBitmask#data.[array_index] &= ~ VALUE_BITcxx . . $ `gtk/gtkallocatedbitmask.c:29:9`! (bit_index); |
| 295 | mask = gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (mask); |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | return mask; |
| 300 | } |
| 301 | |
| 302 | GtkBitmaskcxx . . $ GtkBitmask# * |
| 303 | _gtk_allocated_bitmask_invert_rangecxx . . $ _gtk_allocated_bitmask_invert_range(a06d9023d633a412). (GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 304 | guintcxx . . $ guint# start, |
| 305 | guintcxx . . $ guint# end) |
| 306 | { |
| 307 | guintcxx . . $ guint# i; |
| 308 | guintcxx . . $ guint# start_word, start_bit; |
| 309 | guintcxx . . $ guint# end_word, end_bit; |
| 310 | |
| 311 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, NULL); |
| 312 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (start < end, NULL); |
| 313 | |
| 314 | mask = gtk_bitmask_ensure_allocatedcxx . . $ gtk_bitmask_ensure_allocated(859de9889ec50e03). (mask); |
| 315 | |
| 316 | gtk_allocated_bitmask_indexescxx . . $ gtk_allocated_bitmask_indexes(dd8e06a7e3347f10). (start, &start_word, &start_bit); |
| 317 | gtk_allocated_bitmask_indexescxx . . $ gtk_allocated_bitmask_indexes(dd8e06a7e3347f10). (end - 1, &end_word, &end_bit); |
| 318 | |
| 319 | if (end_word >= mask->lencxx . . $ _GtkBitmask#len.) |
| 320 | mask = gtk_allocated_bitmask_resizecxx . . $ gtk_allocated_bitmask_resize(a1e9635b81ceefb0). (mask, end_word + 1); |
| 321 | |
| 322 | for (i = start_word; i <= end_word; i++) |
| 323 | mask->datacxx . . $ _GtkBitmask#data.[i] ^= ALL_BITScxx . . $ `gtk/gtkallocatedbitmask.c:30:9`!; |
| 324 | mask->datacxx . . $ _GtkBitmask#data.[start_word] ^= (((VALUE_TYPEcxx . . $ `gtk/gtkallocatedbitmask.c:26:9`!) 1) << start_bit) - 1; |
| 325 | if (end_bit != VALUE_SIZE_BITScxx . . $ `gtk/gtkallocatedbitmask.c:28:9`! - 1) |
| 326 | mask->datacxx . . $ _GtkBitmask#data.[end_word] ^= ALL_BITScxx . . $ `gtk/gtkallocatedbitmask.c:30:9`! << (end_bit + 1); |
| 327 | |
| 328 | return gtk_allocated_bitmask_shrinkcxx . . $ gtk_allocated_bitmask_shrink(859de9889ec50e03). (mask); |
| 329 | } |
| 330 | |
| 331 | gbooleancxx . . $ gboolean# |
| 332 | _gtk_allocated_bitmask_equalscxx . . $ _gtk_allocated_bitmask_equals(c414c135749c1bec). (const GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 333 | const GtkBitmaskcxx . . $ GtkBitmask# *other) |
| 334 | { |
| 335 | guintcxx . . $ guint# i; |
| 336 | |
| 337 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, FALSE); |
| 338 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (other != NULL, FALSE); |
| 339 | |
| 340 | if (mask->lencxx . . $ _GtkBitmask#len. != other->lencxx . . $ _GtkBitmask#len.) |
| 341 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 342 | |
| 343 | for (i = 0; i < mask->lencxx . . $ _GtkBitmask#len.; i++) |
| 344 | { |
| 345 | if (mask->datacxx . . $ _GtkBitmask#data.[i] != other->datacxx . . $ _GtkBitmask#data.[i]) |
| 346 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 347 | } |
| 348 | |
| 349 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 350 | } |
| 351 | |
| 352 | gbooleancxx . . $ gboolean# |
| 353 | _gtk_allocated_bitmask_intersectscxx . . $ _gtk_allocated_bitmask_intersects(c414c135749c1bec). (const GtkBitmaskcxx . . $ GtkBitmask# *mask, |
| 354 | const GtkBitmaskcxx . . $ GtkBitmask# *other) |
| 355 | { |
| 356 | GtkBitmaskcxx . . $ GtkBitmask# mask_allocated, other_allocated; |
| 357 | int i; |
| 358 | |
| 359 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (mask != NULL, FALSE); |
| 360 | gtk_internal_return_val_if_failcxx . . $ `gtk/gtkprivate.h:51:9`! (other != NULL, FALSE); |
| 361 | |
| 362 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (mask, mask_allocated); |
| 363 | ENSURE_ALLOCATEDcxx . . $ `gtk/gtkallocatedbitmask.c:37:9`! (other, other_allocated); |
| 364 | |
| 365 | for (i = MINcxx . . $ `<external>/12741050725406041920/gmacros.h:978:9`! (mask->len, other->len) - 1; i >= 0; i--) |
| 366 | { |
| 367 | if (mask->datacxx . . $ _GtkBitmask#data.[i] & other->datacxx . . $ _GtkBitmask#data.[i]) |
| 368 | return TRUEcxx . . $ `<external>/12741050725406041920/gmacros.h:971:9`!; |
| 369 | } |
| 370 | |
| 371 | return FALSEcxx . . $ `<external>/12741050725406041920/gmacros.h:967:9`!; |
| 372 | } |
| 373 |