MCPcopy Create free account
hub / github.com/ProgerXP/Notepad2e / GetHexDigit

Function GetHexDigit

src/Helpers.c:1896–1908  ·  view source on GitHub ↗

* If the character is an hexa digit, get its value. */

Source from the content-addressed store, hash-verified

1894 * If the character is an hexa digit, get its value.
1895 */
1896static int GetHexDigit ( char ch )
1897{
1898 if ( ch >= '0' && ch <= '9' ) {
1899 return ch - '0';
1900 }
1901 if ( ch >= 'A' && ch <= 'F' ) {
1902 return ch - 'A' + 10;
1903 }
1904 if ( ch >= 'a' && ch <= 'f' ) {
1905 return ch - 'a' + 10;
1906 }
1907 return -1;
1908}
1909
1910/**
1911 * Convert C style \a, \b, \f, \n, \r, \t, \v, \xhh and \uhhhh into their indicated characters.

Callers 1

UnSlashFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected