MCPcopy Create free account
hub / github.com/GJDuck/e9patch / e9write_hex

Function e9write_hex

src/e9patch/e9loader.cpp:53–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 return str;
52}
53static NO_INLINE char *e9write_hex(char *str, uint64_t x)
54{
55 if (x == 0)
56 {
57 *str++ = '0';
58 return str;
59 }
60 bool zero = false;
61 int n = 15;
62 do
63 {
64 unsigned digit = (unsigned)((x >> (n * 4)) & 0xF);
65 n--;
66 if (digit == 0 && !zero)
67 continue;
68 zero = true;
69 if (digit <= 9)
70 *str++ = '0' + digit;
71 else
72 *str++ = 'a' + (digit - 10);
73 }
74 while (n >= 0);
75 return str;
76}
77static NO_INLINE char *e9write_num(char *str, uint64_t x)
78{
79 if (x == 0)

Callers 1

e9write_formatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected