MCPcopy Create free account
hub / github.com/F-Stack/f-stack / hex_string_to_uint64

Function hex_string_to_uint64

dpdk/app/graph/utils.c:23–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21})
22
23static void
24hex_string_to_uint64(uint64_t *dst, const char *hexs)
25{
26 char buf[2] = {0};
27 uint8_t shift = 4;
28 int iter = 0;
29 char c;
30
31 while ((c = *hexs++)) {
32 buf[0] = c;
33 *dst |= (strtol(buf, NULL, 16) << shift);
34 shift -= 4;
35 iter++;
36 if (iter == 2) {
37 iter = 0;
38 shift = 4;
39 dst++;
40 }
41 }
42}
43
44int
45parser_uint64_read(uint64_t *value, const char *p)

Callers 2

parser_ip6_readFunction · 0.85
parser_mac_readFunction · 0.85

Calls 1

strtolFunction · 0.85

Tested by

no test coverage detected