Skip to content

Instantly share code, notes, and snippets.

@lewtds
Last active August 31, 2015 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewtds/23449f4796e37014100c to your computer and use it in GitHub Desktop.
Save lewtds/23449f4796e37014100c to your computer and use it in GitHub Desktop.
#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