diff --git a/blocks/block.c b/blocks/block.c index d2e4ec4..8dcdfcd 100644 --- a/blocks/block.c +++ b/blocks/block.c @@ -129,7 +129,7 @@ int ipfs_blocks_block_new(struct Block** block) { int ipfs_blocks_block_add_data(const unsigned char* data, size_t data_size, struct Block* block) { // cid unsigned char hash[32]; - if (libp2p_crypto_hashing_sha256(data, data_size, &hash[0]) == 0) { + if (libp2p_crypto_hashing_sha256((char*)data, data_size, &hash[0]) == 0) { return 0; } diff --git a/dnslink/dnslink.c b/dnslink/dnslink.c index fbcf3b0..d3774cd 100644 --- a/dnslink/dnslink.c +++ b/dnslink/dnslink.c @@ -260,7 +260,7 @@ int ipfs_dnslink_resolve_n (char **p, char *d, int depth) if (ns_parserr(&query_parse_msg,ns_s_an,i,&query_parse_rr)) { return ErrResolveFailed; } else { - char *rdata = ns_rr_rdata(query_parse_rr); + const unsigned char *rdata = ns_rr_rdata(query_parse_rr); memcpy(p, rdata+1, *rdata); // first byte is record length p += *rdata; // update pointer *p++ = '\0'; // mark end-of-record and update pointer to next record. diff --git a/merkledag/merkledag.c b/merkledag/merkledag.c index fd2fdec..0f72837 100644 --- a/merkledag/merkledag.c +++ b/merkledag/merkledag.c @@ -35,7 +35,7 @@ int ipfs_merkledag_add(struct Node* node, struct FSRepo* fs_repo, size_t* bytes_ if (node->hash == NULL) { return 0; } - if (libp2p_crypto_hashing_sha256(protobuf, bytes_encoded, &node->hash[0]) == 0) { + if (libp2p_crypto_hashing_sha256((char*)protobuf, bytes_encoded, &node->hash[0]) == 0) { free(node->hash); return 0; } diff --git a/namesys/isdomain.c b/namesys/isdomain.c index 5317070..19b35db 100644 --- a/namesys/isdomain.c +++ b/namesys/isdomain.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/unixfs/unixfs.c b/unixfs/unixfs.c index 7eb4d76..23d054f 100644 --- a/unixfs/unixfs.c +++ b/unixfs/unixfs.c @@ -130,7 +130,7 @@ int ipfs_unixfs_add_data(unsigned char* data, size_t data_length, struct UnixFS* free(unix_fs->bytes); return 0; } - if (libp2p_crypto_hashing_sha256(data, data_length, &unix_fs->hash[0]) == 0) { + if (libp2p_crypto_hashing_sha256((char*)data, data_length, &unix_fs->hash[0]) == 0) { free(unix_fs->bytes); free(unix_fs->hash); return 0;