diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-07-12 14:44:20 +0200 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-07-12 15:14:36 +0200 |
commit | 076f58c4bf9fa1ae0faa65a731523cb531705974 (patch) | |
tree | abe42a7625ab2fc15a572e4e6959310a2b0c9ce3 /src/include/stdlib.h | |
parent | 362a628e52ac2b8f3ace6c8920ab0942277480f4 (diff) | |
download | ipxe-076f58c4bf9fa1ae0faa65a731523cb531705974.tar.gz |
[base16] Generalise base16_decode() to hex_decode()
Provide a generic hex_decode() routine which can be shared between the
Base16 code and the "hex" and "hexhyp" settings parsers.
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/stdlib.h')
-rw-r--r-- | src/include/stdlib.h | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/include/stdlib.h b/src/include/stdlib.h index 3d30858ff..bca85a234 100644 --- a/src/include/stdlib.h +++ b/src/include/stdlib.h @@ -34,19 +34,7 @@ static inline int strtoul_base ( const char **pp, int base ) return base; } -static inline unsigned int strtoul_charval ( unsigned int charval ) -{ - if ( charval >= 'a' ) { - charval = ( charval - 'a' + 10 ); - } else if ( charval >= 'A' ) { - charval = ( charval - 'A' + 10 ); - } else if ( charval <= '9' ) { - charval = ( charval - '0' ); - } - - return charval; -} - +extern unsigned int strtoul_charval ( unsigned int charval ); extern unsigned long strtoul ( const char *p, char **endp, int base ); extern unsigned long long strtoull ( const char *p, char **endp, int base ); |