MCPcopy Create free account
hub / github.com/F-Stack/f-stack / get_hex_val

Function get_hex_val

dpdk/examples/ip_pipeline/parser.c:26–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24#include "parser.h"
25
26static uint32_t
27get_hex_val(char c)
28{
29 switch (c) {
30 case '0': case '1': case '2': case '3': case '4': case '5':
31 case '6': case '7': case '8': case '9':
32 return c - '0';
33 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
34 return c - 'A' + 10;
35 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
36 return c - 'a' + 10;
37 default:
38 return 0;
39 }
40}
41
42int
43parser_read_arg_bool(const char *p)

Callers 1

parse_hex_stringFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected