Remove -Wno-unused-parameter

Introduced UNUSED macro with cast to void in commoh.h for internal
use. Used cast to void directly in those files which do not
include common.h. Although this change doesn't fix semantic issues
with unused function parameters, it does explicitly mark all those
places, which might require attention in future.
This commit is contained in:
Oleg Synelnykov
2019-12-23 21:45:54 -06:00
committed by Dmitry Podgorny
parent 20c039fdb8
commit 198bdd77d0
33 changed files with 150 additions and 14 deletions

View File

@@ -109,6 +109,8 @@ static int _handle_error(xmpp_conn_t *const conn,
xmpp_stanza_t *child;
const char *name;
UNUSED(userdata);
/* free old stream error if it's still there */
if (conn->stream_error) {
xmpp_stanza_release(conn->stream_error->stanza);
@@ -200,6 +202,8 @@ static int _handle_error(xmpp_conn_t *const conn,
static int _handle_missing_features(xmpp_conn_t *const conn,
void *const userdata)
{
UNUSED(userdata);
xmpp_debug(conn->ctx, "xmpp", "didn't get stream features");
/* legacy auth will be attempted */
@@ -216,6 +220,8 @@ static int _handle_features(xmpp_conn_t *const conn,
const char *ns;
char *text;
UNUSED(userdata);
/* remove the handler that detects missing stream:features */
xmpp_timed_handler_delete(conn, _handle_missing_features);
@@ -293,6 +299,8 @@ static int _handle_proceedtls_default(xmpp_conn_t *const conn,
{
const char *name;
UNUSED(userdata);
name = xmpp_stanza_get_name(stanza);
xmpp_debug(conn->ctx, "xmpp", "handle proceedtls called for %s", name);
@@ -357,6 +365,8 @@ static int _handle_digestmd5_challenge(xmpp_conn_t *const conn,
xmpp_stanza_t *auth, *authdata;
const char *name;
UNUSED(userdata);
name = xmpp_stanza_get_name(stanza);
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (challenge) called for %s",
name);
@@ -412,6 +422,8 @@ static int _handle_digestmd5_rspauth(xmpp_conn_t *const conn,
xmpp_stanza_t *auth;
const char *name;
UNUSED(userdata);
name = xmpp_stanza_get_name(stanza);
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (rspauth) called for %s",
name);
@@ -825,6 +837,8 @@ static int _handle_features_sasl(xmpp_conn_t *const conn,
const char *ns;
char *resource;
UNUSED(userdata);
/* remove missing features handler */
xmpp_timed_handler_delete(conn, _handle_missing_features_sasl);
@@ -925,6 +939,8 @@ static int _handle_features_sasl(xmpp_conn_t *const conn,
static int _handle_missing_features_sasl(xmpp_conn_t *const conn,
void *const userdata)
{
UNUSED(userdata);
xmpp_error(conn->ctx, "xmpp",
"Did not receive stream features "
"after SASL authentication.");
@@ -939,6 +955,8 @@ static int _handle_bind(xmpp_conn_t *const conn,
const char *type;
xmpp_stanza_t *iq, *session;
UNUSED(userdata);
/* delete missing bind handler */
xmpp_timed_handler_delete(conn, _handle_missing_bind);
@@ -1006,6 +1024,8 @@ static int _handle_bind(xmpp_conn_t *const conn,
static int _handle_missing_bind(xmpp_conn_t *const conn, void *const userdata)
{
UNUSED(userdata);
xmpp_error(conn->ctx, "xmpp", "Server did not reply to bind request.");
xmpp_disconnect(conn);
return 0;
@@ -1017,6 +1037,8 @@ static int _handle_session(xmpp_conn_t *const conn,
{
const char *type;
UNUSED(userdata);
/* delete missing session handler */
xmpp_timed_handler_delete(conn, _handle_missing_session);
@@ -1043,6 +1065,8 @@ static int _handle_session(xmpp_conn_t *const conn,
static int _handle_missing_session(xmpp_conn_t *const conn,
void *const userdata)
{
UNUSED(userdata);
xmpp_error(conn->ctx, "xmpp", "Server did not reply to session request.");
xmpp_disconnect(conn);
return 0;
@@ -1050,6 +1074,8 @@ static int _handle_missing_session(xmpp_conn_t *const conn,
static int _handle_missing_legacy(xmpp_conn_t *const conn, void *const userdata)
{
UNUSED(userdata);
xmpp_error(conn->ctx, "xmpp",
"Server did not reply to legacy "
"authentication request.");
@@ -1064,6 +1090,8 @@ static int _handle_legacy(xmpp_conn_t *const conn,
const char *type;
const char *name;
UNUSED(userdata);
/* delete missing handler */
xmpp_timed_handler_delete(conn, _handle_missing_legacy);
@@ -1264,6 +1292,8 @@ int _handle_component_hs_response(xmpp_conn_t *const conn,
{
const char *name;
UNUSED(userdata);
xmpp_timed_handler_delete(conn, _handle_missing_handshake);
name = xmpp_stanza_get_name(stanza);
@@ -1290,6 +1320,8 @@ int _handle_component_hs_response(xmpp_conn_t *const conn,
int _handle_missing_handshake(xmpp_conn_t *const conn, void *const userdata)
{
UNUSED(userdata);
xmpp_error(conn->ctx, "xmpp", "Server did not reply to handshake request.");
xmpp_disconnect(conn);
return 0;