summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authoremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-19 01:15:35 +0000
committeremboss <emboss@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-19 01:15:35 +0000
commitc35204f7bdd821feb2d73782e3a56a3c822d6150 (patch)
tree02b38d4722fac463a865cb48c849e26735d5be4c /ext
parent12c497dcf68ea7e1f75b2ba100e09b9f133eafe2 (diff)
* ext/openssl/ossl_ssl.c: Remove set, but unused variables.
ext/openssl/ossl_pkey.c: ditto * ext/openssl/ossl_pkey_dh.c: Make functions passed to rb_thread_blocking_region return VALUE instead of void. ext/openssl/ossl_pkey_dsa.c: ditto ext/openssl/ossl_pkey_rsa.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/openssl/ossl_pkey.c4
-rw-r--r--ext/openssl/ossl_pkey_dh.c3
-rw-r--r--ext/openssl/ossl_pkey_dsa.c3
-rw-r--r--ext/openssl/ossl_pkey_rsa.c3
-rw-r--r--ext/openssl/ossl_ssl.c12
5 files changed, 14 insertions, 11 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c
index e07e659..cb0c320 100644
--- a/ext/openssl/ossl_pkey.c
+++ b/ext/openssl/ossl_pkey.c
@@ -38,7 +38,7 @@ ossl_generate_cb(int p, int n, void *arg)
int
ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
{
- VALUE ary, ret;
+ VALUE ary;
struct ossl_generate_cb_arg *arg;
int state;
@@ -51,7 +51,7 @@ ossl_generate_cb_2(int p, int n, BN_GENCB *cb)
/*
* can be break by raising exception or 'break'
*/
- ret = rb_protect(rb_yield, ary, &state);
+ rb_protect(rb_yield, ary, &state);
if (state) {
arg->stop = 1;
arg->state = state;
diff --git a/ext/openssl/ossl_pkey_dh.c b/ext/openssl/ossl_pkey_dh.c
index 7f62db4..819fbce 100644
--- a/ext/openssl/ossl_pkey_dh.c
+++ b/ext/openssl/ossl_pkey_dh.c
@@ -90,11 +90,12 @@ struct dh_blocking_gen_arg {
int result;
};
-static void
+static VALUE
dh_blocking_gen(void *arg)
{
struct dh_blocking_gen_arg *gen = (struct dh_blocking_gen_arg *)arg;
gen->result = DH_generate_parameters_ex(gen->dh, gen->size, gen->gen, gen->cb);
+ return Qnil;
}
#endif
diff --git a/ext/openssl/ossl_pkey_dsa.c b/ext/openssl/ossl_pkey_dsa.c
index 3339c1d..e6a44de 100644
--- a/ext/openssl/ossl_pkey_dsa.c
+++ b/ext/openssl/ossl_pkey_dsa.c
@@ -87,11 +87,12 @@ struct dsa_blocking_gen_arg {
int result;
};
-static void
+static VALUE
dsa_blocking_gen(void *arg)
{
struct dsa_blocking_gen_arg *gen = (struct dsa_blocking_gen_arg *)arg;
gen->result = DSA_generate_parameters_ex(gen->dsa, gen->size, gen->seed, gen->seed_len, gen->counter, gen->h, gen->cb);
+ return Qnil;
}
#endif
diff --git a/ext/openssl/ossl_pkey_rsa.c b/ext/openssl/ossl_pkey_rsa.c
index d6ae8d2..1e28b4f 100644
--- a/ext/openssl/ossl_pkey_rsa.c
+++ b/ext/openssl/ossl_pkey_rsa.c
@@ -85,11 +85,12 @@ struct rsa_blocking_gen_arg {
int result;
};
-static void
+static VALUE
rsa_blocking_gen(void *arg)
{
struct rsa_blocking_gen_arg *gen = (struct rsa_blocking_gen_arg *)arg;
gen->result = RSA_generate_key_ex(gen->rsa, gen->size, gen->e, gen->cb);
+ return Qnil;
}
#endif
diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index 3769633..eb04a61 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -380,7 +380,7 @@ ossl_call_session_new_cb(VALUE ary)
static int
ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
{
- VALUE ary, ssl_obj, sess_obj, ret_obj;
+ VALUE ary, ssl_obj, sess_obj;
void *ptr;
int state = 0;
@@ -397,7 +397,7 @@ ossl_sslctx_session_new_cb(SSL *ssl, SSL_SESSION *sess)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, sess_obj);
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_new_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
}
@@ -429,7 +429,7 @@ ossl_call_session_remove_cb(VALUE ary)
static void
ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
{
- VALUE ary, sslctx_obj, sess_obj, ret_obj;
+ VALUE ary, sslctx_obj, sess_obj;
void *ptr;
int state = 0;
@@ -446,7 +446,7 @@ ossl_sslctx_session_remove_cb(SSL_CTX *ctx, SSL_SESSION *sess)
rb_ary_push(ary, sslctx_obj);
rb_ary_push(ary, sess_obj);
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_session_remove_cb, ary, &state);
if (state) {
/*
the SSL_CTX is frozen, nowhere to save state.
@@ -506,7 +506,7 @@ ossl_call_servername_cb(VALUE ary)
static int
ssl_servername_cb(SSL *ssl, int *ad, void *arg)
{
- VALUE ary, ssl_obj, ret_obj;
+ VALUE ary, ssl_obj;
void *ptr;
int state = 0;
const char *servername = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
@@ -521,7 +521,7 @@ ssl_servername_cb(SSL *ssl, int *ad, void *arg)
rb_ary_push(ary, ssl_obj);
rb_ary_push(ary, rb_str_new2(servername));
- ret_obj = rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
+ rb_protect((VALUE(*)_((VALUE)))ossl_call_servername_cb, ary, &state);
if (state) {
rb_ivar_set(ssl_obj, ID_callback_state, INT2NUM(state));
return SSL_TLSEXT_ERR_ALERT_FATAL;