Turned on warnings for compilation

This commit is contained in:
John Jones 2016-12-05 06:54:21 -05:00
parent 362ef81cb7
commit bf9ddfd6f6
18 changed files with 26 additions and 24 deletions

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -50,6 +50,6 @@ int ipfs_blockstore_put(struct Block* block, struct FSRepo* fs_repo) {
return 0;
// send to Put with key
fs_repo->config->datastore->datastore_put(key, key_length, block, fs_repo->config->datastore);
fs_repo->config->datastore->datastore_put(key, key_length, block->data, block->data_length, fs_repo->config->datastore);
return 0;
}

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -Wall
LFLAGS =
DEPS = ../include/ipfs/commands/argument.h ../include/ipfs/commands/command_option.h \
../include/ipfs/commands/command.h ../include/ipfs/commands/context.h \

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -Wall
LFLAGS =
DEPS = parse.h
OBJS = parse.o

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -Wall
LFLAGS =
DEPS = builder.h ipfs_node.h
OBJS = builder.o

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include -I../../lmdb/libraries/liblmdb
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/include -I../../lmdb/libraries/liblmdb -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,6 +1,6 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -20,7 +20,7 @@ struct Datastore {
// function pointers for datastore operations
int (*datastore_open)(int argc, char** argv, struct Datastore* datastore);
int (*datastore_close)(struct Datastore* datastore);
int (*datastore_put)(const char* key, size_t key_size, struct Block* block, struct Datastore* datastore);
int (*datastore_put)(const char* key, size_t key_size, unsigned char* data, size_t data_length, struct Datastore* datastore);
//int (*datastore_get)(const char* key, struct Block* block);
// a handle to the datastore "context" used by the datastore
void* handle;

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include
CFLAGS = -O0 -I../include -I../../c-libp2p/include -Wall
LFLAGS =
DEPS =
OBJS = utils.o

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -I../../../c-multihash/include
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -I../../../c-multihash/include -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -I../../../lmdb/libraries/liblmdb
CFLAGS = -O0 -I../../include -I../../../c-libp2p/include -I../../../lmdb/libraries/liblmdb -Wall
ifdef DEBUG
CFLAGS += -g3

View file

@ -16,7 +16,7 @@
* @param block the block to be written
* @returns true(1) on success
*/
int repo_fsrepo_lmdb_put(const char* key, size_t key_size, struct Block* block, struct Datastore* datastore) {
int repo_fsrepo_lmdb_put(const char* key, size_t key_size, unsigned char* data, size_t data_size, struct Datastore* datastore) {
int retVal;
MDB_txn* mdb_txn;
MDB_dbi mdb_dbi;
@ -38,8 +38,8 @@ int repo_fsrepo_lmdb_put(const char* key, size_t key_size, struct Block* block,
// write
db_key.mv_size = key_size;
db_key.mv_data = (char*)key;
db_value.mv_size = block->data_length;
db_value.mv_data = block->data;
db_value.mv_size = data_size;
db_value.mv_data = data;
retVal = mdb_put(mdb_txn, mdb_dbi, &db_key, &db_value, MDB_NODUPDATA);
if (retVal != 0)
return 0;

View file

@ -1,5 +1,5 @@
CC = gcc
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/ -g3
CFLAGS = -O0 -I../include -I../../c-libp2p/include -I../../c-multihash/include -I../../c-multiaddr/ -g3 -Wall
LFLAGS = -L../../c-libp2p -L../../c-multihash -L../../c-multiaddr -lp2p -lm -lmultihash -lmultiaddr -lpthread
DEPS = cmd/ipfs/test_init.h repo/test_repo_bootstrap_peers.h repo/test_repo_config.h repo/test_repo_identity.h cid/test_cid.h
OBJS = testit.o ../cmd/ipfs/init.o ../commands/argument.o ../commands/command_option.o \

View file

@ -5,14 +5,16 @@
#define __TEST_INIT_H__
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
//#include <string.h>
#include "ipfs/cmd/ipfs/init.h"
#include "ipfs/commands/argument.h"
#include "ipfs/commands/request.h"
#include "ipfs/commands/command.h"
#include "ipfs/os/utils.h"
#include <stdio.h>
//#include <string.h>
int test_init_new_installation() {
unlink("/tmp/.ipfs/config");

View file

@ -103,6 +103,9 @@ int make_ipfs_repository(struct FSRepo* fs_repo) {
return retVal;
}
/**
* create a repository and put a record in the datastore and a block in the blockstore
*/
int test_ipfs_datastore_put() {
struct Block* block;
int retVal;
@ -134,11 +137,8 @@ int test_ipfs_datastore_put() {
if (retVal == 0)
return 0;
/*
// send to Put with key
retVal = fs_repo->config->datastore->datastore_put(key, key_length, block, fs_repo->config->datastore);
*/
retVal = fs_repo->config->datastore->datastore_put(key, key_length, block->data, block->data_length, fs_repo->config->datastore);
if (retVal == 0)
return 0;