30 union { uint16_t u16; uint8_t v[2]; } ret;
31 ret.v[0] = (uint8_t)(x >> 8);
32 ret.v[1] = (uint8_t) x;
37 union { uint32_t u32; uint8_t v[4]; } ret;
38 ret.v[0] = (uint8_t)(x >> 24);
39 ret.v[1] = (uint8_t)(x >> 16);
40 ret.v[2] = (uint8_t)(x >> 8);
41 ret.v[3] = (uint8_t) x;
46 union { uint64_t u64; uint8_t v[8]; } ret;
47 ret.v[0] = (uint8_t)(x >> 56);
48 ret.v[1] = (uint8_t)(x >> 48);
49 ret.v[2] = (uint8_t)(x >> 40);
50 ret.v[3] = (uint8_t)(x >> 32);
51 ret.v[4] = (uint8_t)(x >> 24);
52 ret.v[5] = (uint8_t)(x >> 16);
53 ret.v[6] = (uint8_t)(x >> 8);
54 ret.v[7] = (uint8_t) x;