MCPcopy Create free account
hub / github.com/KebsCS/KBotExt / ImBitArrayGetStorageSizeInBytes

Function ImBitArrayGetStorageSizeInBytes

KBotExt/imgui/imgui_internal.h:544–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542#define IM_BITARRAY_TESTBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] & ((ImU32)1 << ((_N) & 31))) != 0) // Macro version of ImBitArrayTestBit(): ensure args have side-effect or are costly!
543#define IM_BITARRAY_CLEARBIT(_ARRAY, _N) ((_ARRAY[(_N) >> 5] &= ~((ImU32)1 << ((_N) & 31)))) // Macro version of ImBitArrayClearBit(): ensure args have side-effect or are costly!
544inline size_t ImBitArrayGetStorageSizeInBytes(int bitcount) { return (size_t)((bitcount + 31) >> 5) << 2; }
545inline void ImBitArrayClearAllBits(ImU32* arr, int bitcount) { memset(arr, 0, ImBitArrayGetStorageSizeInBytes(bitcount)); }
546inline bool ImBitArrayTestBit(const ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); return (arr[n >> 5] & mask) != 0; }
547inline void ImBitArrayClearBit(ImU32* arr, int n) { ImU32 mask = (ImU32)1 << (n & 31); arr[n >> 5] &= ~mask; }

Callers 4

TableBeginInitMemoryMethod · 0.85
ImBitArrayClearAllBitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected