diff options
author | Ramsay Jones <ramsay@ramsayjones.plus.com> | 2017-09-21 19:48:38 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-22 07:00:38 +0300 |
commit | 356a293f39e101326b274e968552a7379735e230 (patch) | |
tree | 96ad2cc8bde965ba5c85fa6785e5afde6fbf97e6 /cache.h | |
parent | fddfedc361b56195503d885874ed1162f66c773c (diff) |
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>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 */ |