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

@@ -43,6 +43,9 @@ static void create_destroy(void)
int cbtest_got_start = 0;
void cbtest_handle_start(char *name, char **attrs, void *userdata)
{
(void)attrs;
(void)userdata;
if (strcmp(name, "stream") == 0)
cbtest_got_start = 1;
}
@@ -50,6 +53,8 @@ void cbtest_handle_start(char *name, char **attrs, void *userdata)
int cbtest_got_end = 0;
void cbtest_handle_end(char *name, void *userdata)
{
(void)userdata;
if (strcmp(name, "stream") == 0)
cbtest_got_end = 1;
}
@@ -57,6 +62,8 @@ void cbtest_handle_end(char *name, void *userdata)
int cbtest_got_stanza = 0;
void cbtest_handle_stanza(xmpp_stanza_t *stanza, void *userdata)
{
(void)userdata;
if (strcmp(xmpp_stanza_get_name(stanza), "message") == 0)
cbtest_got_stanza = 1;
}

View File

@@ -113,7 +113,7 @@ static const unsigned char bin_data[] = {
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x03, 0x63, 0x6f, 0x6d, 0x00,
};
int main(int argc, char *argv[])
int main()
{
xmpp_ctx_t *ctx;
unsigned char *udec;

View File

@@ -24,18 +24,24 @@ static int mem_realloc_called = 0;
void *my_alloc(const size_t size, void *const userdata)
{
(void)userdata;
mem_alloc_called++;
return malloc(size);
}
void my_free(void *p, void *const userdata)
{
(void)userdata;
mem_free_called++;
return free(p);
}
void *my_realloc(void *p, const size_t size, void *const userdata)
{
(void)userdata;
mem_realloc_called++;
return realloc(p, size);
}
@@ -50,7 +56,7 @@ void my_logger(void *const userdata,
log_called++;
}
int main(int argc, char **argv)
int main()
{
xmpp_ctx_t *ctx;
xmpp_mem_t mymem;

View File

@@ -146,7 +146,7 @@ int test_jid_new(xmpp_ctx_t *ctx)
return 0;
}
int main(int argc, char *argv[])
int main()
{
xmpp_ctx_t *ctx;
int ret;

View File

@@ -57,7 +57,7 @@ static const struct {
},
};
int main(int argc, char **argv)
int main()
{
struct MD5Context ctx;
unsigned char digest[16];

View File

@@ -23,13 +23,25 @@
/* stubs to build test without whole libstrophe */
void *xmpp_alloc(const xmpp_ctx_t *const ctx, const size_t size)
{
(void)ctx;
(void)size;
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, ...)
{
(void)str;
(void)count;
(void)fmt;
return 0;
}
uint64_t time_stamp(void)
{
return 0;

View File

@@ -170,7 +170,7 @@ static int srv_rr_list_len(resolver_srv_rr_t *list)
return nr;
}
int main(int argc, char **argv)
int main()
{
xmpp_ctx_t *ctx;
xmpp_rand_t *rand;

View File

@@ -80,7 +80,7 @@ int test_digest_md5(xmpp_ctx_t *ctx)
return 0;
}
int main(int argc, char *argv[])
int main()
{
xmpp_ctx_t *ctx;
int ret;

View File

@@ -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_scram(&scram_sha1);

View File

@@ -37,7 +37,7 @@ static void digest_to_hex(const uint8_t *digest, char *output)
*(c - 1) = '\0';
}
int main(int argc, char **argv)
int main()
{
size_t k;
SHA1_CTX context;

View File

@@ -10,7 +10,7 @@
#include "sha256.h"
#include "test.h"
int main(int argc, char **argv)
int main()
{
static const struct {
const char *msg;

View File

@@ -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,
0x2e, 0x4e, 0xad, 0xb2, 0x17, 0xad, 0x8c, 0xc0, 0x9b};
int main(int argc, char **argv)
int main()
{
static const struct {
const char *msg;

View File

@@ -40,7 +40,7 @@ int wait_for_connect(sock_t sock)
return -1;
}
int main(int argc, char **argv)
int main()
{
sock_t sock;
int err;