提交 356a293f 编写于 作者: R Ramsay Jones 提交者: Junio C Hamano

cache.h: hex2chr() - avoid -Wsign-compare warnings

Signed-off-by: NRamsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 fddfedc3
......@@ -1264,8 +1264,8 @@ static inline unsigned int hexval(unsigned char c)
*/
static inline int hex2chr(const char *s)
{
int val = hexval(s[0]);
return (val < 0) ? val : (val << 4) | hexval(s[1]);
unsigned int val = hexval(s[0]);
return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
}
/* Convert to/from hex/sha1 representation */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册