From 04051396fd738abb97ebf2396c088520dd096da3 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 11 Jul 2012 03:46:37 +0000 Subject: * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): nonstatic initializer of an aggregate type is a C99ism. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): get rid of VC++ warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36364 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_pkey_ec.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'ext/openssl/ossl_pkey_ec.c') diff --git a/ext/openssl/ossl_pkey_ec.c b/ext/openssl/ossl_pkey_ec.c index 08b875f603..8e6d88f606 100644 --- a/ext/openssl/ossl_pkey_ec.c +++ b/ext/openssl/ossl_pkey_ec.c @@ -1482,7 +1482,6 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self) EC_POINT *point1, *point2; const EC_GROUP *group; VALUE group_v = rb_iv_get(self, "@group"); - VALUE args[1] = {group_v}; VALUE bn_v1, bn_v2, r, points_v; BIGNUM *bn1 = NULL, *bn2 = NULL; @@ -1490,7 +1489,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self) SafeRequire_EC_GROUP(group_v, group); r = rb_obj_alloc(cEC_POINT); - ossl_ec_point_initialize(1, args, r); + ossl_ec_point_initialize(1, &group_v, r); Require_EC_POINT(r, point2); argc = rb_scan_args(argc, argv, "12", &bn_v1, &points_v, &bn_v2); @@ -1516,7 +1515,7 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self) } if (!rb_obj_is_kind_of(points_v, rb_cArray)) { - OPENSSL_free(bignums); + OPENSSL_free((void *)bignums); rb_raise(rb_eTypeError, "Argument2 must be an array"); } @@ -1532,12 +1531,12 @@ static VALUE ossl_ec_point_mul(int argc, VALUE *argv, VALUE self) bn2 = GetBNPtr(bn_v2); } if (EC_POINTs_mul(group, point2, bn2, points_len, points, bignums, ossl_bn_ctx) != 1) { - OPENSSL_free(bignums); - OPENSSL_free(points); + OPENSSL_free((void *)bignums); + OPENSSL_free((void *)points); ossl_raise(eEC_POINT, "Multiplication failed"); } - OPENSSL_free(bignums); - OPENSSL_free(points); + OPENSSL_free((void *)bignums); + OPENSSL_free((void *)points); } return r; -- cgit v1.2.3