Merge pull request #1356 from PhenomRetroShare/Fix_Warnings

Fix warnings
This commit is contained in:
csoler 2018-10-06 18:31:33 +02:00 committed by GitHub
commit 045691855b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 8 deletions

View file

@ -28,6 +28,11 @@ namespace librs
{
namespace crypto
{
// Forward declare the class
class HashStream;
// Forward declare the template operator
template<class T> HashStream& operator<<(HashStream& u, const T&);
class HashStream
{
public:

View file

@ -71,6 +71,7 @@ struct CRYPTO_dynlock_value
pthread_mutex_t mutex;
};
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/**
* OpenSSL locking function.
*
@ -88,7 +89,9 @@ static void locking_function(int mode, int n, const char */*file*/, int /*line*/
pthread_mutex_unlock(&mutex_buf[n]);
}
}
#endif
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/**
* OpenSSL uniq id function.
*
@ -102,7 +105,9 @@ static unsigned long id_function(void)
return (unsigned long) pthread_self();
#endif
}
#endif
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/**
* OpenSSL allocate and initialize dynamic crypto lock.
*
@ -121,7 +126,9 @@ static struct CRYPTO_dynlock_value *dyn_create_function(const char */*file*/, in
return value;
}
#endif
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/**
* OpenSSL dynamic locking function.
*
@ -139,7 +146,9 @@ static void dyn_lock_function(int mode, struct CRYPTO_dynlock_value *l, const ch
pthread_mutex_unlock(&l->mutex);
}
}
#endif
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/**
* OpenSSL destroy dynamic crypto lock.
*
@ -153,6 +162,7 @@ static void dyn_destroy_function(struct CRYPTO_dynlock_value *l, const char */*f
pthread_mutex_destroy(&l->mutex);
free(l);
}
#endif
/**
* Initialize TLS library.
@ -169,6 +179,7 @@ bool tls_init()
for (int i = 0; i < CRYPTO_num_locks(); i++) {
pthread_mutex_init(&mutex_buf[i], NULL);
}
# if OPENSSL_VERSION_NUMBER < 0x10100000L
/* static locks callbacks */
CRYPTO_set_locking_callback(locking_function);
CRYPTO_set_id_callback(id_function);
@ -176,8 +187,8 @@ bool tls_init()
CRYPTO_set_dynlock_create_callback(dyn_create_function);
CRYPTO_set_dynlock_lock_callback(dyn_lock_function);
CRYPTO_set_dynlock_destroy_callback(dyn_destroy_function);
return true;
#endif
return true;
}
/**