to halves MSVC warnings.
Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4172)
#include <openssl/asn1.h>
#include "testutil.h"
-static int test_string_tbl()
+static int test_string_tbl(void)
{
const ASN1_STRING_TABLE *tmp = NULL;
int nid = 12345678, nid2 = 87654321, rv = 0, ret = 0;
}
-static int test_sub()
+static int test_sub(void)
{
BIGNUM *a = NULL, *b = NULL, *c = NULL;
int i, st = 0;
}
-static int test_div_recip()
+static int test_div_recip(void)
{
BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL;
BN_RECP_CTX *recp = NULL;
}
-static int test_mod()
+static int test_mod(void)
{
BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL, *e = NULL;
int st = 0, i;
* Test constant-time modular exponentiation with 1024-bit inputs, which on
* x86_64 cause a different code branch to be taken.
*/
-static int test_modexp_mont5()
+static int test_modexp_mont5(void)
{
BIGNUM *a = NULL, *p = NULL, *m = NULL, *d = NULL, *e = NULL;
BIGNUM *b = NULL, *n = NULL, *c = NULL;
}
#ifndef OPENSSL_NO_EC2M
-static int test_gf2m_add()
+static int test_gf2m_add(void)
{
BIGNUM *a = NULL, *b = NULL, *c = NULL;
int i, st = 0;
return st;
}
-static int test_gf2m_mod()
+static int test_gf2m_mod(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL, *e = NULL;
int i, j, st = 0;
return st;
}
-static int test_gf2m_mul()
+static int test_gf2m_mul(void)
{
BIGNUM *a, *b[2] = {NULL, NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL, *f = NULL, *g = NULL, *h = NULL;
return st;
}
-static int test_gf2m_sqr()
+static int test_gf2m_sqr(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
int i, j, st = 0;
return st;
}
-static int test_gf2m_modinv()
+static int test_gf2m_modinv(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
int i, j, st = 0;
return st;
}
-static int test_gf2m_moddiv()
+static int test_gf2m_moddiv(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL, *f = NULL;
return st;
}
-static int test_gf2m_modexp()
+static int test_gf2m_modexp(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL, *f = NULL;
return st;
}
-static int test_gf2m_modsqrt()
+static int test_gf2m_modsqrt(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL, *f = NULL;
return st;
}
-static int test_gf2m_modsolvequad()
+static int test_gf2m_modsolvequad(void)
{
BIGNUM *a = NULL, *b[2] = {NULL,NULL}, *c = NULL, *d = NULL;
BIGNUM *e = NULL;
}
#endif
-static int test_kronecker()
+static int test_kronecker(void)
{
BIGNUM *a = NULL, *b = NULL, *r = NULL, *t = NULL;
int i, legendre, kronecker, st = 0;
return st;
}
-static int test_bn2padded()
+static int test_bn2padded(void)
{
#if HAVE_BN_PADDED
uint8_t zeros[256], out[256], reference[128];
#endif
}
-static int test_dec2bn()
+static int test_dec2bn(void)
{
BIGNUM *bn = NULL;
int st = 0;
return st;
}
-static int test_hex2bn()
+static int test_hex2bn(void)
{
BIGNUM *bn = NULL;
int st = 0;
return st;
}
-static int test_asc2bn()
+static int test_asc2bn(void)
{
BIGNUM *bn = NULL;
int st = 0;
return st;
}
-static int test_rand()
+static int test_rand(void)
{
BIGNUM *bn = NULL;
int st = 0;
return st;
}
-static int test_negzero()
+static int test_negzero(void)
{
BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL;
BIGNUM *numerator = NULL, *denominator = NULL;
return st;
}
-static int test_badmod()
+static int test_badmod(void)
{
BIGNUM *a = NULL, *b = NULL, *zero = NULL;
BN_MONT_CTX *mont = NULL;
return st;
}
-static int test_expmodzero()
+static int test_expmodzero(void)
{
BIGNUM *a = NULL, *r = NULL, *zero = NULL;
int st = 0;
return st;
}
-static int test_smallprime()
+static int test_smallprime(void)
{
static const int kBits = 10;
BIGNUM *r;
return st;
}
-static int test_3_is_prime()
+static int test_3_is_prime(void)
{
int ret = 0;
BIGNUM *r = NULL;
#define EXECUTE_CIPHERLIST_TEST() \
EXECUTE_TEST(execute_test, tear_down)
-static int test_default_cipherlist_implicit()
+static int test_default_cipherlist_implicit(void)
{
SETUP_CIPHERLIST_TEST_FIXTURE();
if (fixture == NULL)
return result;
}
-static int test_default_cipherlist_explicit()
+static int test_default_cipherlist_explicit(void)
{
SETUP_CIPHERLIST_TEST_FIXTURE();
if (fixture == NULL)
return NULL;
}
-static int test_cipher_name()
+static int test_cipher_name(void)
{
SSL_CTX *ctx = NULL;
SSL *ssl = NULL;
static expected_error_t expected_error = ASN1_UNKNOWN;
-static int test_bad_asn1()
+static int test_bad_asn1(void)
{
BIO *bio = NULL;
ASN1_VALUE *value = NULL;
return ret;
}
-static int run_tlsatest()
+static int run_tlsatest(void)
{
SSL_CTX *ctx = NULL;
BIO *f = NULL;
#define RAND_ADD_SIZE 500
-static int test_rand_add()
+static int test_rand_add(void)
{
char *p;
return ret;
}
-static int x9_62_tests()
+static int x9_62_tests(void)
{
int ret = 0;
return NULL;
}
-static int test_curve()
+static int test_curve(void)
{
EC_GROUP *group = NULL;
EC_POINT *point = NULL;
/*
* test_mod_exp_zero tests that x**0 mod 1 == 0. It returns zero on success.
*/
-static int test_mod_exp_zero()
+static int test_mod_exp_zero(void)
{
BIGNUM *a = NULL, *p = NULL, *m = NULL;
BIGNUM *r = NULL;
}
# endif
-static int test_hmac_bad()
+static int test_hmac_bad(void)
{
HMAC_CTX *ctx = NULL;
int ret = 0;
return ret;
}
-static int test_hmac_run()
+static int test_hmac_run(void)
{
char *p;
HMAC_CTX *ctx = NULL;
}
-static int test_hmac_single_shot()
+static int test_hmac_single_shot(void)
{
char *p;
}
-static int test_hmac_copy()
+static int test_hmac_copy(void)
{
char *p;
HMAC_CTX *ctx = NULL, *ctx2 = NULL;
static unsigned char smbuf[BUF_LEN];
-static int test_PACKET_remaining()
+static int test_PACKET_remaining(void)
{
PACKET pkt;
return 1;
}
-static int test_PACKET_end()
+static int test_PACKET_end(void)
{
PACKET pkt;
return 1;
}
-static int test_PACKET_get_1()
+static int test_PACKET_get_1(void)
{
unsigned int i;
PACKET pkt;
return 1;
}
-static int test_PACKET_get_4()
+static int test_PACKET_get_4(void)
{
unsigned long i;
PACKET pkt;
return 1;
}
-static int test_PACKET_get_net_2()
+static int test_PACKET_get_net_2(void)
{
unsigned int i;
PACKET pkt;
return 1;
}
-static int test_PACKET_get_net_3()
+static int test_PACKET_get_net_3(void)
{
unsigned long i;
PACKET pkt;
return 1;
}
-static int test_PACKET_get_net_4()
+static int test_PACKET_get_net_4(void)
{
unsigned long i;
PACKET pkt;
return 1;
}
-static int test_PACKET_get_sub_packet()
+static int test_PACKET_get_sub_packet(void)
{
PACKET pkt, subpkt;
unsigned long i;
return 1;
}
-static int test_PACKET_get_bytes()
+static int test_PACKET_get_bytes(void)
{
const unsigned char *bytes;
PACKET pkt;
return 1;
}
-static int test_PACKET_copy_bytes()
+static int test_PACKET_copy_bytes(void)
{
unsigned char bytes[4];
PACKET pkt;
return 1;
}
-static int test_PACKET_copy_all()
+static int test_PACKET_copy_all(void)
{
unsigned char tmp[BUF_LEN];
PACKET pkt;
return 1;
}
-static int test_PACKET_memdup()
+static int test_PACKET_memdup(void)
{
unsigned char *data = NULL;
size_t len;
return result;
}
-static int test_PACKET_strndup()
+static int test_PACKET_strndup(void)
{
char buf1[10], buf2[10];
char *data = NULL;
return result;
}
-static int test_PACKET_contains_zero_byte()
+static int test_PACKET_contains_zero_byte(void)
{
char buf1[10], buf2[10];
PACKET pkt;
return 1;
}
-static int test_PACKET_forward()
+static int test_PACKET_forward(void)
{
const unsigned char *byte;
PACKET pkt;
return 1;
}
-static int test_PACKET_buf_init()
+static int test_PACKET_buf_init(void)
{
unsigned char buf1[BUF_LEN];
PACKET pkt;
return 1;
}
-static int test_PACKET_null_init()
+static int test_PACKET_null_init(void)
{
PACKET pkt;
return 1;
}
-static int test_PACKET_equal()
+static int test_PACKET_equal(void)
{
PACKET pkt;
return 1;
}
-static int test_PACKET_get_length_prefixed_1()
+static int test_PACKET_get_length_prefixed_1(void)
{
unsigned char buf1[BUF_LEN];
const size_t len = 16;
return 1;
}
-static int test_PACKET_get_length_prefixed_2()
+static int test_PACKET_get_length_prefixed_2(void)
{
unsigned char buf1[1024];
const size_t len = 516; /* 0x0204 */
return 1;
}
-static int test_PACKET_get_length_prefixed_3()
+static int test_PACKET_get_length_prefixed_3(void)
{
unsigned char buf1[1024];
const size_t len = 516; /* 0x000204 */
return 1;
}
-static int test_PACKET_as_length_prefixed_1()
+static int test_PACKET_as_length_prefixed_1(void)
{
unsigned char buf1[BUF_LEN];
const size_t len = 16;
return 1;
}
-static int test_PACKET_as_length_prefixed_2()
+static int test_PACKET_as_length_prefixed_2(void)
{
unsigned char buf[1024];
const size_t len = 516; /* 0x0204 */
}
/* Test of EVP_PKEY_METHOD ordering */
-static int test_pkey_meths()
+static int test_pkey_meths(void)
{
size_t i;
int prev = -1;
return ret;
}
-static int client_setup_sni_before_state()
+static int client_setup_sni_before_state(void)
{
SSL_CTX *ctx;
SSL *con = NULL;
return ret;
}
-static int client_setup_sni_after_state()
+static int client_setup_sni_after_state(void)
{
SSL_CTX *ctx;
SSL *con = NULL;
return ret;
}
-static int server_setup_sni()
+static int server_setup_sni(void)
{
SSL_CTX *ctx;
SSL *con = NULL;
/* Sanity check of ssl_cert_table */
-static int test_ssl_cert_table()
+static int test_ssl_cert_table(void)
{
TEST_size_t_eq(OSSL_NELEM(ssl_cert_info), SSL_PKEY_NUM);
if (!test_cert_table(EVP_PKEY_RSA, SSL_aRSA, SSL_PKEY_RSA))
#define EXECUTE_SSL_TEST_CTX_TEST() \
EXECUTE_TEST(execute_test, tear_down)
-static int test_empty_configuration()
+static int test_empty_configuration(void)
{
SETUP_SSL_TEST_CTX_TEST_FIXTURE();
if (fixture == NULL)
return result;
}
-static int test_good_configuration()
+static int test_good_configuration(void)
{
SETUP_SSL_TEST_CTX_TEST_FIXTURE();
if (fixture == NULL)
* Test wrapping old style PEM password callback in a UI method through the
* use of UI utility functions
*/
-static int test_old()
+static int test_old(void)
{
UI_METHOD *ui_method = NULL;
UI *ui = NULL;
}
/* Test of UI. This uses the UI method defined in apps/apps.c */
-static int test_new_ui()
+static int test_new_ui(void)
{
PW_CB_DATA cb_data = {
"password",
return 1;
}
-static int test_x509_cmp_time_current()
+static int test_x509_cmp_time_current(void)
{
time_t now = time(NULL);
/* Pick a day earlier and later, relative to any system clock. */