Fixed some compiler warnings

yamux
John Jones 2017-02-13 05:34:56 -05:00
parent 0522bedd2a
commit c972852c9a
5 changed files with 5 additions and 4 deletions

View File

@ -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;
}

View File

@ -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.

View File

@ -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;
}

View File

@ -1,3 +1,4 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

View File

@ -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;