summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-21 20:13:41 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-10-22 13:27:02 +0200
commit3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2 (patch)
tree881da180b8d801c38ba0fbad2fc9f387a70ec016 /include
parentd5a52f3951fff7ee272bd0d4cd95cd122d07fa64 (diff)
downloadouroboros-3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2.tar.gz
ouroboros-3cafbf3cfe5c58a6988dbfc4c29148ebb804f5c2.zip
build: Compile with strict conversion
This has the code checked with -Wcast-qual and -Wconversion flags. These flags were removed because SWIG generated code fails.
Diffstat (limited to 'include')
-rw-r--r--include/ouroboros/bitmap.h9
-rw-r--r--include/ouroboros/config.h.in2
-rw-r--r--include/ouroboros/fqueue.h4
-rw-r--r--include/ouroboros/local-dev.h4
-rw-r--r--include/ouroboros/lockfile.h4
-rw-r--r--include/ouroboros/logs.h2
-rw-r--r--include/ouroboros/shm_flow_set.h14
-rw-r--r--include/ouroboros/shm_rbuff.h2
-rw-r--r--include/ouroboros/shm_rdrbuff.h12
9 files changed, 29 insertions, 24 deletions
diff --git a/include/ouroboros/bitmap.h b/include/ouroboros/bitmap.h
index c109f3e8..a8d03759 100644
--- a/include/ouroboros/bitmap.h
+++ b/include/ouroboros/bitmap.h
@@ -30,12 +30,17 @@
struct bmp;
-struct bmp * bmp_create(size_t bits, ssize_t offset);
+struct bmp * bmp_create(size_t bits,
+ ssize_t offset);
+
int bmp_destroy(struct bmp * b);
ssize_t bmp_allocate(struct bmp * instance);
+
int bmp_release(struct bmp * instance,
ssize_t id);
-bool bmp_is_id_valid(struct bmp * b, ssize_t id);
+
+bool bmp_is_id_valid(struct bmp * b,
+ ssize_t id);
#endif
diff --git a/include/ouroboros/config.h.in b/include/ouroboros/config.h.in
index a9d65aec..6ffcb97f 100644
--- a/include/ouroboros/config.h.in
+++ b/include/ouroboros/config.h.in
@@ -41,7 +41,7 @@
#define SHM_RDRB_MULTI_BLOCK
#define SHM_RDRB_PREFIX "/ouroboros.rdrb."
#define LOCKFILE_NAME "/ouroboros.lockfile"
-#define SHM_BUFFER_SIZE (1 << 14)
+#define SHM_BUFFER_SIZE 1 << 14
#define DU_BUFF_HEADSPACE 128
#define DU_BUFF_TAILSPACE 0
#define SHM_RBUFF_PREFIX "/ouroboros.rbuff."
diff --git a/include/ouroboros/fqueue.h b/include/ouroboros/fqueue.h
index 943d6510..4534d706 100644
--- a/include/ouroboros/fqueue.h
+++ b/include/ouroboros/fqueue.h
@@ -34,11 +34,11 @@ struct fqueue;
typedef struct flow_set flow_set_t;
typedef struct fqueue fqueue_t;
-flow_set_t * flow_set_create();
+flow_set_t * flow_set_create(void);
void flow_set_destroy(flow_set_t * set);
-fqueue_t * fqueue_create();
+fqueue_t * fqueue_create(void);
void fqueue_destroy(struct fqueue * fq);
diff --git a/include/ouroboros/local-dev.h b/include/ouroboros/local-dev.h
index 30f440b1..3a2cd812 100644
--- a/include/ouroboros/local-dev.h
+++ b/include/ouroboros/local-dev.h
@@ -25,7 +25,7 @@
ssize_t local_flow_read(int fd);
-int local_flow_write(int fd,
- ssize_t idx);
+int local_flow_write(int fd,
+ size_t idx);
#endif /* OUROBOROS_LOCAL_DEV_H */
diff --git a/include/ouroboros/lockfile.h b/include/ouroboros/lockfile.h
index c2cf4572..571780b6 100644
--- a/include/ouroboros/lockfile.h
+++ b/include/ouroboros/lockfile.h
@@ -27,8 +27,8 @@
struct lockfile;
-struct lockfile * lockfile_create();
-struct lockfile * lockfile_open();
+struct lockfile * lockfile_create(void);
+struct lockfile * lockfile_open(void);
void lockfile_close(struct lockfile * lf);
void lockfile_destroy(struct lockfile * lf);
diff --git a/include/ouroboros/logs.h b/include/ouroboros/logs.h
index db3f8519..56eac068 100644
--- a/include/ouroboros/logs.h
+++ b/include/ouroboros/logs.h
@@ -31,7 +31,7 @@
#endif
int set_logfile(char * filename);
-void close_logfile();
+void close_logfile(void);
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
diff --git a/include/ouroboros/shm_flow_set.h b/include/ouroboros/shm_flow_set.h
index 32db5d36..de5a9add 100644
--- a/include/ouroboros/shm_flow_set.h
+++ b/include/ouroboros/shm_flow_set.h
@@ -29,7 +29,7 @@
struct shm_flow_set;
-struct shm_flow_set * shm_flow_set_create();
+struct shm_flow_set * shm_flow_set_create(void);
void shm_flow_set_destroy(struct shm_flow_set * set);
@@ -38,25 +38,25 @@ struct shm_flow_set * shm_flow_set_open(pid_t api);
void shm_flow_set_close(struct shm_flow_set * set);
void shm_flow_set_zero(struct shm_flow_set * shm_set,
- ssize_t idx);
+ size_t idx);
int shm_flow_set_add(struct shm_flow_set * shm_set,
- ssize_t idx,
+ size_t idx,
int port_id);
int shm_flow_set_has(struct shm_flow_set * shm_set,
- ssize_t idx,
+ size_t idx,
int port_id);
void shm_flow_set_del(struct shm_flow_set * shm_set,
- ssize_t idx,
+ size_t idx,
int port_id);
void shm_flow_set_notify(struct shm_flow_set * set,
int port_id);
-int shm_flow_set_wait(const struct shm_flow_set * shm_set,
- ssize_t idx,
+ssize_t shm_flow_set_wait(const struct shm_flow_set * shm_set,
+ size_t idx,
int * fqueue,
const struct timespec * timeout);
diff --git a/include/ouroboros/shm_rbuff.h b/include/ouroboros/shm_rbuff.h
index 4c4e8c64..d9422ab9 100644
--- a/include/ouroboros/shm_rbuff.h
+++ b/include/ouroboros/shm_rbuff.h
@@ -41,7 +41,7 @@ int shm_rbuff_block(struct shm_rbuff * rb);
void shm_rbuff_unblock(struct shm_rbuff * rb);
int shm_rbuff_write(struct shm_rbuff * rb,
- ssize_t idx);
+ size_t idx);
ssize_t shm_rbuff_read(struct shm_rbuff * rb);
diff --git a/include/ouroboros/shm_rdrbuff.h b/include/ouroboros/shm_rdrbuff.h
index f1be3652..b16e2530 100644
--- a/include/ouroboros/shm_rdrbuff.h
+++ b/include/ouroboros/shm_rdrbuff.h
@@ -35,9 +35,9 @@ struct shm_rdrbuff;
size_t shm_du_buff_get_idx(struct shm_du_buff * sdb);
-struct shm_rdrbuff * shm_rdrbuff_create();
+struct shm_rdrbuff * shm_rdrbuff_create(void);
-struct shm_rdrbuff * shm_rdrbuff_open();
+struct shm_rdrbuff * shm_rdrbuff_open(void);
void shm_rdrbuff_close(struct shm_rdrbuff * rdrb);
@@ -60,15 +60,15 @@ ssize_t shm_rdrbuff_write_b(struct shm_rdrbuff * rdrb,
uint8_t * data,
size_t data_len);
-int shm_rdrbuff_read(uint8_t ** dst,
+ssize_t shm_rdrbuff_read(uint8_t ** dst,
struct shm_rdrbuff * rdrb,
- ssize_t idx);
+ size_t idx);
struct shm_du_buff * shm_rdrbuff_get(struct shm_rdrbuff * rdrb,
- ssize_t idx);
+ size_t idx);
int shm_rdrbuff_remove(struct shm_rdrbuff * rdrb,
- ssize_t idx);
+ size_t idx);
uint8_t * shm_du_buff_head(struct shm_du_buff * sdb);