MCPcopy Create free account
hub / github.com/crawl/crawl / write_hex16

Function write_hex16

crawl-ref/source/json.cc:1390–1400  ·  view source on GitHub ↗

* Encodes a 16-bit number into hexadecimal, * writing exactly 4 hex chars. */

Source from the content-addressed store, hash-verified

1388 * writing exactly 4 hex chars.
1389 */
1390static int write_hex16(char *out, uint16_t val)
1391{
1392 const char *hex = "0123456789ABCDEF";
1393
1394 *out++ = hex[(val >> 12) & 0xF];
1395 *out++ = hex[(val >> 8) & 0xF];
1396 *out++ = hex[(val >> 4) & 0xF];
1397 *out++ = hex[ val & 0xF];
1398
1399 return 4;
1400}
1401
1402bool json_check(const JsonNode *node, char errmsg[256])
1403{

Callers 1

emit_stringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected