From: Saverio Proto Date: Sun, 1 Jun 2014 17:06:33 +0000 (+0200) Subject: Fix compiler warnings X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=refs%2Fheads%2Fapp2libraryqueue;p=meshlink Fix compiler warnings --- diff --git a/src/meshlink.c b/src/meshlink.c index 36a8b663..dc897f47 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -863,18 +863,18 @@ bool meshlink_send(meshlink_handle_t *mesh, meshlink_node_t *destination, const return true; } -bool meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh) { +void meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh) { vpn_packet_t packet; meshlink_packethdr_t *hdr = (meshlink_packethdr_t *)packet.data; outpacketqueue_t* p = list_get_tail(mesh->outpacketqueue); if (p) list_delete_tail(mesh->outpacketqueue); - else return false; + else return ; if (sizeof(meshlink_packethdr_t) + p->len > MAXSIZE) { //log something - return false; + return ; } packet.probe = false; @@ -888,7 +888,7 @@ bool meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh) { mesh->self->in_packets++; mesh->self->in_bytes += packet.len; route(mesh, mesh->self, &packet); - return false; + return ; } meshlink_node_t *meshlink_get_node(meshlink_handle_t *mesh, const char *name) { diff --git a/src/meshlink.h b/src/meshlink.h index cb588925..f7b3f948 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -197,7 +197,7 @@ extern void meshlink_set_log_cb(meshlink_handle_t *mesh, meshlink_log_level_t le */ extern bool meshlink_send(meshlink_handle_t *mesh, meshlink_node_t *destination, const void *data, unsigned int len); -extern bool meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh); +extern void meshlink_send_from_queue(event_loop_t* el,meshlink_handle_t *mesh); /// Get a handle for a specific node. /** This function returns a handle for the node with the given name. diff --git a/src/net.c b/src/net.c index 39bd2dc4..5f50531b 100644 --- a/src/net.c +++ b/src/net.c @@ -271,7 +271,7 @@ int main_loop(meshlink_handle_t *mesh) { //Add signal handler mesh->datafromapp.signum = 0; - signal_add(&(mesh->loop),&(mesh->datafromapp), meshlink_send_from_queue,mesh, mesh->datafromapp.signum); + signal_add(&(mesh->loop),&(mesh->datafromapp), (signal_cb_t)meshlink_send_from_queue,mesh, mesh->datafromapp.signum); if(!event_loop_run(&mesh->loop)) { logger(DEBUG_ALWAYS, LOG_ERR, "Error while waiting for input: %s", strerror(errno));