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:
committed by
Dmitry Podgorny
parent
20c039fdb8
commit
198bdd77d0
@@ -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");
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include <strophe.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
int main()
|
||||
{
|
||||
xmpp_ctx_t *ctx;
|
||||
char *uuid;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user