build: fix all build warnings

master^2^2
Radu Iliescu 2018-12-03 08:20:51 -05:00
parent 29d7a412fe
commit d386a4b496
6 changed files with 5 additions and 14 deletions

View File

@ -26,7 +26,6 @@ struct TransportDialer* libp2p_conn_tcp_transport_dialer_new();
* @returns a new Dialer struct
*/
struct Dialer* libp2p_conn_dialer_new(struct Libp2pPeer* peer, struct Peerstore* peerstore, struct RsaPrivateKey* rsa_private_key, struct SwarmContext* swarm) {
int success = 0;
struct Dialer* dialer = (struct Dialer*)malloc(sizeof(struct Dialer));
if (dialer != NULL) {
dialer->peerstore = peerstore;
@ -166,7 +165,7 @@ int libp2p_conn_dialer_join_swarm(const struct Dialer* dialer, struct Libp2pPeer
return 0;
}
// then get an identify
struct Stream* identify_stream = libp2p_identify_stream_new(yamux_multistream, identify, 1);
libp2p_identify_stream_new(yamux_multistream, identify, 1);
}
} else {
libp2p_logger_error("dialer", "Expected a yamux context, but got a context of type %d.\n", peer->sessionContext->default_stream->stream_type);

View File

@ -4,7 +4,7 @@
#include <stddef.h>
struct RsaPublicKey {
char* der;
unsigned char* der;
size_t der_length;
};
@ -20,7 +20,7 @@ struct RsaPrivateKey {
unsigned long long N;
// the keys in DER format
// private
char* der;
unsigned char* der;
size_t der_length;
// public
char* public_key_der;

View File

@ -256,9 +256,7 @@ int libp2p_peer_protobuf_decode(unsigned char* in, size_t in_size, struct Libp2p
int retVal = 0;
char* buffer = NULL;
size_t buffer_size = 0;
struct Libp2pLinkedList* current = NULL;
struct Libp2pLinkedList* last = NULL;
struct MultiAddress* ma = NULL;
*out = libp2p_peer_new();
if ( *out == NULL)

View File

@ -302,11 +302,6 @@ static int parse_message(const unsigned char *buf, int buflen,
int *want_return);
static const unsigned char zeroes[20] = {0};
static const unsigned char ones[20] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF
};
static const unsigned char v4prefix[16] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0
};

View File

@ -334,7 +334,6 @@ int libp2p_routing_dht_handle_add_provider(struct Stream* stream, struct Kademli
int libp2p_routing_dht_handle_get_value(struct Stream* stream, struct KademliaMessage* message, struct DhtContext* dht_context,
unsigned char** result_buffer, size_t *result_buffer_size) {
struct Datastore* datastore = dht_context->datastore;
struct Filestore* filestore = dht_context->filestore;
size_t data_size = 0;
unsigned char* data = NULL;

View File

@ -314,7 +314,7 @@ int libp2p_secio_verify_signature(struct PublicKey* public_key, const unsigned c
if (public_key->type == KEYTYPE_RSA) {
struct RsaPublicKey rsa_key = {0};
rsa_key.der = (char*)public_key->data;
rsa_key.der = public_key->data;
rsa_key.der_length = public_key->data_size;
return libp2p_crypto_rsa_verify(&rsa_key, in, in_length, signature);
}
@ -335,7 +335,7 @@ int libp2p_secio_sign(struct PrivateKey* private_key, const char* in, size_t in_
if (private_key->type == KEYTYPE_RSA) {
struct RsaPrivateKey rsa_key = {0};
rsa_key.der = (char*)private_key->data;
rsa_key.der = private_key->data;
rsa_key.der_length = private_key->data_size;
int retVal = libp2p_crypto_rsa_sign(&rsa_key, in, in_length, signature, signature_size);
// debugging