diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:20:18 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-23 14:20:18 +0900 |
commit | 7186408f2486ebbb82736c15efb8fbc372fb5f95 (patch) | |
tree | b17026dbf30f239cbb390e0ee33b109ef69b0370 /cache.h | |
parent | Merge branch 'ma/ts-cleanups' into maint (diff) | |
parent | ALLOC_GROW: avoid -Wsign-compare warnings (diff) | |
download | tgif-7186408f2486ebbb82736c15efb8fbc372fb5f95.tar.xz |
Merge branch 'rj/no-sign-compare' into maint
Many codepaths have been updated to squelch -Wsign-compare
warnings.
* rj/no-sign-compare:
ALLOC_GROW: avoid -Wsign-compare warnings
cache.h: hex2chr() - avoid -Wsign-compare warnings
commit-slab.h: avoid -Wsign-compare warnings
git-compat-util.h: xsize_t() - avoid -Wsign-compare warnings
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 */ |