提交 d4cdbab9 编写于 作者: D Dr. Stephen Henson

Avoid warnings with -pedantic, specifically:

Conversion between void * and function pointer.
Value computed not used.
Signed/unsigned argument.
上级 5f834ab1
......@@ -618,7 +618,7 @@ static LHASH_OF(FUNCTION) *prog_init(void)
return(NULL);
for (f=functions; f->name != NULL; f++)
lh_FUNCTION_insert(ret,f);
(void)lh_FUNCTION_insert(ret,f);
return(ret);
}
......@@ -94,7 +94,7 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] =
};
typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD);
DECLARE_STACK_OF(EVP_PKEY_ASN1_METHOD)
static STACK_OF(EVP_PKEY_ASN1_METHOD) *app_methods = NULL;
......
......@@ -64,7 +64,7 @@
#include "asn1_locl.h"
typedef STACK_OF(X509_NAME_ENTRY) STACK_OF_X509_NAME_ENTRY;
DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY);
DECLARE_STACK_OF(STACK_OF_X509_NAME_ENTRY)
static int x509_name_ex_d2i(ASN1_VALUE **val,
const unsigned char **in, long len,
......
......@@ -241,7 +241,7 @@ void _CONF_free_data(CONF *conf)
static void value_free_hash_doall_arg(CONF_VALUE *a, LHASH_OF(CONF_VALUE) *conf)
{
if (a->name != NULL)
lh_CONF_VALUE_delete(conf,a);
(void)lh_CONF_VALUE_delete(conf,a);
}
static void value_free_stack_doall(CONF_VALUE *a)
......
......@@ -157,7 +157,7 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
goto end;
}
fnd->funct = NULL;
lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
(void)lh_ENGINE_PILE_insert(&(*table)->piles, fnd);
}
/* A registration shouldn't add duplciate entries */
(void)sk_ENGINE_delete_ptr(fnd->sk, e);
......
......@@ -64,7 +64,7 @@
/* Password based encryption (PBE) functions */
DECLARE_STACK_OF(EVP_PBE_CTL);
DECLARE_STACK_OF(EVP_PBE_CTL)
static STACK_OF(EVP_PBE_CTL) *pbe_algs;
/* Setup a cipher context from a PBE algorithm */
......
......@@ -69,7 +69,7 @@
typedef int sk_cmp_fn_type(const char * const *a, const char * const *b);
DECLARE_STACK_OF(EVP_PKEY_METHOD);
DECLARE_STACK_OF(EVP_PKEY_METHOD)
STACK_OF(EVP_PKEY_METHOD) *app_pkey_methods = NULL;
extern const EVP_PKEY_METHOD rsa_pkey_meth, dh_pkey_meth, dsa_pkey_meth;
......
......@@ -317,7 +317,7 @@ static EX_CLASS_ITEM *def_get_class(int class_index)
{
/* Because we're inside the ex_data lock, the
* return value from the insert will be NULL */
lh_EX_CLASS_ITEM_insert(ex_data, gen);
(void)lh_EX_CLASS_ITEM_insert(ex_data, gen);
p = gen;
}
}
......
......@@ -379,7 +379,7 @@ static APP_INFO *pop_info(void)
if (next != NULL)
{
next->references++;
lh_APP_INFO_insert(amih,next);
(void)lh_APP_INFO_insert(amih,next);
}
#ifdef LEVITTE_DEBUG_MEM
if (ret->thread_id != tmp.thread_id || ret->thread_idptr != tmp.thread_idptr)
......@@ -656,7 +656,7 @@ void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num,
#endif
mp->addr=addr2;
mp->num=num;
lh_MEM_insert(mh,mp);
(void)lh_MEM_insert(mh,mp);
}
MemCheck_on(); /* release MALLOC2 lock
......@@ -860,18 +860,26 @@ void CRYPTO_mem_leaks_fp(FILE *fp)
/* NB: The prototypes have been typedef'd to CRYPTO_MEM_LEAK_CB inside crypto.h
* If this code is restructured, remove the callback type if it is no longer
* needed. -- Geoff Thorpe */
static void cb_leak_doall_arg(const MEM *m, CRYPTO_MEM_LEAK_CB *cb)
/* Can't pass CRYPTO_MEM_LEAK_CB directly to lh_MEM_doall_arg because it
* is a function pointer and conversion to void * is prohibited. Instead
* pass its address
*/
typedef CRYPTO_MEM_LEAK_CB *PCRYPTO_MEM_LEAK_CB;
static void cb_leak_doall_arg(const MEM *m, PCRYPTO_MEM_LEAK_CB *cb)
{
cb(m->order,m->file,m->line,m->num,m->addr);
(*cb)(m->order,m->file,m->line,m->num,m->addr);
}
static IMPLEMENT_LHASH_DOALL_ARG_FN(cb_leak, const MEM, CRYPTO_MEM_LEAK_CB)
static IMPLEMENT_LHASH_DOALL_ARG_FN(cb_leak, const MEM, PCRYPTO_MEM_LEAK_CB)
void CRYPTO_mem_leaks_cb(CRYPTO_MEM_LEAK_CB *cb)
{
if (mh == NULL) return;
CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
lh_MEM_doall_arg(mh, LHASH_DOALL_ARG_FN(cb_leak), CRYPTO_MEM_LEAK_CB,
cb);
lh_MEM_doall_arg(mh, LHASH_DOALL_ARG_FN(cb_leak), PCRYPTO_MEM_LEAK_CB,
&cb);
CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
}
......@@ -59,7 +59,7 @@
#include <openssl/objects.h>
#include "obj_xref.h"
DECLARE_STACK_OF(nid_triple);
DECLARE_STACK_OF(nid_triple)
STACK_OF(nid_triple) *sig_app, *sigx_app;
static int cmp_sig(const nid_triple *a, const nid_triple *b)
......
......@@ -334,7 +334,7 @@ int TXT_DB_insert(TXT_DB *db, STRING *row)
{
if ((db->qual[i] != NULL) &&
(db->qual[i](row) == 0)) continue;
lh_STRING_insert(db->index[i],row);
(void)lh_STRING_insert(db->index[i],row);
}
}
return(1);
......
......@@ -554,7 +554,7 @@ static int append_ia5(STACK_OF(STRING) **sk, ASN1_IA5STRING *email)
if(!*sk) return 0;
/* Don't add duplicates */
if(sk_STRING_find(*sk, (char *)email->data) != -1) return 1;
emtmp = BUF_strdup(email->data);
emtmp = BUF_strdup((char *)email->data);
if(!emtmp || !sk_STRING_push(*sk, emtmp)) {
X509_email_free(*sk);
*sk = NULL;
......
......@@ -847,7 +847,7 @@ static void timeout_doall_arg(SSL_SESSION *s, TIMEOUT_PARAM *p)
{
/* The reason we don't call SSL_CTX_remove_session() is to
* save on locking overhead */
lh_SSL_SESSION_delete(p->cache,s);
(void)lh_SSL_SESSION_delete(p->cache,s);
SSL_SESSION_list_remove(p->ctx,s);
s->not_resumable=1;
if (p->ctx->remove_session_cb != NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册