avcodec/xpmdec: avoid "magic" numbers in function hex_char_to_number()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2017-03-12 22:58:49 +01:00
parent dd0090eb21
commit 58f0bbc1ea
1 changed files with 2 additions and 2 deletions

View File

@ -188,9 +188,9 @@ static const ColorEntry color_table[] = {
static unsigned hex_char_to_number(uint8_t x) static unsigned hex_char_to_number(uint8_t x)
{ {
if (x >= 'a' && x <= 'f') if (x >= 'a' && x <= 'f')
x -= 87; x -= 'a' - 10;
else if (x >= 'A' && x <= 'F') else if (x >= 'A' && x <= 'F')
x -= 55; x -= 'A' - 10;
else if (x >= '0' && x <= '9') else if (x >= '0' && x <= '9')
x -= '0'; x -= '0';
else else