From 25c50cd193d89ad0737219142bab191f12b8abe8 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 31 Aug 2006 10:30:33 +0000 Subject: * ruby.h (struct RString): embed small strings. (RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_bn.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext/openssl/ossl_bn.c') diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c index 47a607e60f..0ddcb8270d 100644 --- a/ext/openssl/ossl_bn.c +++ b/ext/openssl/ossl_bn.c @@ -124,22 +124,22 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self) switch (base) { case 0: - if (!BN_mpi2bn(RSTRING(str)->ptr, RSTRING(str)->len, bn)) { + if (!BN_mpi2bn(RSTRING_PTR(str), RSTRING_LEN(str), bn)) { ossl_raise(eBNError, NULL); } break; case 2: - if (!BN_bin2bn(RSTRING(str)->ptr, RSTRING(str)->len, bn)) { + if (!BN_bin2bn(RSTRING_PTR(str), RSTRING_LEN(str), bn)) { ossl_raise(eBNError, NULL); } break; case 10: - if (!BN_dec2bn(&bn, RSTRING(str)->ptr)) { + if (!BN_dec2bn(&bn, RSTRING_PTR(str))) { ossl_raise(eBNError, NULL); } break; case 16: - if (!BN_hex2bn(&bn, RSTRING(str)->ptr)) { + if (!BN_hex2bn(&bn, RSTRING_PTR(str))) { ossl_raise(eBNError, NULL); } break; @@ -165,13 +165,13 @@ ossl_bn_to_s(int argc, VALUE *argv, VALUE self) case 0: len = BN_bn2mpi(bn, NULL); str = rb_str_new(0, len); - if (BN_bn2mpi(bn, RSTRING(str)->ptr) != len) + if (BN_bn2mpi(bn, RSTRING_PTR(str)) != len) ossl_raise(eBNError, NULL); break; case 2: len = BN_num_bytes(bn); str = rb_str_new(0, len); - if (BN_bn2bin(bn, RSTRING(str)->ptr) != len) + if (BN_bn2bin(bn, RSTRING_PTR(str)) != len) ossl_raise(eBNError, NULL); break; case 10: -- cgit v1.2.3