mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 04:13:28 +01:00
Pass with -Wstrict-prototypes
svn:r2614
This commit is contained in:
parent
6874c39904
commit
ce5709184b
@ -17,7 +17,7 @@
|
||||
struct aes_cnt_cipher;
|
||||
typedef struct aes_cnt_cipher aes_cnt_cipher_t;
|
||||
|
||||
aes_cnt_cipher_t* aes_new_cipher();
|
||||
aes_cnt_cipher_t* aes_new_cipher(void);
|
||||
void aes_free_cipher(aes_cnt_cipher_t *cipher);
|
||||
void aes_set_key(aes_cnt_cipher_t *cipher, const unsigned char *key, int key_bits);
|
||||
void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, int len, char *output);
|
||||
|
@ -1175,7 +1175,7 @@ static BIGNUM *dh_param_g = NULL;
|
||||
|
||||
/** Initialize dh_param_p and dh_param_g if they are not already
|
||||
* set. */
|
||||
static void init_dh_param() {
|
||||
static void init_dh_param(void) {
|
||||
BIGNUM *p, *g;
|
||||
int r;
|
||||
if (dh_param_p && dh_param_g)
|
||||
@ -1366,7 +1366,7 @@ void crypto_dh_free(crypto_dh_env_t *dh)
|
||||
/** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the
|
||||
* operating system. Return 0 on suuccess, -1 on failure.
|
||||
*/
|
||||
int crypto_seed_rng()
|
||||
int crypto_seed_rng(void)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
static int provider_set = 0;
|
||||
|
@ -46,8 +46,8 @@ typedef struct crypto_digest_env_t crypto_digest_env_t;
|
||||
typedef struct crypto_dh_env_t crypto_dh_env_t;
|
||||
|
||||
/* global state */
|
||||
int crypto_global_init();
|
||||
int crypto_global_cleanup();
|
||||
int crypto_global_init(void);
|
||||
int crypto_global_cleanup(void);
|
||||
|
||||
/* environment setup */
|
||||
crypto_pk_env_t *crypto_new_pk_env(void);
|
||||
@ -100,7 +100,7 @@ void base16_encode(char *dest, size_t destlen, const char *src, size_t srclen);
|
||||
int base16_decode(char *dest, size_t destlen, const char *src, size_t srclen);
|
||||
|
||||
/* Key negotiation */
|
||||
crypto_dh_env_t *crypto_dh_new();
|
||||
crypto_dh_env_t *crypto_dh_new(void);
|
||||
int crypto_dh_get_bytes(crypto_dh_env_t *dh);
|
||||
int crypto_dh_generate_public(crypto_dh_env_t *dh);
|
||||
int crypto_dh_get_public(crypto_dh_env_t *dh, char *pubkey_out,
|
||||
@ -129,7 +129,7 @@ crypto_cipher_env_t *crypto_create_init_cipher(const char *key, int encrypt_mode
|
||||
|
||||
/* SHA-1 */
|
||||
int crypto_digest(const unsigned char *m, int len, unsigned char *digest);
|
||||
crypto_digest_env_t *crypto_new_digest_env();
|
||||
crypto_digest_env_t *crypto_new_digest_env(void);
|
||||
void crypto_free_digest_env(crypto_digest_env_t *digest);
|
||||
void crypto_digest_add_bytes(crypto_digest_env_t *digest, const char *data,
|
||||
size_t len);
|
||||
@ -140,7 +140,7 @@ void crypto_digest_assign(crypto_digest_env_t *into,
|
||||
const crypto_digest_env_t *from);
|
||||
|
||||
/* random numbers */
|
||||
int crypto_seed_rng();
|
||||
int crypto_seed_rng(void);
|
||||
int crypto_rand(unsigned int n, unsigned char *to);
|
||||
void crypto_pseudo_rand(unsigned int n, unsigned char *to);
|
||||
int crypto_pseudo_rand_int(unsigned int max);
|
||||
|
@ -147,7 +147,7 @@ tor_tls_get_error(tor_tls *tls, int r, int extra,
|
||||
/** Initialize OpenSSL, unless it has already been initialized.
|
||||
*/
|
||||
static void
|
||||
tor_tls_init() {
|
||||
tor_tls_init(void) {
|
||||
if (!tls_library_is_initialized) {
|
||||
SSL_library_init();
|
||||
SSL_load_error_strings();
|
||||
|
@ -140,7 +140,7 @@ const char *hex_str(const char *from, size_t fromlen);
|
||||
/** Generic resizeable array. */
|
||||
typedef struct smartlist_t smartlist_t;
|
||||
|
||||
smartlist_t *smartlist_create();
|
||||
smartlist_t *smartlist_create(void);
|
||||
void smartlist_free(smartlist_t *sl);
|
||||
void smartlist_set_capacity(smartlist_t *sl, int n);
|
||||
void smartlist_clear(smartlist_t *sl);
|
||||
@ -234,7 +234,7 @@ char *expand_filename(const char *filename);
|
||||
int replace_file(const char *from, const char *to);
|
||||
|
||||
int spawn_func(int (*func)(void *), void *data);
|
||||
void spawn_exit();
|
||||
void spawn_exit(void);
|
||||
|
||||
/* Because we use threads instead of processes on Windows, we need locking on Windows.
|
||||
* On Unixy platforms, these functions are no-ops. */
|
||||
|
@ -948,7 +948,7 @@ struct socks_request_t {
|
||||
|
||||
/********************************* buffers.c ***************************/
|
||||
|
||||
buf_t *buf_new();
|
||||
buf_t *buf_new(void);
|
||||
buf_t *buf_new_with_capacity(size_t size);
|
||||
void buf_free(buf_t *buf);
|
||||
void buf_clear(buf_t *buf);
|
||||
@ -1207,11 +1207,11 @@ int connection_dir_finished_connecting(connection_t *conn);
|
||||
int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk);
|
||||
int dirserv_parse_fingerprint_file(const char *fname);
|
||||
int dirserv_router_fingerprint_is_known(const routerinfo_t *router);
|
||||
void dirserv_free_fingerprint_list();
|
||||
void dirserv_free_fingerprint_list(void);
|
||||
const char *dirserv_get_nickname_by_digest(const char *digest);
|
||||
int dirserv_add_descriptor(const char **desc);
|
||||
int dirserv_load_from_directory_string(const char *dir);
|
||||
void dirserv_free_descriptors();
|
||||
void dirserv_free_descriptors(void);
|
||||
void dirserv_remove_old_servers(int age);
|
||||
int dirserv_dump_directory_to_string(char *s, size_t maxlen,
|
||||
crypto_pk_env_t *private_key);
|
||||
|
@ -44,7 +44,7 @@ dump_hex(char *s, size_t len)
|
||||
static char temp_dir[256];
|
||||
|
||||
void
|
||||
setup_directory()
|
||||
setup_directory(void)
|
||||
{
|
||||
static int is_setup = 0;
|
||||
int r;
|
||||
@ -74,7 +74,7 @@ get_fname(const char *name)
|
||||
}
|
||||
|
||||
void
|
||||
remove_directory()
|
||||
remove_directory(void)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *de;
|
||||
@ -98,7 +98,7 @@ remove_directory()
|
||||
}
|
||||
|
||||
void
|
||||
test_buffers() {
|
||||
test_buffers(void) {
|
||||
#define MAX_BUF_SIZE 1024*1024
|
||||
char str[256];
|
||||
char str2[256];
|
||||
@ -224,7 +224,7 @@ test_buffers() {
|
||||
}
|
||||
|
||||
void
|
||||
test_crypto_dh()
|
||||
test_crypto_dh(void)
|
||||
{
|
||||
crypto_dh_env_t *dh1, *dh2;
|
||||
char p1[DH_BYTES];
|
||||
@ -259,7 +259,7 @@ test_crypto_dh()
|
||||
}
|
||||
|
||||
void
|
||||
test_crypto()
|
||||
test_crypto(void)
|
||||
{
|
||||
crypto_cipher_env_t *env1, *env2;
|
||||
crypto_pk_env_t *pk1, *pk2;
|
||||
@ -495,7 +495,7 @@ test_crypto()
|
||||
}
|
||||
|
||||
void
|
||||
test_util() {
|
||||
test_util(void) {
|
||||
struct timeval start, end;
|
||||
struct tm a_time;
|
||||
smartlist_t *sl;
|
||||
@ -695,7 +695,8 @@ test_util() {
|
||||
}
|
||||
|
||||
void
|
||||
test_gzip() {
|
||||
test_gzip(void)
|
||||
{
|
||||
char *buf1, *buf2=NULL, *buf3=NULL;
|
||||
size_t len1, len2;
|
||||
|
||||
@ -740,7 +741,8 @@ static void* _squareAndRemoveK4(const char *key, void*val, void *data)
|
||||
return (void*)(v*v);
|
||||
}
|
||||
|
||||
void test_strmap() {
|
||||
void test_strmap(void)
|
||||
{
|
||||
strmap_t *map;
|
||||
strmap_iter_t *iter;
|
||||
const char *k;
|
||||
@ -813,7 +815,8 @@ void test_strmap() {
|
||||
strmap_free(map,NULL);
|
||||
}
|
||||
|
||||
void test_onion() {
|
||||
void test_onion(void)
|
||||
{
|
||||
#if 0
|
||||
char **names;
|
||||
int i,num;
|
||||
@ -831,7 +834,8 @@ void test_onion() {
|
||||
}
|
||||
|
||||
void
|
||||
test_onion_handshake() {
|
||||
test_onion_handshake(void)
|
||||
{
|
||||
/* client-side */
|
||||
crypto_dh_env_t *c_dh = NULL;
|
||||
char c_buf[ONIONSKIN_CHALLENGE_LEN];
|
||||
@ -876,7 +880,7 @@ test_onion_handshake() {
|
||||
int is_obsolete_version(const char *myversion, const char *start);
|
||||
|
||||
void
|
||||
test_dir_format()
|
||||
test_dir_format(void)
|
||||
{
|
||||
char buf[8192], buf2[8192];
|
||||
char platform[256];
|
||||
@ -1124,7 +1128,7 @@ test_dir_format()
|
||||
|
||||
}
|
||||
|
||||
void test_rend_fns()
|
||||
void test_rend_fns(void)
|
||||
{
|
||||
char address1[] = "fooaddress.onion";
|
||||
char address2[] = "aaaaaaaaaaaaaaaa.onion";
|
||||
|
Loading…
Reference in New Issue
Block a user