Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cache.h: hex2chr() - avoid -Wsign-compare warnings
author
Ramsay Jones
<ramsay@ramsayjones.plus.com>
Thu, 21 Sep 2017 16:48:38 +0000
(17:48 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 22 Sep 2017 04:00:38 +0000
(13:00 +0900)
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
fddfedc
)
diff --git
a/cache.h
b/cache.h
index 849bc0dcdd0d6bc572d3524f2646ea7f719eb7a9..5cc116ba4221f6655271d867a9bcc445b1bd26ad 100644
(file)
--- 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 */