Skip to content

Instantly share code, notes, and snippets.

@Munksgaard
Created March 8, 2011 15:49
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 Munksgaard/860429 to your computer and use it in GitHub Desktop.
Save Munksgaard/860429 to your computer and use it in GitHub Desktop.
uint32_t l2b32 (uint32_t x)
{
uint8_t *p = &x;
return p[0] + p[1] << 8 + p[2] << 16 + p[3] << 24;
}
uint2_t b2l32_t (uint32_t x)
{
uint8_t *p = &x;
return p[3] + p[2] << 8 + p[1] << 16 + p[0] << 24;
}<
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment