From 6c0f54029816b7df0ce67b78f0dbe382546953da Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 22 Jul 2008 15:34:23 +0000 Subject: * ext/openssl: suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_x509cert.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ext/openssl/ossl_x509cert.c') diff --git a/ext/openssl/ossl_x509cert.c b/ext/openssl/ossl_x509cert.c index b97f27ffa9..fec2d8b1a3 100644 --- a/ext/openssl/ossl_x509cert.c +++ b/ext/openssl/ossl_x509cert.c @@ -134,7 +134,7 @@ static VALUE ossl_x509_initialize(int argc, VALUE *argv, VALUE self) { BIO *in; - X509 *x509; + X509 *x509, *x = DATA_PTR(self); VALUE arg; if (rb_scan_args(argc, argv, "01", &arg) == 0) { @@ -143,10 +143,12 @@ ossl_x509_initialize(int argc, VALUE *argv, VALUE self) } arg = ossl_to_der_if_possible(arg); in = ossl_obj2bio(arg); - x509 = PEM_read_bio_X509(in, (X509 **)&DATA_PTR(self), NULL, NULL); + x509 = PEM_read_bio_X509(in, &x, NULL, NULL); + DATA_PTR(self) = x; if (!x509) { - BIO_reset(in); - x509 = d2i_X509_bio(in, (X509 **)&DATA_PTR(self)); + (void)BIO_reset(in); + x509 = d2i_X509_bio(in, &x); + DATA_PTR(self) = x; } BIO_free(in); if (!x509) ossl_raise(eX509CertError, NULL); @@ -190,7 +192,7 @@ ossl_x509_to_der(VALUE self) if ((len = i2d_X509(x509, NULL)) <= 0) ossl_raise(eX509CertError, NULL); str = rb_str_new(0, len); - p = RSTRING_PTR(str); + p = (unsigned char *)RSTRING_PTR(str); if (i2d_X509(x509, &p) <= 0) ossl_raise(eX509CertError, NULL); ossl_str_adjust(str, p); @@ -690,7 +692,7 @@ static VALUE ossl_x509_inspect(VALUE self) { VALUE str; - char *cname = rb_class2name(rb_obj_class(self)); + const char *cname = rb_class2name(rb_obj_class(self)); str = rb_str_new2("#<"); rb_str_cat2(str, cname); -- cgit v1.2.3