Fixed some compiler warnings

This commit is contained in:
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;