MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / String_AppendHex

Function String_AppendHex

src/String.c:228–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228void String_AppendHex(cc_string* str, cc_uint8 value) {
229 /* 48 = index of 0, 55 = index of (A - 10) */
230 cc_uint8 hi = (value >> 4) & 0xF;
231 char c_hi = hi < 10 ? (hi + 48) : (hi + 55);
232 cc_uint8 lo = value & 0xF;
233 char c_lo = lo < 10 ? (lo + 48) : (lo + 55);
234
235 String_Append(str, c_hi);
236 String_Append(str, c_lo);
237}
238
239CC_NOINLINE static void String_Hex32(cc_string* str, cc_uint32 value) {
240 int shift;

Callers 9

DumpStackFunction · 0.85
PackedCol_ToHexFunction · 0.85
SysFont_DrawTextFunction · 0.85
Http_UrlEncodeFunction · 0.85
Cw_WriteBockDefFunction · 0.85
String_Hex32Function · 0.85
String_Hex64Function · 0.85
SaveColorFunction · 0.85
DumpStackRowFunction · 0.85

Calls 1

String_AppendFunction · 0.85

Tested by

no test coverage detected