Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamsay Jones <ramsay@ramsayjones.plus.com>2017-09-21 19:48:38 +0300
committerJunio C Hamano <gitster@pobox.com>2017-09-22 07:00:38 +0300
commit356a293f39e101326b274e968552a7379735e230 (patch)
tree96ad2cc8bde965ba5c85fa6785e5afde6fbf97e6 /cache.h
parentfddfedc361b56195503d885874ed1162f66c773c (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.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/cache.h b/cache.h
index 849bc0dcdd..5cc116ba42 100644
--- a/cache.h
+++ b/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 */