MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / ParseHexUnchecked

Function ParseHexUnchecked

extern/nfd/nfd_portal.cpp:950–957  ·  view source on GitHub ↗

Returns the hexadecimal value contained in the char. Precondition: IsHex(ch)

Source from the content-addressed store, hash-verified

948
949// Returns the hexadecimal value contained in the char. Precondition: IsHex(ch)
950char ParseHexUnchecked(char ch) {
951 if ('0' <= ch && ch <= '9') return ch - '0';
952 if ('A' <= ch && ch <= 'F') return ch - ('A' - 10);
953 if ('a' <= ch && ch <= 'f') return ch - ('a' - 10);
954#if defined(__GNUC__)
955 __builtin_unreachable();
956#endif
957}
958
959// Returns true if the given file URI is decodable (i.e. not malformed), and false otherwise.
960// If this function returns true, then `out` will be populated with the length of the decoded URI

Callers 1

UriDecodeUncheckedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected