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

@@ -26,6 +26,8 @@ int handle_reply(xmpp_conn_t *const conn,
xmpp_stanza_t *query, *item;
const char *type;
(void)userdata;
type = xmpp_stanza_get_type(stanza);
if (strcmp(type, "error") == 0)
fprintf(stderr, "ERROR: query failed\n");
@@ -53,6 +55,9 @@ void conn_handler(xmpp_conn_t *const conn,
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
xmpp_stanza_t *iq, *query;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_CONNECT) {
fprintf(stderr, "DEBUG: connected\n");

View File

@@ -28,6 +28,9 @@ void conn_handler(xmpp_conn_t *const conn,
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
int secured;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_CONNECT) {
fprintf(stderr, "DEBUG: connected\n");
secured = xmpp_conn_is_secured(conn);

View File

@@ -126,6 +126,9 @@ void conn_handler(xmpp_conn_t *const conn,
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_CONNECT) {
xmpp_stanza_t *pres;
fprintf(stderr, "DEBUG: connected\n");

View File

@@ -28,6 +28,9 @@ void conn_handler(xmpp_conn_t *const conn,
{
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_CONNECT) {
fprintf(stderr, "DEBUG: connected\n");
xmpp_disconnect(conn);

View File

@@ -106,6 +106,8 @@ static int iq_reg2_cb(xmpp_conn_t *const conn,
{
const char *type;
(void)userdata;
type = xmpp_stanza_get_type(stanza);
if (!type || strcmp(type, "error") == 0) {
fprintf(stderr, "DEBUG: error during registration\n");
@@ -166,6 +168,9 @@ static int _handle_error(xmpp_conn_t *const conn,
xmpp_stanza_t *const stanza,
void *const userdata)
{
(void)stanza;
(void)userdata;
fprintf(stderr, "DEBUG: received stream error\n");
xmpp_disconnect(conn);
@@ -178,6 +183,8 @@ static int _handle_proceedtls_default(xmpp_conn_t *const conn,
{
const char *name = xmpp_stanza_get_name(stanza);
(void)userdata;
if (strcmp(name, "proceed") == 0) {
fprintf(stderr, "DEBUG: proceeding with TLS\n");
if (xmpp_conn_tls_start(conn) == 0) {
@@ -195,6 +202,8 @@ static int _handle_proceedtls_default(xmpp_conn_t *const conn,
static int _handle_missing_features(xmpp_conn_t *const conn,
void *const userdata)
{
(void)userdata;
fprintf(stderr, "DEBUG: timeout\n");
xmpp_disconnect(conn);
@@ -263,6 +272,9 @@ static void conn_handler(xmpp_conn_t *const conn,
xmpp_reg_t *reg = (xmpp_reg_t *)userdata;
int secured;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_RAW_CONNECT) {
fprintf(stderr, "DEBUG: raw connection established\n");
xmpp_conn_open_stream_default(conn);

View File

@@ -25,6 +25,8 @@ int handle_reply(xmpp_conn_t *const conn,
xmpp_stanza_t *query, *item;
const char *type, *name;
(void)userdata;
type = xmpp_stanza_get_type(stanza);
if (strcmp(type, "error") == 0)
fprintf(stderr, "ERROR: query failed\n");
@@ -58,6 +60,9 @@ void conn_handler(xmpp_conn_t *const conn,
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
xmpp_stanza_t *iq, *query;
(void)error;
(void)stream_error;
if (status == XMPP_CONN_CONNECT) {
fprintf(stderr, "DEBUG: connected\n");

View File

@@ -1,7 +1,7 @@
#include <stdio.h>
#include <strophe.h>
int main(int argc, char **argv)
int main()
{
xmpp_ctx_t *ctx;
char *uuid;

View File

@@ -162,6 +162,8 @@ exit:
static int timedout(xmpp_conn_t *const conn, void *const userdata)
{
(void)userdata;
fprintf(stderr, "Timeout reached.\n");
xmpp_disconnect(conn);