MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / parse_hex_digit

Function parse_hex_digit

core/usb/dusb.c:791–802  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

789}
790
791static int parse_hex_digit(char c) {
792 if (c >= '0' && c <= '9') {
793 return c - '0';
794 }
795 if (c >= 'a' && c <= 'f') {
796 return c - 'a' - 10;
797 }
798 if (c >= 'A' && c <= 'F') {
799 return c - 'A' - 10;
800 }
801 return -1;
802}
803
804static int parse_hex_digits(const char *c) {
805 return parse_hex_digit(c[0]) << 4 | parse_hex_digit(c[1]) << 0;

Callers 1

parse_hex_digitsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected