ae2f_docs
Loading...
Searching...
No Matches
u32_to_hex8.c
1/** @file u32_to_hex8.auto.h */
2
3#ifndef util_u32_to_hex8_h
4#define util_u32_to_hex8_h
5
6#include <ae2f/Macro.h>
7
9void util_u32_to_hex8(const unsigned c_wrd, char ret[8]);
10#endif
11
12#define util_u32_to_hex_lookup(a)
13 ((a) == 0x0 ? '0' :
14 (a) == 0x1 ? '1' :
15 (a) == 0x2 ? '2' :
16 (a) == 0x3 ? '3' :
17 (a) == 0x4 ? '4' :
18 (a) == 0x5 ? '5' :
19 (a) == 0x6 ? '6' :
20 (a) == 0x7 ? '7' :
21 (a) == 0x8 ? '8' :
22 (a) == 0x9 ? '9' :
23 (a) == 0xA ? 'a' :
24 (a) == 0xB ? 'b' :
25 (a) == 0xC ? 'c' :
26 (a) == 0xD ? 'd' :
27 (a) == 0xE ? 'e' : 'f')
28
29ae2f_MAC() util_u32_to_hex8(const unsigned c_u32, char* ret) {
30 (ret)[7] = util_u32_to_hex_lookup(0xF & (c_u32) >> (0 << 2));
31 (ret)[6] = util_u32_to_hex_lookup(0xF & (c_u32) >> (1 << 2));
32 (ret)[5] = util_u32_to_hex_lookup(0xF & (c_u32) >> (2 << 2));
33 (ret)[4] = util_u32_to_hex_lookup(0xF & (c_u32) >> (3 << 2));
34 (ret)[3] = util_u32_to_hex_lookup(0xF & (c_u32) >> (4 << 2));
35 (ret)[2] = util_u32_to_hex_lookup(0xF & (c_u32) >> (5 << 2));
36 (ret)[1] = util_u32_to_hex_lookup(0xF & (c_u32) >> (6 << 2));
37 (ret)[0] = util_u32_to_hex_lookup(0xF & (c_u32) >> (7 << 2));
38}
39
40#endif
#define __ae2f_MACRO_GENERATED
Definition Macro.h:4
#define ae2f_MAC(a)
A hint for creating a macro from void-returning function.
Definition Macro.h:17
#define util_u32_to_hex_lookup(a)
Definition u32_to_hex8.c:12