Create a gist now

Instantly share code, notes, and snippets.

@lewtds /set_data_bit.c Secret
Last active Aug 31, 2015

What would you like to do?
#define DATA_FLAG 1 << 31
#define SET_DATA_BIT(pData, offset) do {\
int wordOffset = offset >> 5; \
int bitOffset = offset & 31; \
((l_uint32 *) pData)[wordOffset] |= DATA_FLAG >> bitOffset; \
} while(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment