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>maint
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)
|
static inline int hex2chr(const char *s)
|
||||||
{
|
{
|
||||||
int val = hexval(s[0]);
|
unsigned int val = hexval(s[0]);
|
||||||
return (val < 0) ? val : (val << 4) | hexval(s[1]);
|
return (val & ~0xf) ? val : (val << 4) | hexval(s[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Convert to/from hex/sha1 representation */
|
/* Convert to/from hex/sha1 representation */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue