diff options
author | matz <matz@ruby-lang.org> | 2006-08-31 10:30:33 +0000 |
---|---|---|
committer | matz <matz@ruby-lang.org> | 2006-08-31 10:30:33 +0000 |
commit | 7e82075e4a9791b833bf83b8198a71cd54fcca09 (patch) | |
tree | d4c52a670064c6bff26552cee94e94f99e8fa9b4 /ext/openssl/ossl_bn.c | |
parent | 35284a26599a05c329a1c3b8dbaf2bcb550e9423 (diff) | |
download | ruby-openssl-history-7e82075e4a9791b833bf83b8198a71cd54fcca09.tar.gz |
* 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
Diffstat (limited to 'ext/openssl/ossl_bn.c')
-rw-r--r-- | ext/openssl/ossl_bn.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c index 47a607e..0ddcb82 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: |