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
@@ -22,7 +22,7 @@ WARNING_FLAGS="-Wall"
|
|||||||
|
|
||||||
AS_CASE([$PLATFORM],
|
AS_CASE([$PLATFORM],
|
||||||
[haiku], [],
|
[haiku], [],
|
||||||
[WARNING_FLAGS="$WARNING_FLAGS -Wextra -Wno-unused-parameter"])
|
[WARNING_FLAGS="$WARNING_FLAGS -Wextra"])
|
||||||
|
|
||||||
AC_ARG_WITH([libxml2],
|
AC_ARG_WITH([libxml2],
|
||||||
[AS_HELP_STRING([--with-libxml2], [use libxml2 for XML parsing, expat is the default])])
|
[AS_HELP_STRING([--with-libxml2], [use libxml2 for XML parsing, expat is the default])])
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ int handle_reply(xmpp_conn_t *const conn,
|
|||||||
xmpp_stanza_t *query, *item;
|
xmpp_stanza_t *query, *item;
|
||||||
const char *type;
|
const char *type;
|
||||||
|
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
type = xmpp_stanza_get_type(stanza);
|
type = xmpp_stanza_get_type(stanza);
|
||||||
if (strcmp(type, "error") == 0)
|
if (strcmp(type, "error") == 0)
|
||||||
fprintf(stderr, "ERROR: query failed\n");
|
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_ctx_t *ctx = (xmpp_ctx_t *)userdata;
|
||||||
xmpp_stanza_t *iq, *query;
|
xmpp_stanza_t *iq, *query;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_CONNECT) {
|
if (status == XMPP_CONN_CONNECT) {
|
||||||
fprintf(stderr, "DEBUG: connected\n");
|
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;
|
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
|
||||||
int secured;
|
int secured;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_CONNECT) {
|
if (status == XMPP_CONN_CONNECT) {
|
||||||
fprintf(stderr, "DEBUG: connected\n");
|
fprintf(stderr, "DEBUG: connected\n");
|
||||||
secured = xmpp_conn_is_secured(conn);
|
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;
|
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_CONNECT) {
|
if (status == XMPP_CONN_CONNECT) {
|
||||||
xmpp_stanza_t *pres;
|
xmpp_stanza_t *pres;
|
||||||
fprintf(stderr, "DEBUG: connected\n");
|
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;
|
xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_CONNECT) {
|
if (status == XMPP_CONN_CONNECT) {
|
||||||
fprintf(stderr, "DEBUG: connected\n");
|
fprintf(stderr, "DEBUG: connected\n");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ static int iq_reg2_cb(xmpp_conn_t *const conn,
|
|||||||
{
|
{
|
||||||
const char *type;
|
const char *type;
|
||||||
|
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
type = xmpp_stanza_get_type(stanza);
|
type = xmpp_stanza_get_type(stanza);
|
||||||
if (!type || strcmp(type, "error") == 0) {
|
if (!type || strcmp(type, "error") == 0) {
|
||||||
fprintf(stderr, "DEBUG: error during registration\n");
|
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,
|
xmpp_stanza_t *const stanza,
|
||||||
void *const userdata)
|
void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)stanza;
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
fprintf(stderr, "DEBUG: received stream error\n");
|
fprintf(stderr, "DEBUG: received stream error\n");
|
||||||
xmpp_disconnect(conn);
|
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);
|
const char *name = xmpp_stanza_get_name(stanza);
|
||||||
|
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
if (strcmp(name, "proceed") == 0) {
|
if (strcmp(name, "proceed") == 0) {
|
||||||
fprintf(stderr, "DEBUG: proceeding with TLS\n");
|
fprintf(stderr, "DEBUG: proceeding with TLS\n");
|
||||||
if (xmpp_conn_tls_start(conn) == 0) {
|
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,
|
static int _handle_missing_features(xmpp_conn_t *const conn,
|
||||||
void *const userdata)
|
void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
fprintf(stderr, "DEBUG: timeout\n");
|
fprintf(stderr, "DEBUG: timeout\n");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
|
|
||||||
@@ -263,6 +272,9 @@ static void conn_handler(xmpp_conn_t *const conn,
|
|||||||
xmpp_reg_t *reg = (xmpp_reg_t *)userdata;
|
xmpp_reg_t *reg = (xmpp_reg_t *)userdata;
|
||||||
int secured;
|
int secured;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_RAW_CONNECT) {
|
if (status == XMPP_CONN_RAW_CONNECT) {
|
||||||
fprintf(stderr, "DEBUG: raw connection established\n");
|
fprintf(stderr, "DEBUG: raw connection established\n");
|
||||||
xmpp_conn_open_stream_default(conn);
|
xmpp_conn_open_stream_default(conn);
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ int handle_reply(xmpp_conn_t *const conn,
|
|||||||
xmpp_stanza_t *query, *item;
|
xmpp_stanza_t *query, *item;
|
||||||
const char *type, *name;
|
const char *type, *name;
|
||||||
|
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
type = xmpp_stanza_get_type(stanza);
|
type = xmpp_stanza_get_type(stanza);
|
||||||
if (strcmp(type, "error") == 0)
|
if (strcmp(type, "error") == 0)
|
||||||
fprintf(stderr, "ERROR: query failed\n");
|
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_ctx_t *ctx = (xmpp_ctx_t *)userdata;
|
||||||
xmpp_stanza_t *iq, *query;
|
xmpp_stanza_t *iq, *query;
|
||||||
|
|
||||||
|
(void)error;
|
||||||
|
(void)stream_error;
|
||||||
|
|
||||||
if (status == XMPP_CONN_CONNECT) {
|
if (status == XMPP_CONN_CONNECT) {
|
||||||
fprintf(stderr, "DEBUG: connected\n");
|
fprintf(stderr, "DEBUG: connected\n");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <strophe.h>
|
#include <strophe.h>
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
char *uuid;
|
char *uuid;
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ exit:
|
|||||||
|
|
||||||
static int timedout(xmpp_conn_t *const conn, void *const userdata)
|
static int timedout(xmpp_conn_t *const conn, void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
fprintf(stderr, "Timeout reached.\n");
|
fprintf(stderr, "Timeout reached.\n");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
|
|
||||||
|
|||||||
32
src/auth.c
32
src/auth.c
@@ -109,6 +109,8 @@ static int _handle_error(xmpp_conn_t *const conn,
|
|||||||
xmpp_stanza_t *child;
|
xmpp_stanza_t *child;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* free old stream error if it's still there */
|
/* free old stream error if it's still there */
|
||||||
if (conn->stream_error) {
|
if (conn->stream_error) {
|
||||||
xmpp_stanza_release(conn->stream_error->stanza);
|
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,
|
static int _handle_missing_features(xmpp_conn_t *const conn,
|
||||||
void *const userdata)
|
void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_debug(conn->ctx, "xmpp", "didn't get stream features");
|
xmpp_debug(conn->ctx, "xmpp", "didn't get stream features");
|
||||||
|
|
||||||
/* legacy auth will be attempted */
|
/* legacy auth will be attempted */
|
||||||
@@ -216,6 +220,8 @@ static int _handle_features(xmpp_conn_t *const conn,
|
|||||||
const char *ns;
|
const char *ns;
|
||||||
char *text;
|
char *text;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* remove the handler that detects missing stream:features */
|
/* remove the handler that detects missing stream:features */
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_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;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
name = xmpp_stanza_get_name(stanza);
|
name = xmpp_stanza_get_name(stanza);
|
||||||
xmpp_debug(conn->ctx, "xmpp", "handle proceedtls called for %s", name);
|
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;
|
xmpp_stanza_t *auth, *authdata;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
name = xmpp_stanza_get_name(stanza);
|
name = xmpp_stanza_get_name(stanza);
|
||||||
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (challenge) called for %s",
|
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (challenge) called for %s",
|
||||||
name);
|
name);
|
||||||
@@ -412,6 +422,8 @@ static int _handle_digestmd5_rspauth(xmpp_conn_t *const conn,
|
|||||||
xmpp_stanza_t *auth;
|
xmpp_stanza_t *auth;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
name = xmpp_stanza_get_name(stanza);
|
name = xmpp_stanza_get_name(stanza);
|
||||||
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (rspauth) called for %s",
|
xmpp_debug(conn->ctx, "xmpp", "handle digest-md5 (rspauth) called for %s",
|
||||||
name);
|
name);
|
||||||
@@ -825,6 +837,8 @@ static int _handle_features_sasl(xmpp_conn_t *const conn,
|
|||||||
const char *ns;
|
const char *ns;
|
||||||
char *resource;
|
char *resource;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* remove missing features handler */
|
/* remove missing features handler */
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_features_sasl);
|
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,
|
static int _handle_missing_features_sasl(xmpp_conn_t *const conn,
|
||||||
void *const userdata)
|
void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_error(conn->ctx, "xmpp",
|
xmpp_error(conn->ctx, "xmpp",
|
||||||
"Did not receive stream features "
|
"Did not receive stream features "
|
||||||
"after SASL authentication.");
|
"after SASL authentication.");
|
||||||
@@ -939,6 +955,8 @@ static int _handle_bind(xmpp_conn_t *const conn,
|
|||||||
const char *type;
|
const char *type;
|
||||||
xmpp_stanza_t *iq, *session;
|
xmpp_stanza_t *iq, *session;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* delete missing bind handler */
|
/* delete missing bind handler */
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_bind);
|
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)
|
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_error(conn->ctx, "xmpp", "Server did not reply to bind request.");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1017,6 +1037,8 @@ static int _handle_session(xmpp_conn_t *const conn,
|
|||||||
{
|
{
|
||||||
const char *type;
|
const char *type;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* delete missing session handler */
|
/* delete missing session handler */
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_session);
|
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,
|
static int _handle_missing_session(xmpp_conn_t *const conn,
|
||||||
void *const userdata)
|
void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_error(conn->ctx, "xmpp", "Server did not reply to session request.");
|
xmpp_error(conn->ctx, "xmpp", "Server did not reply to session request.");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
return 0;
|
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)
|
static int _handle_missing_legacy(xmpp_conn_t *const conn, void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_error(conn->ctx, "xmpp",
|
xmpp_error(conn->ctx, "xmpp",
|
||||||
"Server did not reply to legacy "
|
"Server did not reply to legacy "
|
||||||
"authentication request.");
|
"authentication request.");
|
||||||
@@ -1064,6 +1090,8 @@ static int _handle_legacy(xmpp_conn_t *const conn,
|
|||||||
const char *type;
|
const char *type;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
/* delete missing handler */
|
/* delete missing handler */
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_legacy);
|
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;
|
const char *name;
|
||||||
|
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_timed_handler_delete(conn, _handle_missing_handshake);
|
xmpp_timed_handler_delete(conn, _handle_missing_handshake);
|
||||||
|
|
||||||
name = xmpp_stanza_get_name(stanza);
|
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)
|
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_error(conn->ctx, "xmpp", "Server did not reply to handshake request.");
|
||||||
xmpp_disconnect(conn);
|
xmpp_disconnect(conn);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -130,6 +130,8 @@ struct _xmpp_handlist_t {
|
|||||||
} u;
|
} u;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define UNUSED(x) ((void)(x))
|
||||||
|
|
||||||
#define MAX_DOMAIN_LEN 256
|
#define MAX_DOMAIN_LEN 256
|
||||||
|
|
||||||
#define SASL_MASK_PLAIN (1 << 0)
|
#define SASL_MASK_PLAIN (1 << 0)
|
||||||
|
|||||||
@@ -1065,6 +1065,8 @@ int xmpp_conn_is_disconnected(xmpp_conn_t *const conn)
|
|||||||
/* timed handler for cleanup if normal disconnect procedure takes too long */
|
/* timed handler for cleanup if normal disconnect procedure takes too long */
|
||||||
static int _disconnect_cleanup(xmpp_conn_t *const conn, void *const userdata)
|
static int _disconnect_cleanup(xmpp_conn_t *const conn, void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
|
|
||||||
xmpp_debug(conn->ctx, "xmpp", "disconnection forced by cleanup timeout");
|
xmpp_debug(conn->ctx, "xmpp", "disconnection forced by cleanup timeout");
|
||||||
|
|
||||||
conn_disconnect(conn);
|
conn_disconnect(conn);
|
||||||
@@ -1229,6 +1231,8 @@ static void _handle_stream_end(char *name, void *const userdata)
|
|||||||
{
|
{
|
||||||
xmpp_conn_t *conn = (xmpp_conn_t *)userdata;
|
xmpp_conn_t *conn = (xmpp_conn_t *)userdata;
|
||||||
|
|
||||||
|
UNUSED(name);
|
||||||
|
|
||||||
/* stream is over */
|
/* stream is over */
|
||||||
xmpp_debug(conn->ctx, "xmpp", "RECV: </stream:stream>");
|
xmpp_debug(conn->ctx, "xmpp", "RECV: </stream:stream>");
|
||||||
conn_disconnect_clean(conn);
|
conn_disconnect_clean(conn);
|
||||||
|
|||||||
@@ -123,16 +123,19 @@ int xmpp_version_check(int major, int minor)
|
|||||||
*/
|
*/
|
||||||
static void *_malloc(const size_t size, void *const userdata)
|
static void *_malloc(const size_t size, void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _free(void *p, void *const userdata)
|
static void _free(void *p, void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *_realloc(void *p, const size_t size, void *const userdata)
|
static void *_realloc(void *p, const size_t size, void *const userdata)
|
||||||
{
|
{
|
||||||
|
UNUSED(userdata);
|
||||||
return realloc(p, size);
|
return realloc(p, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,6 +123,11 @@ static void _start_element(void *userdata,
|
|||||||
xmpp_stanza_t *child;
|
xmpp_stanza_t *child;
|
||||||
char **cbattrs;
|
char **cbattrs;
|
||||||
|
|
||||||
|
UNUSED(prefix);
|
||||||
|
UNUSED(nnamespaces);
|
||||||
|
UNUSED(namespaces);
|
||||||
|
UNUSED(ndefaulted);
|
||||||
|
|
||||||
if (parser->depth == 0) {
|
if (parser->depth == 0) {
|
||||||
/* notify the owner */
|
/* notify the owner */
|
||||||
if (parser->startcb) {
|
if (parser->startcb) {
|
||||||
@@ -178,6 +183,9 @@ static void _end_element(void *userdata,
|
|||||||
{
|
{
|
||||||
parser_t *parser = (parser_t *)userdata;
|
parser_t *parser = (parser_t *)userdata;
|
||||||
|
|
||||||
|
UNUSED(prefix);
|
||||||
|
UNUSED(uri);
|
||||||
|
|
||||||
parser->depth--;
|
parser->depth--;
|
||||||
|
|
||||||
if (parser->depth == 0) {
|
if (parser->depth == 0) {
|
||||||
|
|||||||
@@ -500,6 +500,8 @@ static void ares_srv_lookup_callback(
|
|||||||
{
|
{
|
||||||
struct resolver_ares_ctx *actx = arg;
|
struct resolver_ares_ctx *actx = arg;
|
||||||
|
|
||||||
|
(void)timeouts;
|
||||||
|
|
||||||
if (status != ARES_SUCCESS)
|
if (status != ARES_SUCCESS)
|
||||||
actx->result = XMPP_DOMAIN_NOT_FOUND;
|
actx->result = XMPP_DOMAIN_NOT_FOUND;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -184,6 +184,8 @@ static char *_add_key(xmpp_ctx_t *ctx,
|
|||||||
const char *value, *qvalue;
|
const char *value, *qvalue;
|
||||||
char *c;
|
char *c;
|
||||||
|
|
||||||
|
UNUSED(len);
|
||||||
|
|
||||||
/* allocate a zero-length string if necessary */
|
/* allocate a zero-length string if necessary */
|
||||||
if (buf == NULL) {
|
if (buf == NULL) {
|
||||||
buf = xmpp_alloc(ctx, 1);
|
buf = xmpp_alloc(ctx, 1);
|
||||||
@@ -405,6 +407,8 @@ char *sasl_scram(xmpp_ctx_t *ctx,
|
|||||||
size_t response_len;
|
size_t response_len;
|
||||||
size_t auth_len;
|
size_t auth_len;
|
||||||
|
|
||||||
|
UNUSED(jid);
|
||||||
|
|
||||||
tmp = xmpp_strdup(ctx, challenge);
|
tmp = xmpp_strdup(ctx, challenge);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
@@ -35,57 +35,73 @@ void tls_shutdown(void)
|
|||||||
|
|
||||||
tls_t *tls_new(xmpp_conn_t *conn)
|
tls_t *tls_new(xmpp_conn_t *conn)
|
||||||
{
|
{
|
||||||
|
UNUSED(conn);
|
||||||
/* always fail */
|
/* always fail */
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tls_free(tls_t *tls)
|
void tls_free(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
|
UNUSED(cafilename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_start(tls_t *tls)
|
int tls_start(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_stop(tls_t *tls)
|
int tls_stop(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_error(tls_t *tls)
|
int tls_error(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
/* todo: some kind of error polling/dump */
|
/* todo: some kind of error polling/dump */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_pending(tls_t *tls)
|
int tls_pending(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_read(tls_t *tls, void *const buff, const size_t len)
|
int tls_read(tls_t *tls, void *const buff, const size_t len)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
|
UNUSED(buff);
|
||||||
|
UNUSED(len);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_write(tls_t *tls, const void *const buff, const size_t len)
|
int tls_write(tls_t *tls, const void *const buff, const size_t len)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
|
UNUSED(buff);
|
||||||
|
UNUSED(len);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_clear_pending_write(tls_t *tls)
|
int tls_clear_pending_write(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int tls_is_recoverable(int error)
|
int tls_is_recoverable(int error)
|
||||||
{
|
{
|
||||||
|
UNUSED(error);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,5 +142,6 @@ int tls_write(tls_t *tls, const void *const buff, const size_t len)
|
|||||||
|
|
||||||
int tls_clear_pending_write(tls_t *tls)
|
int tls_clear_pending_write(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,8 @@ void tls_free(tls_t *tls)
|
|||||||
|
|
||||||
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
|
UNUSED(cafilename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,6 +307,7 @@ int tls_write(tls_t *tls, const void *const buff, const size_t len)
|
|||||||
|
|
||||||
int tls_clear_pending_write(tls_t *tls)
|
int tls_clear_pending_write(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,6 +209,8 @@ void tls_free(tls_t *tls)
|
|||||||
|
|
||||||
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
int tls_set_credentials(tls_t *tls, const char *cafilename)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
|
UNUSED(cafilename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -377,6 +379,7 @@ int tls_start(tls_t *tls)
|
|||||||
|
|
||||||
int tls_stop(tls_t *tls)
|
int tls_stop(tls_t *tls)
|
||||||
{
|
{
|
||||||
|
UNUSED(tls);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,9 @@ static void create_destroy(void)
|
|||||||
int cbtest_got_start = 0;
|
int cbtest_got_start = 0;
|
||||||
void cbtest_handle_start(char *name, char **attrs, void *userdata)
|
void cbtest_handle_start(char *name, char **attrs, void *userdata)
|
||||||
{
|
{
|
||||||
|
(void)attrs;
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
if (strcmp(name, "stream") == 0)
|
if (strcmp(name, "stream") == 0)
|
||||||
cbtest_got_start = 1;
|
cbtest_got_start = 1;
|
||||||
}
|
}
|
||||||
@@ -50,6 +53,8 @@ void cbtest_handle_start(char *name, char **attrs, void *userdata)
|
|||||||
int cbtest_got_end = 0;
|
int cbtest_got_end = 0;
|
||||||
void cbtest_handle_end(char *name, void *userdata)
|
void cbtest_handle_end(char *name, void *userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
if (strcmp(name, "stream") == 0)
|
if (strcmp(name, "stream") == 0)
|
||||||
cbtest_got_end = 1;
|
cbtest_got_end = 1;
|
||||||
}
|
}
|
||||||
@@ -57,6 +62,8 @@ void cbtest_handle_end(char *name, void *userdata)
|
|||||||
int cbtest_got_stanza = 0;
|
int cbtest_got_stanza = 0;
|
||||||
void cbtest_handle_stanza(xmpp_stanza_t *stanza, void *userdata)
|
void cbtest_handle_stanza(xmpp_stanza_t *stanza, void *userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
if (strcmp(xmpp_stanza_get_name(stanza), "message") == 0)
|
if (strcmp(xmpp_stanza_get_name(stanza), "message") == 0)
|
||||||
cbtest_got_stanza = 1;
|
cbtest_got_stanza = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ static const unsigned char bin_data[] = {
|
|||||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00,
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00,
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
unsigned char *udec;
|
unsigned char *udec;
|
||||||
|
|||||||
@@ -24,18 +24,24 @@ static int mem_realloc_called = 0;
|
|||||||
|
|
||||||
void *my_alloc(const size_t size, void *const userdata)
|
void *my_alloc(const size_t size, void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
mem_alloc_called++;
|
mem_alloc_called++;
|
||||||
return malloc(size);
|
return malloc(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void my_free(void *p, void *const userdata)
|
void my_free(void *p, void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
mem_free_called++;
|
mem_free_called++;
|
||||||
return free(p);
|
return free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *my_realloc(void *p, const size_t size, void *const userdata)
|
void *my_realloc(void *p, const size_t size, void *const userdata)
|
||||||
{
|
{
|
||||||
|
(void)userdata;
|
||||||
|
|
||||||
mem_realloc_called++;
|
mem_realloc_called++;
|
||||||
return realloc(p, size);
|
return realloc(p, size);
|
||||||
}
|
}
|
||||||
@@ -50,7 +56,7 @@ void my_logger(void *const userdata,
|
|||||||
log_called++;
|
log_called++;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
xmpp_mem_t mymem;
|
xmpp_mem_t mymem;
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ int test_jid_new(xmpp_ctx_t *ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ static const struct {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
struct MD5Context ctx;
|
struct MD5Context ctx;
|
||||||
unsigned char digest[16];
|
unsigned char digest[16];
|
||||||
|
|||||||
@@ -23,13 +23,25 @@
|
|||||||
/* stubs to build test without whole libstrophe */
|
/* stubs to build test without whole libstrophe */
|
||||||
void *xmpp_alloc(const xmpp_ctx_t *const ctx, const size_t size)
|
void *xmpp_alloc(const xmpp_ctx_t *const ctx, const size_t size)
|
||||||
{
|
{
|
||||||
|
(void)ctx;
|
||||||
|
(void)size;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
void xmpp_free(const xmpp_ctx_t *const ctx, void *p) {}
|
|
||||||
|
void xmpp_free(const xmpp_ctx_t *const ctx, void *p)
|
||||||
|
{
|
||||||
|
(void)ctx;
|
||||||
|
(void)p;
|
||||||
|
}
|
||||||
|
|
||||||
int xmpp_snprintf(char *str, size_t count, const char *fmt, ...)
|
int xmpp_snprintf(char *str, size_t count, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
(void)str;
|
||||||
|
(void)count;
|
||||||
|
(void)fmt;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t time_stamp(void)
|
uint64_t time_stamp(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ static int srv_rr_list_len(resolver_srv_rr_t *list)
|
|||||||
return nr;
|
return nr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
xmpp_rand_t *rand;
|
xmpp_rand_t *rand;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ int test_digest_md5(xmpp_ctx_t *ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main()
|
||||||
{
|
{
|
||||||
xmpp_ctx_t *ctx;
|
xmpp_ctx_t *ctx;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ static void test_hmac(const struct hash_alg *alg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
test_df(&scram_sha1);
|
test_df(&scram_sha1);
|
||||||
test_scram(&scram_sha1);
|
test_scram(&scram_sha1);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ static void digest_to_hex(const uint8_t *digest, char *output)
|
|||||||
*(c - 1) = '\0';
|
*(c - 1) = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
size_t k;
|
size_t k;
|
||||||
SHA1_CTX context;
|
SHA1_CTX context;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
#include "sha256.h"
|
#include "sha256.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *msg;
|
const char *msg;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ static const uint8_t hash_1m_a[SHA512_DIGEST_SIZE] = {
|
|||||||
0xe5, 0x77, 0xc3, 0x1b, 0xeb, 0x00, 0x9c, 0x5c, 0x2c, 0x49, 0xaa,
|
0xe5, 0x77, 0xc3, 0x1b, 0xeb, 0x00, 0x9c, 0x5c, 0x2c, 0x49, 0xaa,
|
||||||
0x2e, 0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b};
|
0x2e, 0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b};
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *msg;
|
const char *msg;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ int wait_for_connect(sock_t sock)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main()
|
||||||
{
|
{
|
||||||
sock_t sock;
|
sock_t sock;
|
||||||
int err;
|
int err;
|
||||||
|
|||||||
Reference in New Issue
Block a user