git.99rst.org
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
fddfedc
)
cache.h: hex2chr() - avoid -Wsign-compare warnings
author
Ramsay Jones
<redacted>
Thu, 21 Sep 2017 16:48:38 +0000
(17:48 +0100)
committer
Junio C Hamano
<redacted>
Fri, 22 Sep 2017 04:00:38 +0000
(13:00 +0900)
Signed-off-by: Ramsay Jones <redacted>
Signed-off-by: Junio C Hamano <redacted>
cache.h
patch
|
blob
|
history
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 */
git clone https://git.99rst.org/PROJECT