Compile options, -Wextra fixes

This commit is contained in:
Matthias Schiffer 2014-03-18 16:56:06 +01:00
parent 7efd6c82cb
commit 0587bef25e
5 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,5 @@
include_directories(${GMRF_INCLUDE_DIR}) include_directories(${GMRF_INCLUDE_DIR})
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS _GNU_SOURCE)
add_library(mmss_proto_babel MODULE add_library(mmss_proto_babel MODULE
babel.c babel.c
@ -9,4 +10,4 @@ add_library(mmss_proto_babel MODULE
tlv_types.c tlv_types.c
) )
target_link_libraries(mmss_proto_babel ${MMSS_PROTOCOL_LIB}) target_link_libraries(mmss_proto_babel ${MMSS_PROTOCOL_LIB})
set_target_properties(mmss_proto_babel PROPERTIES LINK_FLAGS "-Wl,--undefined=mmss_protocol_info") set_target_properties(mmss_proto_babel PROPERTIES COMPILE_FLAGS "-std=c99 -Wall" LINK_FLAGS "-Wl,--undefined=mmss_protocol_info")

View file

@ -35,13 +35,13 @@ const char *gmrf_protocol_name = "babel";
const char *gmrf_protocol_version = "experimental"; const char *gmrf_protocol_version = "experimental";
static void send_hellos(gmrf_context_t *ctx, void *arg) { static void send_hellos(gmrf_context_t *ctx, void *arg UNUSED) {
gmrf_schedule(ctx->gmrf, send_hellos, NULL, GP_BABEL_HELLO_INTERVAL*10); gmrf_schedule(ctx->gmrf, send_hellos, NULL, GP_BABEL_HELLO_INTERVAL*10);
gp_babel_send_hellos(ctx); gp_babel_send_hellos(ctx);
} }
static void send_updates(gmrf_context_t *ctx, void *arg) { static void send_updates(gmrf_context_t *ctx, void *arg UNUSED) {
gmrf_schedule(ctx->gmrf, send_updates, NULL, GP_BABEL_UPDATE_INTERVAL*10); gmrf_schedule(ctx->gmrf, send_updates, NULL, GP_BABEL_UPDATE_INTERVAL*10);
gmrf_logf(ctx->gmrf, LOG_DEBUG, "sending periodic updates."); gmrf_logf(ctx->gmrf, LOG_DEBUG, "sending periodic updates.");
@ -128,7 +128,7 @@ static void maintain_routes(gmrf_context_t *ctx) {
} }
} }
static void maintenance(gmrf_context_t *ctx, void *arg) { static void maintenance(gmrf_context_t *ctx, void *arg UNUSED) {
gmrf_schedule(ctx->gmrf, maintenance, NULL, GP_BABEL_MAINTENANCE_INTERVAL*10); gmrf_schedule(ctx->gmrf, maintenance, NULL, GP_BABEL_MAINTENANCE_INTERVAL*10);
maintain_neighbours(ctx); maintain_neighbours(ctx);

View file

@ -64,7 +64,7 @@ gp_babel_route_t* gp_babel_route_get(gmrf_context_t *ctx, const gp_babel_node_id
return route; return route;
} }
void gp_babel_route_free(gmrf_context_t *ctx, gp_babel_route_t *route) { void gp_babel_route_free(gmrf_context_t *ctx UNUSED, gp_babel_route_t *route) {
free(route); free(route);
} }

View file

@ -54,7 +54,7 @@ static void handle_tlv_ack_req(gmrf_context_t *ctx, const gp_babel_tlv_ack_req_t
gp_babel_send_ack(ctx, get_tlv_neigh(ctx, arg), ntohs(tlv->nonce)); gp_babel_send_ack(ctx, get_tlv_neigh(ctx, arg), ntohs(tlv->nonce));
} }
static void handle_tlv_ack(gmrf_context_t *ctx, const gp_babel_tlv_ack_t *tlv, size_t len, handle_tlv_arg_t *arg) { static void handle_tlv_ack(gmrf_context_t *ctx, const gp_babel_tlv_ack_t *tlv UNUSED, size_t len, handle_tlv_arg_t *arg UNUSED) {
if (len < sizeof(gp_babel_tlv_ack_t)) { if (len < sizeof(gp_babel_tlv_ack_t)) {
gmrf_logf(ctx->gmrf, LOG_WARNING, "received short acknowledement TLV."); gmrf_logf(ctx->gmrf, LOG_WARNING, "received short acknowledement TLV.");
return; return;

View file

@ -30,6 +30,9 @@
#include <gmrf/gmrf.h> #include <gmrf/gmrf.h>
#define UNUSED __attribute__((unused))
#define GP_BABEL_NODE_ID_LENGTH 8 #define GP_BABEL_NODE_ID_LENGTH 8
typedef struct __attribute__((packed)) gp_gabel_node_id { typedef struct __attribute__((packed)) gp_gabel_node_id {