$NetBSD: patch-en,v 1.1 2010/09/10 03:29:01 taca Exp $ * r18172: suppress warnings. --- ext/openssl/ossl_x509req.c.orig 2007-06-08 15:02:04.000000000 +0000 +++ ext/openssl/ossl_x509req.c @@ -99,7 +99,7 @@ static VALUE ossl_x509req_initialize(int argc, VALUE *argv, VALUE self) { BIO *in; - X509_REQ *req; + X509_REQ *req, *x = DATA_PTR(self); VALUE arg; if (rb_scan_args(argc, argv, "01", &arg) == 0) { @@ -107,10 +107,12 @@ ossl_x509req_initialize(int argc, VALUE } arg = ossl_to_der_if_possible(arg); in = ossl_obj2bio(arg); - req = PEM_read_bio_X509_REQ(in, (X509_REQ **)&DATA_PTR(self), NULL, NULL); + req = PEM_read_bio_X509_REQ(in, &x, NULL, NULL); + DATA_PTR(self) = x; if (!req) { - BIO_reset(in); - req = d2i_X509_REQ_bio(in, (X509_REQ **)&DATA_PTR(self)); + (void)BIO_reset(in); + req = d2i_X509_REQ_bio(in, &x); + DATA_PTR(self) = x; } BIO_free(in); if (!req) ossl_raise(eX509ReqError, NULL); @@ -171,7 +173,7 @@ ossl_x509req_to_der(VALUE self) if ((len = i2d_X509_REQ(req, 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_REQ(req, &p) <= 0) ossl_raise(eX509ReqError, NULL); ossl_str_adjust(str, p);