summaryrefslogtreecommitdiff
path: root/csum-file.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:52 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-11-25 15:24:52 -0800
commit455e8d18f81583d0270685edc6ec2ed201fc984c (patch)
treecc8a2951eb2473f5970c505d03b1ef5349067d1a /csum-file.h
parentMerge branch 'sg/bisect-approximately-halfway' (diff)
parentpack-write: use hashwrite_be64() (diff)
downloadtgif-455e8d18f81583d0270685edc6ec2ed201fc984c.tar.xz
Merge branch 'rs/hashwrite-be64'
Code simplification. * rs/hashwrite-be64: pack-write: use hashwrite_be64() midx: use hashwrite_be64() csum-file: add hashwrite_be64()
Diffstat (limited to 'csum-file.h')
-rw-r--r--csum-file.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/csum-file.h b/csum-file.h
index f9cbd317fb..e54d53d1d0 100644
--- a/csum-file.h
+++ b/csum-file.h
@@ -62,4 +62,11 @@ static inline void hashwrite_be32(struct hashfile *f, uint32_t data)
hashwrite(f, &data, sizeof(data));
}
+static inline size_t hashwrite_be64(struct hashfile *f, uint64_t data)
+{
+ data = htonll(data);
+ hashwrite(f, &data, sizeof(data));
+ return sizeof(data);
+}
+
#endif