提交 58f0bbc1 编写于 作者: P Paul B Mahol

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

Signed-off-by: NPaul B Mahol <onemda@gmail.com>
上级 dd0090eb
......@@ -188,9 +188,9 @@ static const ColorEntry color_table[] = {
static unsigned hex_char_to_number(uint8_t x)
{
if (x >= 'a' && x <= 'f')
x -= 87;
x -= 'a' - 10;
else if (x >= 'A' && x <= 'F')
x -= 55;
x -= 'A' - 10;
else if (x >= '0' && x <= '9')
x -= '0';
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册