diff options
author | Ramsay Jones <ramsay@ramsayjones.plus.com> | 2017-09-21 18:48:38 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-22 06:00:38 +0200 |
commit | 356a293f39e101326b274e968552a7379735e230 (patch) | |
tree | 96ad2cc8bde965ba5c85fa6785e5afde6fbf97e6 /cache.h | |
parent | commit-slab.h: avoid -Wsign-compare warnings (diff) | |
download | git-356a293f39e101326b274e968552a7379735e230.tar.xz git-356a293f39e101326b274e968552a7379735e230.zip |
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 */ |