diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-20 06:02:29 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-08-20 06:08:07 +0200 |
commit | d9dc87d8409ddf8361b7fcb311ae97088ed1d984 (patch) | |
tree | c63be2cf2a7d978dd5b30b3a404d9442acefdff7 /src/method_xsalsa20_poly1305.c | |
parent | 3fd947a2d13a3f110f7c558b1d294dddfd2d25e0 (diff) | |
download | fastd-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_xsalsa20_poly1305.c')
-rw-r--r-- | src/method_xsalsa20_poly1305.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/method_xsalsa20_poly1305.c b/src/method_xsalsa20_poly1305.c index 2de5c2b..1e26247 100644 --- a/src/method_xsalsa20_poly1305.c +++ b/src/method_xsalsa20_poly1305.c @@ -78,15 +78,15 @@ static size_t method_max_packet_size(fastd_context_t *ctx) { return (fastd_max_packet_size(ctx) + NONCEBYTES + crypto_secretbox_xsalsa20poly1305_ZEROBYTES - crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES); } -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 crypto_secretbox_xsalsa20poly1305_ZEROBYTES; } -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 (crypto_secretbox_xsalsa20poly1305_BOXZEROBYTES - NONCEBYTES); } -static size_t method_min_tail_space(fastd_context_t *ctx) { +static size_t method_min_tail_space(fastd_context_t *ctx UNUSED) { return 0; } @@ -121,7 +121,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); } @@ -129,14 +129,14 @@ static bool method_session_want_refresh(fastd_context_t *ctx, fastd_method_sessi return timespec_after(&ctx->now, &session->refresh_after); } -static void method_session_free(fastd_context_t *ctx, fastd_method_session_state_t *session) { +static void method_session_free(fastd_context_t *ctx UNUSED, fastd_method_session_state_t *session) { if(session) { memset(session, 0, sizeof(fastd_method_session_state_t)); free(session); } } -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, crypto_secretbox_xsalsa20poly1305_ZEROBYTES); memset(in.data, 0, crypto_secretbox_xsalsa20poly1305_ZEROBYTES); @@ -174,7 +174,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) |