mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
sha1: fix complication error
Summary: clang is unhappy about implicit converting `const char *` to `const unsigned char *`. This patch adds explicit casting to fix that. Test Plan: Run `make local` on an OS X machine. Reviewers: wez, #sourcecontrol, sid0 Reviewed By: sid0 Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4952123 Signature: t1:4952123:1493171270:16fae06afc56d060d7cfd4a845cef6271137f92d
This commit is contained in:
parent
6c6ebce1f6
commit
fc3ca42ee0
@ -236,13 +236,13 @@ void Manifest::computeNode(const char *p1, const char *p2, char *result) {
|
||||
SHA1DCInit(&ctx);
|
||||
|
||||
if (memcmp(p1, p2, BIN_NODE_SIZE) == -1) {
|
||||
SHA1DCUpdate(&ctx, p1, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, p2, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, (const unsigned char *) p1, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, (const unsigned char *) p2, BIN_NODE_SIZE);
|
||||
} else {
|
||||
SHA1DCUpdate(&ctx, p2, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, p1, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, (const unsigned char *)p2, BIN_NODE_SIZE);
|
||||
SHA1DCUpdate(&ctx, (const unsigned char *)p1, BIN_NODE_SIZE);
|
||||
}
|
||||
SHA1DCUpdate(&ctx, content.c_str(), content.size());
|
||||
SHA1DCUpdate(&ctx, (const unsigned char *)content.c_str(), content.size());
|
||||
|
||||
SHA1DCFinal((unsigned char*)result, &ctx);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user