Fix Gcc Warning in authssl.cc

/libretroshare/src/pqi/authssl.cc:160: warning: ‘void
dyn_destroy_function(CRYPTO_dynlock_value*, const char*, int)’ defined
but not used [-Wunused-function]
 static void dyn_destroy_function(struct CRYPTO_dynlock_value *l, const
char */*file*/, int /*line*/)
/libretroshare/src/pqi/authssl.cc:143: warning: ‘void
dyn_lock_function(int, CRYPTO_dynlock_value*, const char*, int)’ defined
but not used [-Wunused-function]
 static void dyn_lock_function(int mode, struct CRYPTO_dynlock_value *l,
const char */*file*/, int /*line*/)
/libretroshare/src/pqi/authssl.cc:121: warning: ‘CRYPTO_dynlock_value*
dyn_create_function(const char*, int)’ defined but not used [-Wunused-
function]
 static struct CRYPTO_dynlock_value *dyn_create_function(const char */
*file*/, int /*line*/)
/libretroshare/src/pqi/authssl.cc:106: warning: ‘long unsigned int
id_function()’ defined but not used [-Wunused-function]
 static unsigned long id_function(void)
/libretroshare/src/pqi/authssl.cc:92: warning: ‘void
locking_function(int, int, const char*, int)’ defined but not used [-
Wunused-function]
 static void locking_function(int mode, int n, const char */*file*/, int
/*line*/)
This commit is contained in:
Phenom 2018-02-14 19:24:24 +01:00
parent 1839d23df1
commit 6ef72f551d

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;
}
/**