summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-08-26 01:06:22 -0700
committerJunio C Hamano <junkio@cox.net>2006-08-26 01:06:22 -0700
commita7f051987c5f020e60da1e5d6ddefc3d443d3299 (patch)
treead35bcb194fce5509db30e12b499920b01ccc930 /cache.h
parent030b52087f0a4b7b1178d34839868ce438eb2f0e (diff)
parenta8e0d16d85fb2ea53775f64549cac2396cd621a6 (diff)
downloadgit-a7f051987c5f020e60da1e5d6ddefc3d443d3299.tar.gz
Merge branch 'gl/cleanup'
* gl/cleanup: Convert memset(hash,0,20) to hashclr(hash). Convert memcpy(a,b,20) to hashcpy(a,b).
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 3044794468..1f212d77a4 100644
--- a/cache.h
+++ b/cache.h
@@ -218,6 +218,14 @@ static inline int hashcmp(const unsigned char *sha1, const unsigned char *sha2)
{
return memcmp(sha1, sha2, 20);
}
+static inline void hashcpy(unsigned char *sha_dst, const unsigned char *sha_src)
+{
+ memcpy(sha_dst, sha_src, 20);
+}
+static inline void hashclr(unsigned char *hash)
+{
+ memset(hash, 0, 20);
+}
int git_mkstemp(char *path, size_t n, const char *template);