mirror of
https://github.com/git/git.git
synced 2024-11-24 10:26:17 +08:00
cache.h: hex2chr() - avoid -Wsign-compare warnings
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
fddfedc361
commit
356a293f39
4
cache.h
4
cache.h
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user