Fixed some compiler warnings
This commit is contained in:
parent
0522bedd2a
commit
c972852c9a
5 changed files with 5 additions and 4 deletions
|
@ -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) {
|
int ipfs_blocks_block_add_data(const unsigned char* data, size_t data_size, struct Block* block) {
|
||||||
// cid
|
// cid
|
||||||
unsigned char hash[32];
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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)) {
|
if (ns_parserr(&query_parse_msg,ns_s_an,i,&query_parse_rr)) {
|
||||||
return ErrResolveFailed;
|
return ErrResolveFailed;
|
||||||
} else {
|
} 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
|
memcpy(p, rdata+1, *rdata); // first byte is record length
|
||||||
p += *rdata; // update pointer
|
p += *rdata; // update pointer
|
||||||
*p++ = '\0'; // mark end-of-record and update pointer to next record.
|
*p++ = '\0'; // mark end-of-record and update pointer to next record.
|
||||||
|
|
|
@ -35,7 +35,7 @@ int ipfs_merkledag_add(struct Node* node, struct FSRepo* fs_repo, size_t* bytes_
|
||||||
if (node->hash == NULL) {
|
if (node->hash == NULL) {
|
||||||
return 0;
|
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);
|
free(node->hash);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
|
@ -130,7 +130,7 @@ int ipfs_unixfs_add_data(unsigned char* data, size_t data_length, struct UnixFS*
|
||||||
free(unix_fs->bytes);
|
free(unix_fs->bytes);
|
||||||
return 0;
|
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->bytes);
|
||||||
free(unix_fs->hash);
|
free(unix_fs->hash);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue