- adjusted bit array helpers for the change of type for gotpic from (undefined) char to (defined) uint8_t.

This commit is contained in:
Christoph Oelckers 2019-10-13 08:55:52 +02:00
parent a6ba81939a
commit 17a4ddd51e

View file

@ -511,18 +511,24 @@ inline int QRandom2(int a1)
return mulscale(qrand(), a1, 14)-a1;
}
inline void SetBitString(char *pArray, int nIndex)
template<class T>
inline void SetBitString(T *pArray, int nIndex)
{
pArray[nIndex>>3] |= 1<<(nIndex&7);
static_assert(sizeof(T) == 1);
pArray[nIndex>>3] |= 1<<(nIndex&7);
}
inline void ClearBitString(char *pArray, int nIndex)
template<class T>
inline void ClearBitString(T *pArray, int nIndex)
{
pArray[nIndex >> 3] &= ~(1 << (nIndex & 7));
static_assert(sizeof(T) == 1);
pArray[nIndex >> 3] &= ~(1 << (nIndex & 7));
}
inline char TestBitString(char *pArray, int nIndex)
template<class T>
inline char TestBitString(T *pArray, int nIndex)
{
static_assert(sizeof(T) == 1);
return pArray[nIndex>>3] & (1<<(nIndex&7));
}