summaryrefslogtreecommitdiffstats
path: root/src/method_aes128_gcm.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2013-08-20 06:02:29 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2013-08-20 06:08:07 +0200
commitd9dc87d8409ddf8361b7fcb311ae97088ed1d984 (patch)
treec63be2cf2a7d978dd5b30b3a404d9442acefdff7 /src/method_aes128_gcm.c
parent3fd947a2d13a3f110f7c558b1d294dddfd2d25e0 (diff)
downloadfastd-d9dc87d8409ddf8361b7fcb311ae97088ed1d984.tar
fastd-d9dc87d8409ddf8361b7fcb311ae97088ed1d984.zip
Fix lots of -Wextra warnings
Everything clang and GCC warn about, except GCC's missing-field-initializers which are just stupid as they don't allow {} syntax to zero a field.
Diffstat (limited to 'src/method_aes128_gcm.c')
-rw-r--r--src/method_aes128_gcm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/method_aes128_gcm.c b/src/method_aes128_gcm.c
index c6dafb4..f392e2e 100644
--- a/src/method_aes128_gcm.c
+++ b/src/method_aes128_gcm.c
@@ -80,19 +80,19 @@ static size_t method_max_packet_size(fastd_context_t *ctx) {
}
-static size_t method_min_encrypt_head_space(fastd_context_t *ctx) {
+static size_t method_min_encrypt_head_space(fastd_context_t *ctx UNUSED) {
return sizeof(fastd_block128_t);
}
-static size_t method_min_decrypt_head_space(fastd_context_t *ctx) {
+static size_t method_min_decrypt_head_space(fastd_context_t *ctx UNUSED) {
return 0;
}
-static size_t method_min_encrypt_tail_space(fastd_context_t *ctx) {
+static size_t method_min_encrypt_tail_space(fastd_context_t *ctx UNUSED) {
return (sizeof(fastd_block128_t)-1);
}
-static size_t method_min_decrypt_tail_space(fastd_context_t *ctx) {
+static size_t method_min_decrypt_tail_space(fastd_context_t *ctx UNUSED) {
return (2*sizeof(fastd_block128_t)-1);
}
@@ -137,7 +137,7 @@ static bool method_session_is_valid(fastd_context_t *ctx, fastd_method_session_s
return (session && timespec_after(&session->valid_till, &ctx->now));
}
-static bool method_session_is_initiator(fastd_context_t *ctx, fastd_method_session_state_t *session) {
+static bool method_session_is_initiator(fastd_context_t *ctx UNUSED, fastd_method_session_state_t *session) {
return (session->send_nonce[0] & 1);
}
@@ -164,7 +164,7 @@ static inline void put_size(fastd_block128_t *out, size_t len) {
out->b[sizeof(fastd_block128_t)-1] = len << 3;
}
-static bool method_encrypt(fastd_context_t *ctx, fastd_peer_t *peer, fastd_method_session_state_t *session, fastd_buffer_t *out, fastd_buffer_t in) {
+static bool method_encrypt(fastd_context_t *ctx, fastd_peer_t *peer UNUSED, fastd_method_session_state_t *session, fastd_buffer_t *out, fastd_buffer_t in) {
fastd_buffer_pull_head(ctx, &in, sizeof(fastd_block128_t));
memset(in.data, 0, sizeof(fastd_block128_t));
@@ -231,7 +231,7 @@ static bool method_decrypt(fastd_context_t *ctx, fastd_peer_t *peer, fastd_metho
return false;
if (age >= 0) {
- if (timespec_diff(&ctx->now, &session->receive_last) > ctx->conf->reorder_time*1000)
+ if (timespec_diff(&ctx->now, &session->receive_last) > (int)ctx->conf->reorder_time*1000)
return false;
if (age > ctx->conf->reorder_count)