Fixed warnings

This commit is contained in:
jmjatlanta 2017-07-17 16:14:40 -05:00
parent d038b5d6f7
commit cb05b249ba
4 changed files with 9 additions and 7 deletions

View file

@ -48,7 +48,7 @@ int ipfs_namesys_resolve_n(char **path, char *name, int depth)
{
char ipfs_prefix[] = "/ipfs/";
char p[500];
int err;
int err = 0;;
if (memcmp(name, ipfs_prefix, strlen(ipfs_prefix)) == 0) {
ipfs_path_parse(p, name);

View file

@ -91,6 +91,7 @@ int test_resolver_remote_get() {
int thread_started = 0;
int retVal = 0;
struct FSRepo* fs_repo = NULL;
struct HashtableNode* result = NULL;
// this should point to a test directory with files and directories
char* home_dir = os_utils_get_homedir();
@ -137,7 +138,7 @@ int test_resolver_remote_get() {
strcpy(path, "/ipfs/");
strcat(path, remote_peer_id);
strcat(path, "/QmZBvycPAYScBoPEzm35zXHt6gYYV5t9PyWmr4sksLPNFS/hello_world.txt");
struct HashtableNode* result = ipfs_resolver_get(path, NULL, &local_node);
result = ipfs_resolver_get(path, NULL, &local_node);
if (result == NULL) {
goto exit;
}

View file

@ -155,6 +155,8 @@ int test_routing_find_providers() {
struct Libp2pVector* ma_vector2 = NULL, *ma_vector3 = NULL;
struct IpfsNode local_node;
struct FSRepo* fs_repo = NULL;
struct HashtableNode* node = NULL;
struct Libp2pVector* result = NULL;
// create peer 1
drop_and_build_repository(ipfs_path, 4001, NULL, &peer_id_1);
@ -180,7 +182,6 @@ int test_routing_find_providers() {
//TODO: Find a better way to do this...
size_t bytes_written = 0;
ipfs_node_online_new(ipfs_path, &local_node2);
struct HashtableNode* node = NULL;
ipfs_import_file(NULL, "/home/parallels/ipfstest/hello_world.txt", &node, local_node2, &bytes_written, 0);
ipfs_node_free(local_node2);
// start the daemon in a separate thread
@ -215,7 +216,6 @@ int test_routing_find_providers() {
local_node.routing->Bootstrap(local_node.routing);
struct Libp2pVector* result;
if (!local_node.routing->FindProviders(local_node.routing, node->hash, node->hash_size, &result)) {
fprintf(stderr, "Unable to find a provider\n");
goto exit;
@ -308,6 +308,7 @@ int test_routing_provide() {
int thread1_started = 0, thread2_started = 0;
struct MultiAddress* ma_peer1 = NULL;
struct Libp2pVector* ma_vector2 = NULL;
struct HashtableNode* node = NULL;
// create peer 1
drop_and_build_repository(ipfs_path, 4001, NULL, &peer_id_1);
@ -333,7 +334,6 @@ int test_routing_provide() {
//TODO: Find a better way to do this...
size_t bytes_written = 0;
ipfs_node_online_new(ipfs_path, &local_node2);
struct HashtableNode* node = NULL;
ipfs_import_file(NULL, "/home/parallels/ipfstest/hello_world.txt", &node, local_node2, &bytes_written, 0);
ipfs_node_free(local_node2);
// start the daemon in a separate thread

View file

@ -165,13 +165,15 @@ int test_routing_supernode_get_value() {
char* fullFileName = "/tmp/temp_file.bin";
struct HashtableNode* write_node = NULL;
size_t bytes_written = 0;
struct Libp2pVector* multiaddresses;
struct Libp2pVector* multiaddresses = NULL;
unsigned char* results;
size_t results_size = 0;
struct HashtableNode* node = NULL;
char* ip = NULL;
pthread_t thread;
int thread_started = 0;
struct MultiAddress* addr = NULL;
if (!drop_build_and_open_repo("/tmp/.ipfs", &fs_repo))
goto exit;
@ -218,7 +220,6 @@ int test_routing_supernode_get_value() {
if (!ipfs_node->routing->FindProviders(ipfs_node->routing, write_node->hash, write_node->hash_size, &multiaddresses))
goto exit;
struct MultiAddress* addr = NULL;
for(int i = 0; i < multiaddresses->total; i++) {
addr = (struct MultiAddress*) libp2p_utils_vector_get(multiaddresses, i);
if (multiaddress_is_ip4(addr)) {