3 static int hex(char ch
)
5 if ((ch
>= '0') && (ch
<= '9'))
7 if ((ch
>= 'a') && (ch
<= 'f'))
9 if ((ch
>= 'A') && (ch
<= 'F'))
15 * While we find nice hex chars, build a long_val.
16 * Return number of chars processed.
18 int hex2u64(const char *ptr
, u64
*long_val
)
24 const int hex_val
= hex(*p
);
29 *long_val
= (*long_val
<< 4) | hex_val
;