MCPcopy Create free account
hub / github.com/diasurgical/devilution / CreateBitArray

Function CreateBitArray

3rdParty/StormLib/src/SBaseFileTable.cpp:64–81  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62static USHORT SetBitsMask[] = {0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF};
63
64static TBitArray * CreateBitArray(
65 DWORD NumberOfBits,
66 BYTE FillValue)
67{
68 TBitArray * pBitArray;
69 size_t nSize = sizeof(TBitArray) + (NumberOfBits + 7) / 8;
70
71 // Allocate the bit array
72 pBitArray = (TBitArray *)STORM_ALLOC(BYTE, nSize);
73 if(pBitArray != NULL)
74 {
75 memset(pBitArray, FillValue, nSize);
76 pBitArray->NumberOfBytes = (NumberOfBits + 7) / 8;
77 pBitArray->NumberOfBits = NumberOfBits;
78 }
79
80 return pBitArray;
81}
82
83void GetBits(
84 TBitArray * pArray,

Callers 2

CreateHetTableFunction · 0.85
TranslateBetTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected